Forums > Jitter

Attach Letters to jit.gl.gridshape


Apr 04 2013 | 6:14 am

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
Apr 04 2013 | 9:15 am

You want a 3D letter or a texture?

Apr 04 2013 | 4:22 pm

For this project I just need 2D Textures.

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


t
Apr 04 2013 | 5:08 pm

Check Jitter tutorials 30 and 34…

Apr 04 2013 | 5:48 pm

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

Apr 04 2013 | 6:05 pm

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. --

Apr 05 2013 | 1:21 am

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?

Apr 05 2013 | 6:10 pm

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. --

Apr 05 2013 | 9:01 pm

thanks so much Rob! That worked more than perfectly!

Viewing 9 posts - 1 through 9 (of 9 total)

Forums > Jitter