Post by glneo on Jun 25, 2004 13:43:24 GMT -5
I was told to put this into a new thread, right now I'm trying to put in some walls to the object check it out!!!
dim px#
dim py#
dim virtyo#(100)(2)
dim virtyo2#(100)(2)
dim wnum#
dim t#
dim x#
dim kros#(200)(2)
glloadidentity ()
gltranslatef ( 0, 0, -9.0)
glDisable (GL_DEPTH_TEST)
while true
glclear (gl_color_buffer_bit)
py# = py# + mouse_yd () * 10
px# = px# + mouse_xd () * 10
glBegin (GL_LINES)
glVertex2f (px#, -py# - .2)
glVertex2f (px#, -py# + .2)
glVertex2f (px# - .2, -py#)
glVertex2f (px# + .2, -py#)
glEnd ()
if x# = 0 then
if mouse_button (0) = true then
virtyo#(wnum#) = Vec3 (px#, -py#, 0)
wnum# = wnum# + 1
x# = 1
endif
endif
if mouse_button (0) = false then x# = 0: endif
glBegin(gl_line_loop)
for t# = 0 to wnum# - 1
glvertex3fv(virtyo#(t#))
next
glend ()
if mouse_button (1) = true then
for t# = 0 to wnum# - 1
virtyo2#(t#) = virtyo#(t#) + vec3 (0, 0, -1)
next
glbegin (gl_polygon)
for t# = 0 to wnum# - 1
glvertex3fv (virtyo#(t#))
next
glbegin (gl_polygon)
for t# = 0 to wnum# - 1
glvertex3fv (virtyo2#(t#))
next
glend ()
gosub rot
endif
SwapBuffers ()
wend
rot:
gltranslatef ( 0, 0, 0)
while true
glclear (gl_color_buffer_bit)
py# = py# + mouse_yd () * 100
px# = px# + mouse_xd () * 100
glpushmatrix ()
glrotatef (py#, 1.0, 0.0, 0.0)
glrotatef (px#, 0.0, 1.0, 0.0)
glbegin (gl_line_loop)
for t# = 0 to wnum# - 1
glvertex3fv (virtyo#(t#))
next
glend ()
gltranslatef( 0,0,0)
glbegin (gl_line_loop)
for t# = 0 to wnum# - 1
glvertex3fv (virtyo2#(t#))
next
glend ()
glbegin (gl_lines)
for t# = 0 to wnum# - 1
glvertex3fv (virtyo#(t#))
glvertex3fv (virtyo2#(t#))
next
glend ()
glpopmatrix ()
swapbuffers ()
wend