jit.anim.path ribbon orient / rotation
Is there a way to rotate the anim.path like the jit.gl.path with the orient function. I want the path with pathstyle ribbon to lay flat. If i use the rotatexyz on the the jit.gl.path the animation of the gridshape doesn't follow..
does someone know a good solution?
orient ribbon on jit.anim.path doesn't work.
setorient
is specifically made to orientate points of a drawn path when drawn in ribbon or contour mode. This message works on [jit.gl.path] only. [jit.anim.path] doesn't draw anything by itself, it just drives an object along a path, thus orientation isn't available. However, you can define the rotation that should happen at any point for the driven object on that path, using setrotatexyz
(or setrotate
or setquat
) messages. Note that it won't change the way the path is drawn by the refered [jit.gl.path] using @drawpath.
Also, it seems that @drawpath to draw a representation of a [jit.anim.path] using a [jit.gl.path @pathstyle ribbon] prevents the setorient
messages from working. Not sure if it's a bug or expected. As a workaround, instead of relying on @drawpath, you can define the same points in your [jit.anim.path] and your [jit.gl.path]. But be careful when doing so: [jit.anim.path] append
messages takes at least 4 arguments (time pos.x pos.y pos.z) while [jit.gl.path] takes only 3 (pos.x pos.y pos.z).
Finally, if you want to rotate both the ribon and the path in their entirety and as a whole, you can make a hierarchy of [jit.anim.node].
Hi TFL,
Thanks for your reply!
I'm testing now switch the y and z axis of the path points in the world which looks (for now) good. The direction of the gridshape/model is only glitching with sharp turns now, hopefully i can manage to fix this.
The ribbon is now what i need, only the direction of the 3d model flips when it moves in a negative x direction. How to fix it that the model doesn't flip?
with the 'jit the cat' model it's maybe more clear what's happening.
(the camera position and the path points has to be orientated like this)
The model flipping is due to the way direction
plays with @tripod 1
, and the fact that your path is on the plan defined by the X and Y axis. I disabled tripod and it solved your issue.
I also added an extra [jit.anim.node] allowing to rotate the model independently from path-driven rotation (i've set it to work best for jit the cat).
Ah thanks a lot TFL!!
this make sense, but now i'm trying to combine it with a camera, but i don't get the view right. So apparently I don't quite get it yet 🙃.
Now i see the cat face but, how to flip the camera viewpoint so you see the cat from behind and the path where the cat is going to. So to flip from rearview to frontview.
I think I managed. I don't know if it's the most efficient way, but it works...
Your approach is right! Just need to play a bit with the camera rotation and position:
Not sure why both the camera and cat have to be tilted by 20 degrees on the z axis though.
EDIT: just saw your answer: you don't need the two [jit.anim.node] for the camera, just one is enough as rotation and position are fixed and not meant to change.