jit.gen output to jit.gl.node?
I'm trying to glue some snippets of code together.
I have a sphere being deformed according to audio input. This is a jit.gl.gridshape that has further processing done through jit.gen, and is originally going directly to a jit.gl.render with "quad_grid" appended to the output of jit.gen.
However in the code I'm trying to glue this into, I need to find a way to draw this in the context of a jit.gl.node.
Ordinarily I could use the gl.node name for the gl.gridshape object, but since it undergoes further processing with @matrixoutput 1 flag enabled, I'm not sure how to do it.
Thanks for any help!
jit.gl.node @name sub
jit.gl.mesh sub @draw_mode quad_grid
send the output of jit.gen into the jit.gl.mesh
Thanks Rob!
One follow-up question.
Before-hand, I was able to apply a jit.gl.material to the gridshape and render it correctly.
With these changes, I don't seem to be able to apply the material anymore.
I tried adding @material to the gl.mesh object and changed the name of the gl.material to , which did something, but not what I had before.
How can I get my material to apply to the deformed gridshape again? Thanks.
Update: I'm getting some luck adding @matname .jitmtl to the jit.gl.mesh object, but that will just turn it the color of the matfile, all of the "niceness" (shadows, lights, sense of 3Dness) is still missing from the stand-alone render...
post your patch
Ok, I think I have everything in this zip.
https://www.dropbox.com/s/wpbkmtwjqtbcejz/SoundsphereInOculusMaterial.zip?dl=0
It's kind of messy right now, a mix of Graham Wakefield's Oculus help patcher and Sem Shimla's audiovisualizer.
https://github.com/grrrwaaa/max_oculus
https://www.dropbox.com/sh/kvi10hw1628a9yg/AAB7j3tdlxPD0t2IF07D5qkga?dl=0#
If you go into p world -> p sphere1 you'll see the WIP area.
If you look at Sem's original patcher the sphere textures nicely...
Thanks! PS I don't think you need a real Oculus DK2 to run so it should work for you.
Here's as far as I got today, trying to get not one but two realtime deformed spheres into the Oculus scene, with independent jit.handle control over each one (eventually would like to move the objects around with Kinect, but that's too far off).
I get pretty lost with the hierarchy, as in, which things to name uniquely so that I could, say, apply independent materials or independent jit.handle control to each sphere.
I bet if I was just able to figure this one part out I could get the rest without further assistance :)
you need to provide normals to your jit.gl.mesh. easiest way is probably to enable @autonormals 1 on your jit.gl.mesh.
Thanks again!