modelview and projection matrices

Started by
3 comments, last by kyewong 10 years, 4 months ago

Hi guys, I've got a tough problem regarding the modelview/projection matrix in opengl.

Say, I have a set of 3D points, and also their corresponding 2D screen positions, is it possible to solve for the optimal modelview (or the scale/rotation/translation) matrix which transforms all these 3D points to the 2D screen positions, when the projection matrix is fixed? or, is it possible to solve for such a projection matrix, when the modelview matrix is fixed?

Thank you and waiting for your answer(any suggestions or useful links are welcome!!)

Advertisement

Yes, that's possible in principle, but it's not simple.

Basically you just solve the resulting system of linear equations and you are done.

What makes this hard is that the system may be massively over-determined.This means, that some equations contradict each other, so you have to find a way of resolving those contradictions.

Google for suitable algorithms, if unsure.

Yes, that's possible in principle, but it's not simple.

Basically you just solve the resulting system of linear equations and you are done.

What makes this hard is that the system may be massively over-determined.This means, that some equations contradict each other, so you have to find a way of resolving those contradictions.

Google for suitable algorithms, if unsure.

Yes, it may probably be a over-determined problem, that's the reason why I said "optimal". My question now is, whether it is simple to solve for such a modelview matrix (or the translation/rotation/scale matrix), or such a projection matrix? don't know if there's any prior attempts on solving this problem...

In photogrammetry, this is a pretty standard problem, so we can consider it solved. ;-)

But as I already said: It is not simple.

You can probably get away with a reasonably good approximation by doing the following:

1) Solve the equation system for each pair of projected and unprojected points. This yields a transformation matrix for each pair.

2) Choose a good one from these by projecting all the points with each matrix and pick the one that produces the least error.

In photogrammetry, this is a pretty standard problem, so we can consider it solved. ;-)

But as I already said: It is not simple.

You can probably get away with a reasonably good approximation by doing the following:

1) Solve the equation system for each pair of projected and unprojected points. This yields a transformation matrix for each pair.

2) Choose a good one from these by projecting all the points with each matrix and pick the one that produces the least error.

Do you mean I should compute such a transformation matrix which is one part of the modelview matrix? If yes, then the projection matrix and factors should be considered fixed for this problem, it is right?

This topic is closed to new replies.

Advertisement