|
Rainbow Colourmap
Page history
last edited
by matthew 5 years ago

-
dim screenWidth = WindowWidth()
-
dim screenHeight = WindowHeight()
-
-
glMatrixMode(GL_PROJECTION)
-
glLoadIdentity ()
-
glOrtho(0, screenWidth, screenHeight, 0, 0, 1)
-
glDisable(GL_DEPTH_TEST)
-
glMatrixMode(GL_MODELVIEW)
-
glLoadidentity()
-
glTranslatef(0.375, 0.375, 0)
-
glDrawBuffer(GL_FRONT_AND_BACK)
-
glClearColor(0.0, 0.0, 0.0, 0.0)
-
glClear(GL_COLOR_BUFFER_BIT)
-
-
const frequency# = 0.3
-
-
dim red, green, blue, i, x, y
-
-
for x = 0 to screenWidth step 25
-
-
red = sin(frequency# * i + 0) * 127 + 128
-
green = sin(frequency# * i + 2) * 127 + 128
-
blue = sin(frequency# * i + 4) * 127 + 128
-
-
-
glBegin(GL_QUADS)
-
glColor3ub(red, green, blue)
-
glVertex2f(x, 0)
-
glVertex2f(x+25, 0)
-
glvertex2f(x+25, screenHeight)
-
glVertex2f(x, screenHeight)
-
glEnd()
-
-
SwapBuffers()
-
-
i = i + 1
-
-
next
-
-
beep()
Rainbow Colourmap
|
Tip: To turn text into a link, highlight the text, then click on a page or file from the list above.
|
|
|
Comments (0)
You don't have permission to comment on this page.