|
Post by PeterMaria on Jul 17, 2015 12:53:08 GMT -5
Hi, an alien tree.
Sub init2D(width,height) glMatrixMode (GL_PROJECTION) glLoadIdentity() glOrtho(0,width,height,0,-1,1) glMatrixMode (GL_MODELVIEW) glDisable(GL_DEPTH_TEST) End Sub
Sub Line(x0,y0,x1,y1,lsize#) glLinewidth(lsize#) glBegin(GL_LINES) glVertex2i(x0,y0) glVertex2i(x1,y1) glEnd() End Sub
dim depth:depth=9
Init2D(640,480) Sub Draw(x1,y1,angle#,d#) dim x2#,y2# if d#>0 then x2# = x1 + cosd(angle#) * d# * 10 y2# = y1 + sind(angle#) * d# * 10 glColor3ub(255-depth*10, 255-d#,85) line(x1,y1,x2#,y2#,d#) Draw(x2#,y2#,angle# - 20,d#-1) Draw(x2#,y2#,angle# + 20,d#-1) end if End Sub
Draw(300,460,-90,depth) swapbuffers()
|
|
|
Gl_Tree
Jul 17, 2015 15:39:19 GMT -5
Post by matthew on Jul 17, 2015 15:39:19 GMT -5
Nice Peter, it reminds me of the one you did in thinBasic. :-)
|
|