'##########################
' OpenGL 3D Shapes
' By Ashish Kushwaha
'##########################
' :)
'Sphere
'Cube
'Torus
'Cone
'Cylinder
'Used by GLH RGB/etc helper functions
DIM SHARED walk
'this will hold value about how close we are to our object walk = 5
IF shapeId
= 4 THEN shapeId
= 0 ELSE shapeId
= shapeId
+ 1 'Hi Sir!
'try to press 'w' or 's'
'Enable Z-Buffer read/write
_glLightfv _GL_LIGHT0
, _GL_AMBIENT
, GLH_RGB
(.15, .15, .15) _glLightfv _GL_LIGHT0
, _GL_SPECULAR
, GLH_RGB
(.8, .8, .8)
'clears the depth
'swich Projection matrix mode
'setting up perpective
'Now, we'll use ModelView
_glClear _GL_COLOR_BUFFER_BIT
OR _GL_DEPTH_BUFFER_BIT
'this clock# variable increases everytime as it is used for rotation.
clock# = clock# + .01
'note that here walk value should be negative.
'Lesser the walk, object become closes, and vise versa
glutSolidSphere .5, 50, 50
glutSolidTorus .2, .5, 50, 50
glutSolidCube .5
glutSolidCone .4, .5, 30, 30
glutSolidCylinder .2, .8, 40, 40
'used opengl rgba functions
DONT_USE_GLH_COL_RGBA(1) = r
DONT_USE_GLH_COL_RGBA(2) = g
DONT_USE_GLH_COL_RGBA(3) = b
DONT_USE_GLH_COL_RGBA(4) = 1
GLH_RGB
= _OFFSET(DONT_USE_GLH_COL_RGBA
())
DONT_USE_GLH_COL_RGBA(1) = r
DONT_USE_GLH_COL_RGBA(2) = g
DONT_USE_GLH_COL_RGBA(3) = b
DONT_USE_GLH_COL_RGBA(4) = a
GLH_RGBA
= _OFFSET(DONT_USE_GLH_COL_RGBA
())