Attach Letters to jit.gl.gridshape

Jonas Obermueller's icon

Hey, I'm working on an Installation right now where I want to show Letters for Note-Names on jit.gl.gridshapes that are attached to a jit.phys.body.

What would be a good way to attach a Letter (or symbols in general) to overlay and follow the gridshape?

Thank you!

t's icon

You want a 3D letter or a texture?

Jonas Obermueller's icon

For this project I just need 2D Textures.

But if you mind I would also be interested how you could achieve 3D letters.

t's icon

Check Jitter tutorials 30 and 34...

Jonas Obermueller's icon

Alright thanks alot! I'll work through them and see if I have any questions left afterwards.

Rob Ramirez's icon

i would recommend gl.text3d for this (even if you want 2d text).

simply create one combination of phys.body and gl.text3d for each letter. you can change the letters dynamically using the "text" message.
you will probably want to create a "pool" of these objects using something like poly~ or javascript, in order to update the text and manage the objects.

the patch below shows the basic steps. i've included a jit.anim.node object inserted between the phys.body and gl.text3d, to allow offsetting of relative position using the @anchor attribute (otherwise the text won't be centered inside the body vertically.

Max Patch
Copy patch and select New From Clipboard in Max.

additionally, you want to disable @send_scale of the phys.body, so you can scale it independently of the attached objects.
you may also want to change the shape to cube, rather than the default of sphere.

Jonas Obermueller's icon

Hey Rob, thank you so much for the great reply!

I want to connect the jit.gl.text3d via the jit.anim.node to my existing jit.phys.body.

This works well and the text follows the body perfectly, but as soon as I connect the jit.gl.text to the body the jit.gl.gridshape looses it's connection and vice versa?

Is it possible to connect multiple objects to follow the body?

Rob Ramirez's icon
Max Patch
Copy patch and select New From Clipboard in Max.

phys.body and anim.node can only attach to a single gl object.
however, anim.node can have multiple child anim.nodes, so you can do something like the following.

Jonas Obermueller's icon

thanks so much Rob! That worked more than perfectly!