Sign in to follow this  

mouse picking problem

Recommended Posts

Hi all Ive made my own mouse picking code and it works except for the collision cordinates are being offset reletive to the world cooridinates. So if I click on point 0,0,0 the collision point is fine, but say if I click at 0,0,50, it will return the collision point as 0,0,60. This offset gets greater the further away from 0,0,0 you click. Has anyone have any ideas what might be causing this? Thanks.

Share this post

Link to post
Share on other sites

I guess your picking ray computation is off.
My own method is to compute coordinates of the 8 corners of the view frustum (I do that for frustum rendering when debugging - faster to get picking ray when the frustum is invariant and easier to check Ray computation).
Then, using the 2d mouse coordinates, I compute the near and far plane 3D coordinates.
Last I deduct the Ray parameters for picking.

Hope that helps.

Ghostly yours,

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this