|
Post by PeterMaria on Apr 4, 2016 10:50:28 GMT -5
Hello, is Basic4Gl v2.6, get it now!
glMatrixMode (GL_PROJECTION) glLoadIdentity() glOrtho (0,windowwidth(),windowheight(),0,-1,1) glMatrixMode (GL_MODELVIEW) glDisable (GL_DEPTH_TEST) glEnable (GL_POINT_SMOOTH) glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
Function Mod(mm, mn) Return mm % mn End Function
Sub SetPoint(x,y,size#) glPointSize(size#) glBegin(GL_POINTS) glVertex2i(x,y) glEnd() End Sub
Function Rand(min,max) Return rnd()% (max - min + 1) + min End Function
dim a#,t#,xp#,yp#,zp#,xs#,ys#,w#,i dim xstars(400) dim ystars(400)
for i=0 to 400 xstars(i) = rand(0,windowwidth()) ystars(i) = rand(0,windowheight()) next
while scankeydown(27)=0 glclearcolor(0,0,0,1) glclear(GL_COLOR_BUFFER_BIT) for i=0 to 400 glcolor3ub(mod(i,255), mod(i,255), mod(i,255)) setpoint(xstars(i),ystars(i),1) next for t#=0 to 400 xp# = 120 * cos(t#*w#) yp# = 120 * sin(t#*6) zp# = a# * sin(t#)/3 xs# = 200 + xp# ys# = 200 - yp# glcolor3ub(200,255,200) setpoint(300 + xs# +(-zp#),160 + ys# + zp#,6) next a# = a#+4 if a# >=800 then a#= -a# w# =w#+1 if w#=14 then w#=1: endif endif swapbuffers() waittimer(10) wend
|
|
|
Post by matthew on Apr 5, 2016 10:37:13 GMT -5
Relaxing to watch, Peter. :-)
|
|