matrix output from jit.gl.sketch or js jsglsurface.js

t's icon

Hi,

I am interested in morphing between various 3D geometry objects by simply crossfading between them using jit.xfade. You can try this by changing the values in the yellow numberbox in the patch below. In this patch I am crosafading between two matrices from jit.gl.gridshape objects. Is it possible to output the matrix from jit.gl.sketch to do the same? jit.gl.sketch has a matrix output but I don't know how to enable it? What about getting a matrix from jsglsurface.js?

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

Thank you!

seejayjames's icon

awesome with the jit.xfade!

FineCutBodies's icon

Also would be interested if "jit.gl.sketch" can output matrix data!

Anybody know if it's possible?

slo ~|•'s icon

Can the render context not be a jit.matrix?

Rob Ramirez's icon

jit.gl.sketch does not support matrixoutput.

Anthony Palomba's icon

So I am still interested in morphing between various 3D geometry objects. How would one do that in Max?

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

@Rob: Thanx!
@Anthony: check out the green area of this patch and try to play with the red numbox...

Anthony Palomba's icon

Ahhh I see, pretty cool. Originally I had envisioned using jit.gl.model instead of jit.gl.gridshape. Not sure if there is a way to convert the vertex data of the model into some thing "morphable". But this is very useful!

There is one question I still have... is there any way I can convert the output of this new jit.gl.renderer shape morpher to a matrix. I want to be able to send the video out a syphon connection to an external application.

FineCutBodies's icon

didn't try but what's the problem setting "@matrixoutput 1" with the jit.gl.model object? i guess it will send out it's matrix like gridshape.... isn't it?

Anthony Palomba's icon

Hey folks, for some reason I am getting some strange results form the last patch that was posted. It looks like the color of the mesh lines are getting messed up. The color also seem to change when I go from fullscreen to mini window. I have attached a screenshot. I have also confirmed that the same result happens when I paste the original patch. Any ideas?

5006.ScreenShot20130207at12.59.18PM.png
png
Rob Ramirez's icon

jit.gl.model does support matrixoutput, but it outputs triangle vertices, unlike jit.gl.gridshape which outputs tri_grid vertices.
so you can't mix the two, and if you want to draw with jit.gl.mesh, you must set the @draw_mode to triangles.

this has been posted about many times in the forum, and a search will reveal many patches and info.

no idea what the color problems you're seeing are about. if you can post a patch and steps to reproduce, and relevant system info, i can take a look.

Rob Ramirez's icon

if you want to send to syphon, use a jit.gl.node to capture the output to a texture.

Anthony Palomba's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here is the patch that is exhibiting the issue, it really should not be any different than the one that was previously posted. I changed the formatting a bit. I get the same result if I use the original pasted patch.

FineCutBodies's icon

Anthony: Sorry, i can't get that color problem you say... even with the patch you've posted all seems ok for me...

Anthony Palomba's icon

Hmmm that is odd. Maybe it is a graphics chipset issue. I am running OSX 10.7 on a MBP (late 2011), Max 6.08

Chipset Model:    AMD Radeon HD 6770M
Type:    GPU
Bus:    PCIe
PCIe Lane Width:    x8
VRAM (Total):    1024 MB

Anthony Palomba's icon

It appears that the problem as something to do with jit.gl.mesh render mode.

The original line was...
jit.gl.mesh Kevin @lighting_enable 1 @scale 4. 4. 4. @poly_mode 1 2
which specifies line and point rendering.

This seems to fix things...
jit.gl.mesh Kevin @lighting_enable 1 @scale 4. 4. 4. @poly_mode 1 1

I also had to change the gl renderer erase color to something other than black.

Anthony Palomba's icon

@Rob,
"jit.gl.model does support matrixoutput, but it outputs triangle vertices, unlike jit.gl.gridshape which outputs tri_grid vertices.
so you can't mix the two"

Is there an easy way I can convert triangle vertices to tri_grid vertices?

Anthony Palomba's icon
Rob Ramirez's icon

probably much easier to go the other way.
search google for "convert triangle strip to triangles" (tri_grid is actually GL_TRIANGLE_STRIP)