Author Topic: Gl_ Cubes_Street  (Read 1733 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Gl_ Cubes_Street
« on: December 05, 2015, 07:09:53 AM »
Hi,
Code: [Select]
include "gl.inc"
window 800,600,1
#lookahead

while key(27)=0
glClear GL_COLOR_BUFFER_BIT OR GL_DEPTH_BUFFER_BIT
glLoadIdentity
glTranslatef -12.0, -8.0, -6.0
glRotatef -68.0, 1.0, 0.0, 0.0
for a=1 to 100
for c=1 to 10
    DrawCube()
    glTranslatef 3.0, 0.0, 0.0
next
   glTranslatef -30.0, 4.0, 0.0
next
SwapBuffer
Wait (10)
wend
WinEnd

sub DrawCube()
    glBegin GL_QUADS
    glColor3f   0.0, 1.0, 0.0
    glVertex3f  1.0, 1.0,-1.0
    glVertex3f -1.0, 1.0,-1.0
    glVertex3f -1.0, 1.0, 1.0
    glVertex3f  1.0, 1.0, 1.0
    glColor3f   1.0, 0.5, 0.0
    glVertex3f  1.0,-1.0, 1.0
    glVertex3f -1.0,-1.0, 1.0
    glVertex3f -1.0,-1.0,-1.0
    glVertex3f  1.0,-1.0,-1.0
    glColor3f   1.0, 0.0, 0.0
    glVertex3f  1.0, 1.0, 1.0
    glVertex3f -1.0, 1.0, 1.0
    glVertex3f -1.0,-1.0, 1.0
    glVertex3f  1.0,-1.0, 1.0
    glColor3f   1.0, 1.0, 0.0
    glVertex3f  1.0,-1.0,-1.0
    glVertex3f -1.0,-1.0,-1.0
    glVertex3f -1.0, 1.0,-1.0
    glVertex3f  1.0, 1.0,-1.0
    glColor3f   0.0, 0.0, 1.0
    glVertex3f -1.0, 1.0, 1.0
    glVertex3f -1.0, 1.0,-1.0
    glVertex3f -1.0,-1.0,-1.0
    glVertex3f -1.0,-1.0, 1.0
    glColor3f  1.0, 0.0, 1.0
    glVertex3f 1.0, 1.0,-1.0
    glVertex3f 1.0, 1.0, 1.0
    glVertex3f 1.0,-1.0, 1.0
    glVertex3f 1.0,-1.0,-1.0
    glEnd
end sub

.