VicToMeyeZR,
I'm not sure why you pointed out that piece of code but it could be useful to click on an object in a 3D scene. This is something I have been trying to figure out how to do.
if MouseHit(1) == 1 then
if MouseX() > object.location.x and MouseX() < object.location.x + object.size.x and MouseY() > object.location.y and MouseY() < object.location.y + object.size.y then
object.color = Vec4(0, 1, 0, 1)
end
end
The question is.. how can I adapt this to click on an object in a 3D scene so that an event can take place? It has x and y reference for the mouse but no z. Could it be something like..
if MouseHit(1) == 1 then
if MouseX() > object.location.x and MouseX() < object.location.x + object.size.x and MouseY() > object.location.y and MouseY() < object.location.y + object.size.y and MouseZ() > object.location.z and MouseZ() < object.location.z + object.size.z then
object.color = Vec4(0, 1, 0, 1)
end
end
But if that would work, how could I relate it to a particular object in the scene?