Select 3d objects with the mouse

Blitz3D Forums/Blitz3D Programming/Select 3d objects with the mouse

Spikenspan(Posted 2003) [#1]
I'm working on a puzzle game that involves a cube formed of multiple cubes itself (i.e. rubik's cube). I want users to be able to highlight an individual cube by clicking on it.

The only way I was able to implement this is by projecting a small object from where the mouse is at the moment of the click over the z-axis until I detect a collision with a cube.

It works fine, but the problem is the perspective. Since the projection is on the z-axis, the highlighted cube isn't always directly where the cursor is, because of the perspective.

Anyone has a better way to do this?

Thanks.


Knotz(Posted 2003) [#2]
Make the cube pickable with EntityPickMode then
pick it with CameraPick.

Steven.


Spikenspan(Posted 2003) [#3]
Works perfect! thanks a lot!