Jump to content
  • Advertisement
Sign in to follow this  
ashwathh

Coordinates of a point on a 3D Object.

This topic is 3242 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, I am displaying a 3D Image on the screen by reading a .x file(Directx file). I am trying to get the co-ordinates(x,y,z) of the point on the image when i click some where on the image.Can anyone help me please on this. Thanking in Advance, Ashwath.

Share this post


Link to post
Share on other sites
Advertisement
There's a few possible ways of doing it - you need to research techniques for 'picking'. The actual method to use depends on which language and platform you are using.

Share this post


Link to post
Share on other sites
Hi,

Thanks...I am using VC++.Net for this.Could you please provide me with the Code for this.Platform is WindowsXP.

Thanking you in advance,

Ashwath.

Share this post


Link to post
Share on other sites
Download the latest DirectX SDK, it has picking examples for DirectX9 and DirectX10, that should get you started. It demonstrates how to transform the mouse coordinates into a ray to intersect with objects in the scene, and how to determine the exact triangle and barycentric coordinates at the hit.

I believe they test the ray against the triangle's plane, and then check if the point of intersection is inside the triangle. This point will ultimately be the point of intersection with the triangle, too. So you can just study their method and then adapt it to a function to return that location.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!