[Sidefx-houdini-list] camera Rotation and Translate to Matrix3

Agent Xray xray at agentxray.com
Thu Jul 12 23:22:20 EDT 2012


What context? Can you use a 4x4 matrix? Here's a way to do it in Python:

 >>> cam = hou.node('/obj/myCamera')
 >>> camMatrix = cam.worldTransform()

This yields a 4x4 matrix object representing the camera transform in 
world space. You may then Explode it or extract various transforms from it.

explode <http://localhost:48626/hom/hou/Matrix4#explode> 	Return a 
dictionary with keys 'rotate', 'scale', 'translate', and 'shear' whose 
values are hou.Vector3 objects. When applied in the specified order, the 
corresponding rotations, scales (and shears), and translations will give 
this matrix.
extractRotates <http://localhost:48626/hom/hou/Matrix4#extractRotates> 
A shortcut for self.explode(transform_order, rotate_order, 
pivot)['rotate']. See hou.Matrix4.explode for more information.
extractScales <http://localhost:48626/hom/hou/Matrix4#extractScales> 	A 
shortcut for self.explode(transform_order, rotate_order, 
pivot)['scale']. See hou.Matrix4.explode for more information.
extractShears <http://localhost:48626/hom/hou/Matrix4#extractShears> 	A 
shortcut for self.explode(transform_order, rotate_order, 
pivot)['shear']. See hou.Matrix4.explode for more information.
extractTranslates 
<http://localhost:48626/hom/hou/Matrix4#extractTranslates> 	A shortcut 
for self.explode(transform_order)['translate']. See hou.Matrix4.explode 
for more information.


-=X


On 7/9/2012 8:42 AM, Alvaro Castaneda wrote:
> HI guys
>
> I need help with this
>
> I need to extract the translate and rotate of my camera, objects also  I
> guess, and build
> that into a 3x3 matrix.
>
> help :(
>
> thanks
>
>
>
>
>   *.:varomix:.*
> MIX Studio
> Houdini Wizard *<|:)
> www.varomix.net
>    : [image: LinkedIn] <http://www.linkedin.com/in/varomix> [image:
> Twitter]<http://twitter.com/varomix> [image:
> Facebook] <http://www.facebook.com/varomix> [image:
> about.me]<http://about.me/varomix>
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list





More information about the Sidefx-houdini-list mailing list