Having OpenGL Text Dissolve Into Particles?

    Jan 02 2013 | 12:26 pm
    Hi, I am interested in having text generated using jit.gl.text2d or text3d turn into particles upon command. I have looked at jit.p.vishnu/shiva, but am uncertain as to how to connect text2d or 3d to such a patch. I also assume that Max 6 has similar particle systems as those two patches built-in, but am not yet familiar with Max 6.
    This user was trying for the same effect: https://cycling74.com/forums/opengl-text-movement People referred him to Jitter Recipe #19 Tannenbaum (https://cycling74.com/tutorials/jitter-recipes-book-2/), but I truly do not see the connection between his aim and the Tannenbaum patch. In Tannenbaum, the text is rendered using jit.gl.text2d, but it doesn't seem like any matrix operations are applied to the text after being rendered in text2d.
    Another possibility I considered was deleting the text and putting in a particle system in its place, but the effect I feel would be far less convincing. So I would prefer to have the text itself as a matrix which could then "dissolve".
    If anyone could provide a simple patch or reference to help me manipulate text in such a way it would be greatly appreciated!
    Much thanks :)

    • Jan 02 2013 | 7:01 pm
      jit.gl.text3d supports matrixoutput, so you can send this matrix to your particle system and draw the result with jit.gl.mesh.
      show us what you've got so far, and we can offer more help.
    • Jan 03 2013 | 1:39 am
      Hi Rob, thx for the reply. Using jit.gl.mesh was my original idea, but the connection between jit.gl.text3d and jit.gl.mesh seems more involved than with an object such as gridshape. Here is an example patch to show the discrepancy between how an object such as gridshape being used with jit.gl.mesh differs from an object like text3d being used with jit.gl.mesh:
      As you can see, jit.gl.gridshape will render with a very simple, direct connection. I am unsure of the necessary matrix manipulations needed to turn jit.gl.text3d into jit.gl.mesh. Here is my attempt at imitating what's in the helpfile for jit.gl.text3d, but still to no avail :/
      If someone could post a simple patch connecting jit.gl.text3d to jit.gl.mesh, and perhaps explain the logic of what's going on as well, that would be immensely helpful!
    • Jan 03 2013 | 1:49 am
      On a related, though different note, attached is my patch in full. The folder "falling_text" is just the patch with letters. The letters fall at random rates and random positions. This portion of the patch is completely functional and I am quite pleased with.
      From that patch, I would like to be able to issue a bang and have the letters "dissolve". The other folder "falling_text+Particles" is my patch with an attempt at integrating the jit.p.shiva+jit.p.vishnu patches to create this effect. jit.p.vishnu+jit.p.shiva have given me quite some trouble in creating this effect. My problems: 1. The position doesn't seem to work, as anytime I click the bang, the "dissolution" occurs in the middle of the screen. 2. I am unsure how to make the particles completely disappear. Setting the speed to -1 is the closest I have gotten, but still then there's a little particle puddle at the bottom of the screen.
      I think ultimately it would be much better and less cumbersome to use jit.gl.mesh, but again it's just the translation problem of getting jit.gl.text3d into jit.gl.mesh.
      Thanks again for any help :)
    • Jan 03 2013 | 1:50 am
    • Jan 03 2013 | 5:31 pm
      couple of issues with your patch. first, jit.gl.text3d outputs matrices of triangle vertices, but the default drawing mode of jit.gl.mesh is tri_grid. you can learn which drawing mode should to draw with matrixoutput by hooking a print object up to the matirxoutput.
      to draw jit.gl.text3d with jit.gl.mesh, set @draw_mode triangles.
      second, jit.gl.text3d is going to output a matrix for each letter every draw call. so you need to turn off automatic drawing on your jit.gl.mesh, and draw explicitly with a bang, each time a letter matrix is received.
      patch below demonstrates this.
    • Jan 03 2013 | 5:37 pm
      i made a text explosion patch a while back. what i ended up doing was, at the moment of explosion, changing the drawmode of the jit.gl.mesh to points, and then applying a vertex shader to explode the points out.
      the noise shader i used is below:
    • Jan 04 2013 | 12:28 pm
      rob, your jit.gl.mesh is working perfectly, and i've integrated it into my patch. many thanks. i haven't used shaders as of yet, but will read up on the tutorials and look at the help file and try to figure it out. thanks so much for your thorough replies and being so generous with your knowledge. cheers!
    • Jan 04 2013 | 2:11 pm
      thanks so much rob! this does the trick :) shader looks really cool, and the programming looks somewhat straight forward, will definitely have to explore the power of this object in the future. thanks again!