Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to achieve the effect like Path Constrain using MAXScript?

How to achieve the effect like Path Constrain using MAXScript?

Anonymous
Not applicable
411 Views
2 Replies
Message 1 of 3

How to achieve the effect like Path Constrain using MAXScript?

Anonymous
Not applicable
Hello everyone!

I wanna animate a car.

I want to make the keys of position manually, and generate the car's rotation automatically.
I mean, first turn on Auto Key, second move the car to generate position keys, then the car rotates to follow the trajectory automatically, which is just like the effect of Path Constrain.

How can I achieve this?

Thank you!
Longing for answer!
0 Likes
412 Views
2 Replies
Replies (2)
Message 2 of 3

paulneale
Advisor
Advisor
So you want it to angle from side to side? For this you will need to get into some vector math. You
will need to same three points in time, the current, one back and one forward. Using acos and dot
product you will need to get the angle of the change in direction. From there you can rotate the car
the amount that you need.

ausn wrote:
> Hello everyone!
>
> I wanna animate a car.
>
> I want to make the keys of position manually, and generate the car's rotation automatically.
> I mean, first turn on Auto Key, second move the car to generate position keys, then the car rotates to follow the trajectory automatically, which is just like the effect of Path Constrain.
>
> How can I achieve this?
>
> Thank you!
> Longing for answer!
Paul Neale

http://paulneale.com


Paul Neale




EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you for your answer. Could you show me more details about your method? 'Cause I still don't get how to turn your method into an executable MAXScript.
And here's my script:
-- create an object
obj = box width:17 length:42 height:14
setTrajectoryOn obj true

-- animate the object's position
animate on
(
at time 33 obj.pos =
at time 66 obj.pos =
at time 99 obj.pos =
)

-- automatically rotate the object
......(script that I don't know how to achive)

You can see I wanna rotate the object to follow its trajectory.
This is what I wanna do.
0 Likes