# Computing an objects transformation matrix from intersecting pixel coordinates

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

## 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 on other sites
I think I understand what you're trying to accomplish... However, do you have the view and projection matrices for the camera?

##### Share on other sites
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 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 on other sites
Quote:
 Original post by FingonIn 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 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 on other sites
Quote:
 Original post by FingonAh, 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 on other sites
Why don't you know the depth?

##### Share on other sites
Quote:
 Original post by RDragon1Why don't you know the depth?

My software is using real imagery to generate the 3d representation.

##### 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.

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633667
• Total Posts
3013254
×