any way to cheat spline interpmode to circular-like of jit.anim.path ?

Julien Bayle's icon

Hi there,
I need to create a circular movement of a jit.gl.cam around a static point.
jit.anim.path is perfect for this purpose.

how would I handle this using spline and a reasonable number of points in the path ?

subsidiary question: would I use jit.anim.path to keep the cam to look at the same point all along the movement ?

huge thanks for any leads.

Pedro Santos's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I would just use a pair of sin / cos functions to build a circular shape and to drive the camera... and a fixed lookat position.
If you want to really use jit.anim.path, i guess you could feed this position data to add points in jit.anim.path...

Julien Bayle's icon

I don't know which one would be the most cpu consuming.
sin/cos usually consumes but in Max, I guess they involve some lookup tables or like.
moving the cam, I don't achieve to fix the lookat. I mean, if I move the cam, the lookat attributes don't change BUT in fact, the cam doesn't look at the right point. (I'll play with other parameter like tripod etc.. I don't know)

Using 8 points distributed on a circle, I did that using jit.anim.path
at each point I set up the setrotatexyz and that seems to work fine

Julien Bayle's icon

@pedro, I finally implemented cos/sin as it comes more natural.
I need to make the speed of rotation variable.
I'll probably increase the resolution of the [counter] and use some [line] wizardry :)

Rob Ramirez's icon

use the locklook attribute to lock the camera's lookat point.

i would simply feed the circle points to a jit.anim.path, and control the speed using the rate attribute.

Julien Bayle's icon

Hi robert and thanks for your answer.
got it for locking lookat.
about the jit.anim.path, I guess I should append my points list with a reasonable number of points and use spline interp.
testing that...

Ben Bracken's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Rob showed me how to use matrix input to anim.path. This way you can generate the points with a jit.expr or jit.gen:

Julien Bayle's icon

This works fine! THANKS.
Doing that with jit.gen and playing with a variable path radius.

Pedro Santos's icon

How do you control the spline interp? Or are there some kind of "bezier points" to control its curvature, or at least a parameter to control its width?

Rob Ramirez's icon

the spline in jit.path (and anim.path and gl.path) is automatically generated using the Catmull-Rom method.
you can adjust the curve by editing these default handle values.
take a look at the gethandle and edithandle messages, and take a look at the "editing" tab of the jit.path help file.
remember to disable @autohandles if you plan to edit your handle values.