|
Post by PeterMaria on May 18, 2016 15:48:19 GMT -5
Hello,
a little bit curlicue. a test for basic4gl v2.6
glMatrixMode (GL_PROJECTION) glLoadIdentity() glOrtho (0,windowwidth(),windowheight(),0,-1,1) glMatrixMode (GL_MODELVIEW) glDisable (GL_DEPTH_TEST)
Sub Setpixel(x#,y#,size#) glPointSize(size#) glBegin(GL_POINTS) glVertex2f(x#,y#) glEnd() End Sub
dim x#, y#, f#, i#
for i#=1 to 100000 f# = f# - 3.148 x# = -x# + cos(i#*f#) y# = -y# + sin(i#*f#) glcolor3ub(255, 255, 255) setpixel(500+x#,380+y#,1) next
swapbuffers()
|
|
|
Post by matthew on Jun 14, 2016 14:14:02 GMT -5
Do you remember this one from the old Basic Programming Forum, Peter?
' Create a 2d screen ' glmatrixmode(gl_projection) glloadidentity() glortho(0, 800, 600, 0, 0, 1) gldisable(gl_depth_test) gldrawbuffer(gl_front_and_back) glmatrixmode(gl_modelview) glloadidentity()
' Clear the screen to black ' glclearcolor(0.0, 0.0, 0.0, 0.0) glclear(gl_color_buffer_bit)
dim i#, x#, y#, f#, px#, py#
while i# < 100000 f# = f# + 3.4 + sqr(2) + 0.0196 x# = -x# + cos(f#*i#) y# = -y# + sin(f#*i#) px# = x# + 400 py# = y# + 300 glbegin(gl_points) glcolor3ub(100, 175, 255) glvertex2f(px#, py#) glend() i# = i# + 1 wend
glflush()
|
|