简体   繁体   中英

Transform plane to another coordinate system

I have a camera coordinate system defined by rotation matrix R and translation T with respect to the world coordinate system. A plane is defined in the camera coordinate by the normal N and point P on it. I want to find the equation of the plane in the world coordinate system. Currently I'm doing it is:

Transform P to world system by (P + T)
Transform N to world system by R.N

Then I'm finding the equation of the plan using the transformed P and N . I have two questions:

1) If we take the perpendicular distance of the camera center to the plane in camera coordinate system, that should be equal to the perpendicular distance of camera location to plane in world coordinate system, right ?

2) Assuming the above is true, my current transformation is giving incorrect results for example plane of N=[1,2,1] and P=[1,4,0] (in camera) and R = (90, 0, 90) in XYZ euler and T =[3, 3, 9]

Am I doing something wrong ? Thanks

A pure rotation matrix about z-axis for row vectors (for column vectors simply transpose it) will look like this

 cosθ  sinθ  0
-sinθ  cosθ  0
  0      0   1

Rotation about x-axis is expressed by the following pure rotation matrix

1    0     0
0  cosα  sinα
0 -sinα  cosα

Angles should be in radians unless you use something that can properly evaluate trig functions with degrees.

To change the basis of the vector, you concatenate rotations R = R x R z (order matters) and then multiply your vector by the result V' = VR

To translate your point, you simply apply the same rotation and then translation P' = PR + T

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM