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® / Rigging / Constraint / Linking Issue
  RSS 2.0 ATOM  
2 pages: 1.2 first

Constraint / Linking Issue
Rate this thread
 
63254
 
Permlink of this thread  
avatar

I did a couple things.

I created a position node that would represent the main position of the strut. This node is important because it will maintain a clean transform relative to the main control. This Main_Strut_Position would also be link_constrained to the Main_CTRL, as to inherit all position and rotation information from the Main_CTRL. This Main_Strut_Position was initially lined up to the WheelDummy position in the Z, vertical axis.

Next I created a Strut_Position_CTRL. This helper has the transform_script on it. I created two variables in the transform script. strut, which is the Main_Strut_Position node and wheel which is the dummy you have linked to the rotating wheels.

Something to note, all of your objects even the helpers appeared to be scaled on the object themselves. That is really BAD!!! A lot of your objects had a matrix such as this, (matrix3 [0.045969,0,0.122881] [-0.123223,0,0.0460972] [0,-0.113414,0] [-2.65555,-0.0039885,0.160968]).  You can see the scale in the rotation and that should never be the case. You will want to clean this up on all of your objects. Utilities > Reset_Transform is your friend. You can check your transforms by selecting your object, going into the listener and type $.transform.

If you are going to scale things do them in the sub-object mode as the objects themselves should have a clean rotation matrix. For example. (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])
The first three rows should almost always be the example I provided above. The last row will be the position of your object but in this example the object is at the origin.

Also, if you need to scale helpers, I suggest using Point helpers as you can control the visual size and not the actual object scale. Never scale a dummy.

Here is a transform script I set on the Strut_Position_CTRL node.

-- set a default matrix
matrx 
matrix3 [1,0,0] [0,1,0] [0,01] [0,0,0]

-- make sure our dependent objects actually exist
if (strut != undefined) and (wheel != undefined) do (

 -- 
get the base transform
 matrx 
strut.transform 

 
-- zero out the difference between the wheel transform and the strut
 offset_matrx 
wheel.transform inverse strut.transform

 
-- set the return matrix x.position to be the current position plus the wheel offset
 matrx
.pos.+= offset_matrx.pos.x
)

-- return 
either the default matrix or the calculated matrix
matrx


Randall Hess
Senior Technical Animator
THQ, Volition Inc.

Attachment Attachment
Replies: 3
/img/forum/dark/default_avatar.png

Many thanks!! You’ve been so incredibly helpful.
And thank you for pointing out my mistakes, I shall learn from them.
I shall provide a link of the end result when I can.
Cheers!

Author: Snapod

Replied: 16 January 2012 08:12 PM  
/img/forum/dark/default_avatar.png

Good luck to you!

Author: Randall Hess

Replied: 17 January 2012 01:34 AM  
/img/forum/dark/default_avatar.png

With the slightest of tweaks to your rig, it works without fault and is now complete! I’ve got to admit, I couldn’t grasp how the transform script works, even with your explanation, so I just copy/pasted it.
I may use this in a short film in the future. Would you like your contribution to be reflected in the credits if I do?

Author: Snapod

Replied: 11 March 2012 03:12 PM  
avatar

It’s up to you but you are welcome to credit me. I’m glad its working out for you.



Randall Hess
Senior Technical Animator
THQ, Volition Inc.

Replies: 0
2 pages: 1.2 first