Post by GuppyB on Jul 9, 2004 21:57:11 GMT -5
Figured I should follow through with the primitives, this is essentially just a modded version of the "Cylinder Demo" that I uploaded.
...G
Enjoy:
...G
Enjoy:
dim xrot#, yrot#, zrot#
dim conerad , coneheight
dim i
dim cylinder_shade#
dim OldTick, CurrentTick , TimeTick , Frames , FramesSecond#
glEnable (GL_CULL_FACE)
TextMode (TEXT_OVERLAID)
OldTick = TickCount ()
while true
gosub FPSroutine
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glTranslatef(0.0,0.0,-5.0)
glRotatef(xrot#,1.0,0.0,0.0)
glRotatef(yrot#,0.0,1.0,0.0)
glRotatef(zrot#,0.0,0.0,1.0)
conerad = 1: coneheight = 4
gosub drawcone
DrawText ()
SwapBuffers ()
xrot# = xrot# + 0.1
yrot# = yrot# + 0.2
zrot# = zrot# + 0.05
wend
'********************Cone routine****************************
drawcone:
glColor3f(1.0,1.0,1.0)
glbegin (GL_triangle_fan)
glVertex3f (0.0 , (coneheight /2) * -1, 0.0)
For i = 0 to 36
cylinder_shade# = abs (0.055 * (18-i))
glColor3f(cylinder_shade#, cylinder_shade#, cylinder_shade#)
glVertex3f (conerad * cosd(i*10), (coneheight / 2), conerad * sind (i*10))
next
glend ()
glColor3f(0.5,0.5,0.5)
glBegin (GL_Polygon)
For i = 0 to 36
glVertex3f (conerad * cosd((36-i)*10), (coneheight /2) , conerad * sind ((36-i)*10))
next
glend ()
return
'*******************FPS routine****************************
FPSroutine:
CurrentTick = TickCount()
TimeTick = CurrentTick - OldTick
if TimeTick >= 1000 then FramesSecond# = Frames * (TimeTick/1000) : Locate 0,0: Print FramesSecond#: Frames = 0: OldTick = CurrentTick: endif
Frames = Frames + 1
Return