Scratchpad
It's the Scratchpad!
a
article
b
basic
book
c
computer-science
core-programming
d
data
f
free
g
game-design
game-design-document
game-design-novice
game-physics
game-programming
graphics
h
member
programming
programming-language
_redirect
software
_stub
variable
video-game-genre
wiki-list
windows
"People play games for emotional experiences and intellectual challenges." -
u9
TextMode(TEXT_OVERLAID)
declare sub drawCube(x, y, z)
declare sub drawSquare(x, xOff, y, yOff, z, zOff)
dim ang#
while true
ang# = 270
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glTranslatef(0,0, -10)
glRotatef(ang#, ang#, ang#, 0)
drawCube(2,2,0)
cls
print ang#
DrawText()
SwapBuffers()
wend
sub drawCube(x, y, z)
drawSquare(x, 1, y, 1, z - 1, 0) 'back face
drawSquare(x - 1, 0, y, 1, z, 1) 'left face
drawSquare(x + 1, 0, y, 1, z, 1) 'right face
drawSquare(x, 1, y - 1, 0, z, 1) 'top face
drawSquare(x, 1, y + 1, 0, z, 1) 'bottom face
drawSquare(x, 1, y, 1, z + 1, 0) 'front face
end sub
sub drawSquare(x, xOff, y, yOff, z, zOff)
glBegin(GL_QUADS)
glVertex3f(x - xOff, y - yOff, z - zOff)
glVertex3f(x + xOff, y - yOff, z + zOff)
glVertex3f(x + xOff, y + yOff, z + zOff)
glVertex3f(x - xOff, y + yOff, z - zOff)
glEnd()
end sub
Strange
TextMode(TEXT_OVERLAID)
declare sub drawCube(x, y, z)
declare sub drawSquare(x, xOff, y, yOff, z, zOff)
dim ang#
ang# = 0
while true
ang# = ang# + 1
if ang# = 360 then ang# = 0 endif
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glTranslatef(0,0, -10)
glRotatef(ang#, 0, 0, 0)
drawCube(2,2,0)
cls
print ang#
DrawText()
SwapBuffers()
Sleep(1)
wend
sub drawCube(x, y, z)
drawSquare(x, 1, y, 1, z - 1, 0) 'back face
drawSquare(x - 1, 0, y, 1, z, 1) 'left face
drawSquare(x + 1, 0, y, 1, z, 1) 'right face
drawSquare(x, 1, y - 1, 0, z, 1) 'top face
drawSquare(x, 1, y + 1, 0, z, 1) 'bottom face
drawSquare(x, 1, y, 1, z + 1, 0) 'front face
end sub
sub drawSquare(x, xOff, y, yOff, z, zOff)
glBegin(GL_QUADS)
glVertex3f(x - xOff, y - yOff, z - zOff)
glVertex3f(x + xOff, y - yOff, z + zOff)
glVertex3f(x + xOff, y + yOff, z + zOff)
glVertex3f(x - xOff, y + yOff, z - zOff)
glEnd()
end sub
page_revision: 6, last_edited: 1257153972|%e %b %Y, %H:%M %Z (%O ago)