|
Post by Mottyman on Mar 24, 2006 14:26:29 GMT -5
Another quick set of code I made up, again based on the Starfield1 demo, it forms 2 lines of dots that twirl around on the screen, sparkling slightly.
Const Points = 720 dim Dots#(Points)(2) dim i dim rdot# dim Colour# dim theta# dim theta2#
glDisable (GL_DEPTH_TEST)
while true glClear (GL_COLOR_BUFFER_BIT)
for i = 1 to Points
glLoadIdentity() gltranslatef(0,0,-450) theta# = theta# + 0.99 theta2# = theta2# + 0.97 'degree increments if theta# >= 7200 then theta# = theta# - 7200 endif if theta2# >= 7200 then theta2# = theta2# - 7200 endif 'stops the variables getting too high, kinda freezes the wave if it does Dots#(i) = vec3 ((i-360), (sind(theta#)*50) + 3 * (i % 2), (cosd(theta2#)*75)) 'plotting the dots, the i % 2 splitting it into 2 lines, try higher values for more If Rnd() % 40 = 0 then Colour# = 1 else Colour# = 0.5 endif 'makes random points sparkle glRotatef(rdot#,1.37,-0.83,1.13) glBegin (GL_POINTS) glVertex3fv (Dots#(i)) glColor3f (Colour#,Colour#,Colour#) glEnd () next rdot# = rdot# + 1 SwapBuffers () WaitTimer (50)
wend
|
|