Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Yoshi

Selecting an Object in 3D

This topic is 6709 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

I have the following problem (solution in D3D preferred): My goal ist to select(and probably move) an object in 3D Space with my mouse. My Idea was to convert two points back to world space. First : ScreenX,ScreenY, z=0.0 Second : ScreenX,ScreenY z=1.0 Then I wanted to construct a ray beetween these two points and check my objects abgainst this ray. The first object to collide would be the one selected. But how do I convert the two points back to World Space ?

Share this post


Link to post
Share on other sites
Advertisement
With the inverse of the camera matrix.

Do a search for calculating the inverse of a matrix on the internet. It should be a standard method in your matrix class.

Jaap Suter

Share this post


Link to post
Share on other sites
I have a function to inverse a matrix.
But my problem is to invert the projection matrix.
Someone said to me that this isn''t possible.
D3D does the following transformations.
World,Camera,Projection,Scale and /w.
So I need to invert this matrices and select an right w.
But what is the right w?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!