Sign in to follow this  

mouse picking problem

This topic is 3550 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Hi,

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,
Red.

Share this post


Link to post
Share on other sites

This topic is 3550 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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