Jump to content
  • Advertisement
Sign in to follow this  
dave_s_lyne

Computing an objects transformation matrix from intersecting pixel coordinates

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

Can anyone help me solve this problem? I have three known world-space xyz points located on a plane. All three of these points are visible to the camera. The cameras frustum is known and the locations in the cameras pixel space of each of the three points of the plane are also known. From this information is it possible to calculate the transformation matrix of the plane? I can only think of an iterative method that doesn't seem very robust. Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Yes I do. I have the frustum of the camera and I know the view port.

Also, just to clarify I'm assuming that the camera is placed at the origin with no rotation applied to it.

Share this post


Link to post
Share on other sites
In that case, what do you mean by the transformation matrix? The only transformation happening that I can consider is the projection of the plane onto screen coordinates. Do you actually know the full screen coordinates or just the x and y components of it (i.e. the 2D pixel coordinates)?

Share this post


Link to post
Share on other sites
Quote:
Original post by Fingon
In that case, what do you mean by the transformation matrix? The only transformation happening that I can consider is the projection of the plane onto screen coordinates. Do you actually know the full screen coordinates or just the x and y components of it (i.e. the 2D pixel coordinates)?



Just the x and y. Not the depth. Otherwise it would be very easy!

The transformation is the matrix defining the translation/rotation of the plane from the origin. I only know the local coordinates of the plane. The plane is not at the origin.

Share this post


Link to post
Share on other sites
Ah, that clarifies matters greatly for me. Indeed, I thought you had only the x and y coordinates, though I didn't want to treat this situation as more complicated than it might have been.

Intuition tells me that given the information you specified, an analytic solution ought to be possible (thought it may involve some tricky maths). Sorry for all the questions... last one is: do you know the scale relationship between the global and local world spaces (or are they identical)? Anyway I'll give everything some serious thought in the morning and let you know what I come up with then.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fingon
Ah, that clarifies matters greatly for me. Indeed, I thought you had only the x and y coordinates, though I didn't want to treat this situation as more complicated than it might have been.

Intuition tells me that given the information you specified, an analytic solution ought to be possible (thought it may involve some tricky maths). Sorry for all the questions... last one is: do you know the scale relationship between the global and local world spaces (or are they identical)? Anyway I'll give everything some serious thought in the morning and let you know what I come up with then.


They are identical. I know what you mean when you say an analytical method is possible as I've been thinking exactly the same thing but have been unable to come up with a solution!

Thanks so much for your efforts!

Share this post


Link to post
Share on other sites
Uhh. Given a point p in 3d space and the camera, then

p' = M * p, where M is the camera projection matrix and p' is the point in camera space.

You want p given p'.

As long as M is invertible, which it should be, I think the answer is just
p = M^(-1)p'

Once you have the 3 points in space, you can find the plane containing them.

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!