PDA

View Full Version : different result when scripting


CrackleWax
06-09-2006, 01:21 PM
nevermind, found it!

Hiya,

probably a simple question

suppose there's a box at position [5,0,0]

when applying an xform modifier via scripting ( addmodifier $ (xform ()) )
then $.transform equals (matrix3 [1,0,0] [0,1,0] [0,0,1] [5,0,0])

when applying an xform modifier manually
then (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])

Why does this difference in row4 of the transform matrix occur? And how can I get the same result in scripting?

thnx,

Obi

Jeff_hanna
06-09-2006, 02:42 PM
What do you have your reference coordinate system set to on the main toolbar? I have mine set to the default "view" and I get the same transform results (matrix3 [1,0,0] [0,1,0] [0,0,1] [5,0,0]) regardless of whether I apply an XForm modifier via the modifier panel or via MaxScript.

From your results it looks like the modifier is being applied in worldspace when you use MaxScript and in localspace when use use the modifier panel. Read the MaxScript docs under the topic of "coordsys" to learn how to change the coordinate system context in MaxScript as necessary.

CrackleWax
06-09-2006, 03:55 PM
hi jeff,


that's exactely what was wrong!

thnx!

Obi

CGTalk Moderation
06-09-2006, 03:55 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.