[Closed] Edit spline to achieve certain result when using Path Constraint
I have:
- a spline with 10(or any other number) segments oriented on world Y axis
- an object with applied Path Constraint controler. The spline is used as path
Is it possible to:
- edit the spline, using maxscript, so:
- in the first 25% of the spline the Z axis of the object points to world +Z axis
- 25-50% the Z axis of the object points to the world +X axis(or – X axis)
- 50-75% the Z axis of the object points to the world -Z axis
- 75-100% the Z axis of the object points in the middle between +X and +Z axis, or something similar.
What I have to edit in the spline? In and Out tangents of the knots(segments)?
The banking function in the path constraint is hardly predictable. If it’s an option, the simplest way would be to just keyframe the objects rotation as it goes along the path; build some matrices with the direction(s) you need and apply them based on the along path value (path_constraint_controller.percent) of the object.
This is solution, but it will works with objects that is “modified” by the script.
I want to modify the spline, so no matter how objects uses the spline as a path for Path constraint, the rotation of the objects always will be the same – beacuse of the spline modification.
you can’t do anything with spline to change its ‘normal’. any max spline has only tangent. how to calculate a normal and matrix is up to you.
so in you modifier you have to specify what axis to use to build a matrix and how to rotate it to do what you want.
You mean that I have to create matrix for each tangent and apply those matrices to the tangents?
i mean you have create a matrix based on tangent and position for every specified path param.
but the system gives you only vector (tangent) and position. to make a matrix you need at least one another vector that is not parallel to the tangent.