Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Rotate bends gizmo givin a world space rotation matrix
  RSS 2.0 ATOM  

Rotate bends gizmo givin a world space rotation matrix
Rate this thread
 
64226
 
Permlink of this thread  
avatar
  • AdrianG
  • Posted: 06 February 2012 11:41 PM
  • Total Posts: 22
  • Joined: 25 December 2008 10:52 PM

Hi,
I have some animated chunks exported from Thinking particles that I need to rotate the bend gizmo at a certain direction.

Here are the details:
The flat part of the chunks that I need to bend is perpendicular to X axis.
Ai need to rotate the bends gizmo axis around the X axis pointing to a world coordinates vector
The chunks have scale in them (they was exported like this), looks like all of them are uniform scaled.

Here is the calculation of rotation matrix:

vec1 [-1.00.00.0] --World space need to look at vector
upVecObj 
normalize ($.transform).row1 --X axis (in this case the upVectorof the chunk
vecz 
normalize (cross upVecObj vec1) --Z axis perpendicular
vecy 
normalize (cross upVecObj vecz) --Y axis that is trying to perserve the lookat vector
newRot 
matrix3 upVecObj vecy vecz   [1,1,1] --New rotation

now I need to apply this to $.modifiers[1].gizmo.rotation non incremental (absolute)
Didn’t found any good solution…
I even tried to bring the direction vector to object space first then create the rotation matrix, still the X axis was corect but Y an Z offseted in rotation

Thanks



Replies: 2
/userdata/avatar/avatar_14884.gif

Have you looked at the ”Modifier Sub-Object Transform Properties” page of the maxscript help?

-Eric

Author: PiXeL_MoNKeY

Replied: 10 February 2012 10:11 AM  
/img/forum/dark/default_avatar.png

Eric, thanks for reply,
actually I’ve read that page, but it’s describing how to get the proprieties of an mod, that are in the mod space (TM).
But doesn’t that TM is defined by the object Gizmo (that I need to transform) ?
Looks like the Gizmo it is in the object space and for transforming it in absolute rotation I need to bring the worldspace matrix to the object space only.
If that is the case then the problem its the same. :(
Or maybe I’m wrong?

Author: AdrianG

Replied: 10 February 2012 09:51 PM