sphere-scene ( gadget -- )


Vocabulary
spheres

Inputs and outputs
gadgetan object


Definition


: sphere-scene ( gadget -- )
GL_DEPTH_BUFFER_BIT GL_COLOR_BUFFER_BIT bitor glClear [
solid-sphere-program>> [
{
[
"light_position" glGetUniformLocation
0.0 0.0 100.0 glUniform3f
]
[
{ 7.0 0.0 0.0 } 1.0
{ 1.0 0.0 0.0 1.0 } (draw-colored-sphere)
]
[
{ -7.0 0.0 0.0 } 1.0
{ 0.0 1.0 0.0 1.0 } (draw-colored-sphere)
]
[
{ 0.0 0.0 7.0 } 1.0
{ 0.0 0.0 1.0 1.0 } (draw-colored-sphere)
]
[
{ 0.0 0.0 -7.0 } 1.0
{ 1.0 1.0 0.0 1.0 } (draw-colored-sphere)
]
[
{ 0.0 7.0 0.0 } 1.0
{ 1.0 0.0 1.0 1.0 } (draw-colored-sphere)
]
[
{ 0.0 -7.0 0.0 } 1.0
{ 0.0 1.0 1.0 1.0 } (draw-colored-sphere)
]
} cleave
] with-gl-program
] [
plane-program>> [
{
[
"checker_size_inv" glGetUniformLocation
0.125 glUniform1f
]
[
"checker_color_1" glGetUniformLocation
1.0 0.0 0.0 1.0 glUniform4f
]
[
"checker_color_2" glGetUniformLocation
1.0 1.0 1.0 1.0 glUniform4f
]
} cleave GL_QUADS [
-1000.0 -30.0 1000.0 glVertex3f
-1000.0 -30.0 -1000.0 glVertex3f
1000.0 -30.0 -1000.0 glVertex3f
1000.0 -30.0 1000.0 glVertex3f
] do-state
] with-gl-program
] bi ;