_TITLE "Move cursor on shape(s)."
DIM SHARED mouseX
, mouseY
, gl
, collision
, obj_type
cubes
(i
).
pos.x
= p5random
(-1 ,1) cubes
(i
).
pos.y
= p5random
(-1, 1) cubes
(i
).
pos.z
= p5random
(-0.8,0) cubes
(i
).col.x
= rnd : cubes
(i
).col.y
= rnd : cubes
(i
).col.z
= rnd cubes(i).rot.x = p5random(0,360)
cubes(i).rot.y = p5random(0,360)
cubes(i).rot.z = p5random(0,360)
gl = -1
collision = selectBuffer(3)
? collision, hits&
collision = 0
_glLightfv _GL_LIGHT0
, _GL_AMBIENT
, glVec4
(0.1, 0.1, 0.1, 0) _glLightfv _GL_LIGHT0
, _GL_SPECULAR
, glVec4
(0.8, 0.8, 0.8, 0) _glLightfv _GL_LIGHT0
, _GL_POSITION
, glVec4
(1, 1, 0, 0)
gluPickMatrix mouseX
, _HEIGHT - mouseY
, 1,1, viewport&
()
_glcolor3f cubes
(i
).col.x
,cubes
(i
).col.y
,cubes
(i
).col.z
drawCube 0.22
selectBuffer(3) = buffer(3)
drawCube 0.22
tmp=tmp+1
p5random!
= RND * (mx!
- mn!
) + mn!
internal_vec4(0) = x
internal_vec4(1) = y
internal_vec4(2) = z
internal_vec4(3) = w
glVec4%&
= _OFFSET(internal_vec4
())