Notifications
Clear all

[Closed] Local transforms and MaxScript/FloatScript

Oh ye of such gilded knowledge, bequeath upon me of thy knowledge :bowdown:

I have a small issue regarding how FloatScripts deals with how an object is transformed in world space rather than local space. Now I have a series of point objects, all of which have a float script on their Y and Z axis, and the original plan was to have this script:

sin((F+FrameOffset)*Frequency)*Strength

wherein Frequency is speed, and strength is distance travelled per cycle – the problem is however that this will move said point objects in world space rather than local, and I need them to move in local.

Are there any suggestions on how to solve this or another way of having adjustable oscillation?
Much thanks

3 Replies

here is a solution…
the position controller script:


   [ F, 0, 0 ] * R.value
 

where:
F – frames
R – node’s own rotation controller

the node has to move in X local direction

Thanks, but it doesn’t seem to want to work. I’ve put your script in as you suggested (with my equation as a separate rotation controller.

So I have this:

-> Position Script ([F,0,0] R.Value]

-> Rotation List:
->Euler XYZ (for R)
->X Rotation (sin(F) for test purposes)(set inactive with a weight of 0)
->Euler XYZ (for rotation)(set active with a weight of 100)

It seems to want to transform along the world axis instead of its local. However, I have come up with a bodge job to get what I wish for.

If I parent said point object to another point object, and rotate that other object so that the point controller will move relative to its parent’s axis. hey, whatever gets the job done eh?

Still interested to see what solutions come up though, :lightbulb

 eek

Transforms are always relative be it to there parent, the world or some space. If you wanted the position to be relative to another object without it being parented you put it in that objects space.

(transMatrix [10,0,0] * target.transform).pos