jit.anim.node jit.anim.drive

 Quick overview of jit.anim.node and jit.anim.drive

 How do we move things in jitter? You could specify the @position/rotation/direction on a gridshape itself & perhaps attach variables to them. Totally valid, but the intended way to move things, or animate things is to use the jit.anim.node and jit.anim.drive.
The benefits  of using these two nodes is that you get to make hierarchical transformations.
Eg. A parent node might move from left to right, whilst the child node inherits this horizontal motion whilst it rotates & moves up and down. This allows for some nice modular kinda motions.

Jit.anim.drive we saw before, can be used to move things around with our mouse and keyboard input. It is possible to change the mapping of this node by first double clicking on it whilst the patch is locked (or holding ctrl then double clicking) - copying the contents of the file that opens & then pasting/making changes to it in another "dictionary", which you would create by hitting "n", then typing "dict" followed by a name for your dictionary. eg. "n myDict".
I think I'll go into dictionaries and implementing this a bit more in another post. 

Thing to note - if you need something to be a float, always always remember to add a . after a number. Eg. 0. 0. 0. if you were setting the default arguments for something. 

 Here's an example of using jit.anim.node and drive to make the torus wobble.

 

I'm using a send + receive metro, from the jit world to generate bangs.. This then goes into a "counter", which can be reset if you wish. The counter outputs into a "float" node, to "convert" it to float type, which then gets fed into a sine node. I then multiply the resultant sine value by 10, and then "pak" this value into the Y of a vector. I've left the X and Z as value zero.
This pak is useful because it spits out the list (x y z values) everytime any input is updated. It goes into a message node with the "rotatexyz" message and the variables $1 $2 $3 - which the pak'd values substitute.

That message is then passed into the jit.anim.node, which is also scaling  the gridshape uniformly by 0.5.
It should be noted that anim.node and anim.drive both override whatever you hardcode into the gridshape node. It will ignore all transform attribs.

Notice that I plug in the jit.anim.drive above the anim.node because drive is *always* the parent. It can't be a child, apparently. With this you can move the object around with your wsadqz keys and the wobble will be applied after that.

Compressed-patch - should be able to copy and paste this!

<pre><code>
----------begin_max5_patcher----------
1152.3ocyX00aqhCD84To9e.g5Sqxh7mXXep+OtZUjShatzkXPFSu4tWs+2W
+AIMsEHNYozUpITL3L9blwybF+q6uaQ75pChl3n+H5aQKV7KyHKbiYGYwwAV
DumeXSIuw8hw6EMM7ch3kcOTKNncOPIZD5SCWy0a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l92LtrP9giz1wW1G7NJtopUs43lmSGoZzYFcqnwTn6TOke6jvL
6KMr2LbCZOJ64zfzfrmsOYSw8ovf1VPCvfrICg3PrGZxLGYdMm8jum03kfv2
6WUUpsB0EZKK3kf8buu7Rv1qeDdRvrsj3kMHdx33T57ZO6AFGXNfIBfvfMHZ
FiZsGopMK2GhZgSQl8fxCggSWdufH4ioim.ClG71xIpV4a8V8auzdMWm1.dc
8KBUS2L7Vxny5YuPk7k96Kj968hYhUhWJNNEleHtxH+Razd0pbKv3Cocxob5
iTRit+tvHKVsl1IkSZzx2Ty8nxI4696Luv+hju+tS
-----------end_max5_patcher-----------
</code></pre>

 

Comments

Popular posts from this blog

displaying a jitter movie

load texture using path