jit.geom question

Wil's icon

fiddling around with jit.geom

remove the jit.model (poor duck)

can use jit.gl.gridshape @matrixoutput 1

should be able to use jit.gl.text3d @matrixoutput 1 - but no...

how to get jit.gl.text3d to connect to jit.geom.togeom?

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

TFL's icon

jit.gl.textmult is an abstration that uses javascript to programmatically creates as much jit.gl.text as needed for the text input. But sadly it doesn't expose all available features of jit.gl.text.

But happily, because that's an abstraction, you could make a custom version of jit.gl.textmult with your own custom version of multiple_text.js (the file inside). I've done it before and it's feasible if you're patient, knows how to read js and knows a bit how jit.gl objects work.

But sadly, as of Max 9.0.3, the @matrixoutput attribute of jit.gl.text doesn't works very well as it outputs one matrix per glyph. So if you send "text ABC" to a [jit.gl.text @matrixoutput 1 @mode 3d] and you attach a print to its left outlet, you'll see 3 matrices output cyclically. The @concat_geometry attribute doesn't have effect here :(

So to draw you geometry from the matrixoutput of jit.gl.text, you either need to have one jit.gl.mesh per glyph, or concat all incoming matrices into one and use one jit.gl.mesh. Here are both techniques:

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

Now comes the fun part, ie. creating your custom version of multiple_text.js to make it generate its jit.gl.text. with @mode 3d @matrixoutput 1 (as matrixoutput on works in 3d mode) and get the result of all this, programmatically concat them to one big matrix that you'll be able to throw in jit.geom.

Have fun!

Wil's icon

hi TFL

Kind of understand where you are going

Don't quite get this much

What you posted has this error


If I allow the error to persist and try connecting to jit.geom, instant crash

Wil's icon

Thanks TFL!

I rarely share anything

But that jitter geometry kick ass!

Hats off to Max 9

TFL's icon

Basically what I meant is that I think it's technically possible to get the jit.matrix from a jit.gl.textmult but that requires to modify the jit.gl.textmult abstraction (more specifically the multiple_text.js file).

But you did well with jit.gl.text already!

I get the same errors as you but it seems to be a jit.gl.text bug and disappear quickly, not sure why.

Wil's icon

I looked at the multiple_text.js

over my head for now!

ended up like this

If you connect a message- the errors mostly happen when change depth, - keeps creating new matrix - so I don't change it once set

***also, [fromsymbol] straight to [matrix] works for individual letters - then make a jit.geom for each letter - and deal with frame rate (although I think I forgot to turn audio on while testing individual letters - and for some reason I also don't understand -> when audio is ON, vector 32/256, frame rate jumps from less than 30 to over 200fps- something maybe about Apple M1)

anyway - !!

Rob Ramirez's icon

There is actually a utility abstraction included in the distro for just this purpose called concat.drawgroups. It's a little tricky to get the hang of, but inside the abstraction are some instructions. In general I'd recommend setting automatic 0 for when utilizing matrixoutput like this, unless you really want the geometry reprocessed every frame. In this case you would send any jit.gl.text messages or attributes through the t b l so that the output matrices are recalculated, and then reconcated for geom-ification.

Thanks for the patch, I fixed up the issue with the state not bound error messages for the next update.

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


Wil's icon