Attach Letters to jit.gl.gridshape

Apr 4, 2013 at 6:14am

Attach Letters to jit.gl.gridshape

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!

#67516
Apr 4, 2013 at 9:15am

You want a 3D letter or a texture?

#242938
Apr 4, 2013 at 4:22pm

For this project I just need 2D Textures.

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

#242939
Apr 4, 2013 at 5:08pm

Check Jitter tutorials 30 and 34…

#242940
Apr 4, 2013 at 5:48pm

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

#242941
Apr 4, 2013 at 6:05pm

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.

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.

– Pasted Max Patch, click to expand. –
#242942
Apr 5, 2013 at 1:21am

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?

#242943
Apr 5, 2013 at 6:10pm

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.

– Pasted Max Patch, click to expand. –
#242944
Apr 5, 2013 at 9:01pm

thanks so much Rob! That worked more than perfectly!

#242945

You must be logged in to reply to this topic.