Select 3d objects with the mouse

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

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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.