Obj level camera rotation convert to HPB angle?
1315 8 2- liang444366454
- Member
- 18 posts
- Joined: May 2023
- Offline
- liang444366454
- Member
- 18 posts
- Joined: May 2023
- Offline
- liang444366454
- Member
- 18 posts
- Joined: May 2023
- Offline
It's actually not as simple as I thought.I want to export the camera's tracking points into AE.But Houdini uses a right-handed coordinate system.It is possible to convert the coordinates of all objects to the values of the left-hand coordinate. The rotation Angle of Houdini's camera was then converted into an Euler Angle? I tried all the axial directions -180 degrees.All the coordinates turned out to be wrong
Edited by liang444366454 - Nov. 4, 2023 06:37:44
- jomaro
- Member
- 85 posts
- Joined: April 2017
- Offline
- liang444366454
- Member
- 18 posts
- Joined: May 2023
- Offline
- viklc
- Member
- 143 posts
- Joined: May 2017
- Offline
You can try the extract functions for the matrix rotation. It is similar to cracktrasform [www.sidefx.com] but specific to hpb rotation.
// XYZ to HPB rotation. vector xyz_to_hpb(matrix M) { vector tmp = 0; tmp.x = atan2(M.zx, M.zz); tmp.y = atan2(M.zy, sqrt(M.zx * M.zx + M.zz * M.zz)); tmp.z = atan2(M.xy, M.yy); return tmp; } // HPB to XYZ rotation (requires an hpb-orientated matrix). vector hpb_to_xyz(matrix M) { vector tmp = 0; tmp.x = atan2(M.yz, M.zz); tmp.y = atan2(-M.xz, sqrt(M.xy * M.xy + M.xx * M.xx)); tmp.z = atan2(M.xy, M.xx); return tmp; } // xform components. vector t = chv("t"); vector r = chv("r"); vector s = chv("s"); float scale = chf("scale"); // Create matrix from xfrom components. matrix M = maketransform(0, 0, t, r, s * scale); // XYZ to HPB rotation. v@HPB_rot = degrees(xyz_to_hpb(M)); // Apply matrix to Points. @P *= M;
Edited by viklc - Nov. 5, 2023 09:47:09
- liang444366454
- Member
- 18 posts
- Joined: May 2023
- Offline
- liang444366454
- Member
- 18 posts
- Joined: May 2023
- Offline
- viklc
- Member
- 143 posts
- Joined: May 2017
- Offline
-
- Quick Links