jit.gl.render: Control 3D obj WITHIN the patch window+ ALSO in floating window?

Jan 16, 2012 at 6:43am

jit.gl.render: Control 3D obj WITHIN the patch window+ ALSO in floating window?

I am trying to create a VJ type setup with a jit.gl.render 3D object::: Being able to grab and move around the 3D object on the screen IN THE PATCHER window,, and have that motion / rotation SHOW in REAL TIME in the floating window… This way you could have a full screen external window (Being projected) AND be able to control the 3D object IN the PATCHER window (This way not showing the mouse while the 3D object is being controlled).
The help file for jit.gl.render … It shows how to toggle between views BUT NOT in REAL TIME. So I am lost…
Thanks in advance !

#61259
Jan 16, 2012 at 7:28pm

there’s a few ways to achieve this, but easiest is probably setting @shared 1 on you preview window and main window, creating a gl.node bound to your preview context, adding all drawing objects to that gl.node, capturing the gl.node to a texture (@capture 1), and displaying that texture on videoplanes in your two drawing contexts.

any animation objects attached to your objects bound to the gl.node which is drawing to the preview context, will receive mouse messages from the preview context.

patch below should get you started. let me know if you have any further questions:

– Pasted Max Patch, click to expand. –
#220837
Jan 16, 2012 at 7:32pm

You can send jit.gl.handle messages to more than one object at a time.

A good solution in Max 6 would be to parent your whole world under a jit.gl.node. Make a second context that renders to a preview window, which has something like a torus, or basic GL object rendering at a lower FPS in there. Hook up a jit.gl.handle to the torus, but *also* send the messages to the main jit.gl.node on your output. You can then manipulate the jit.gl.handle on the torus in your preview and have it translate, rotate, scale your scene in the VJ output.

I was going to make a demo patch, but Max 6 crashed, and I wrote a bug report instead.

#220838
Jan 16, 2012 at 7:34pm

Rob, that patch does not work for me under Max 6.0.3, (the scene renders but the handle/jit.anim does not rotate anything in the preview window, or the main window)

#220839
Jan 16, 2012 at 7:55pm

ahh yes. my apologies, that bug has been fixed for the next release.

here’s a version that uses gl.handle instead of anim.drive that should work in 6.0.3:

– Pasted Max Patch, click to expand. –
#220840
Jan 16, 2012 at 8:44pm

Thanks so so much ! This is EXACTLY what I wanted ! I really appreciate the help !

#220841
Jan 17, 2012 at 4:27am

Actually I have another stupid question… It seems that the size of the window in the patcher determines the size / resolution of the floating window’s content (ie The window in the patcher has to be at least as big as the floating window for the resolution to hold up)…
What I really wanted was a small preview window in the patcher that I could grab the 3d objects with to manipulate … But have a HUGE floating window with high quality visual output… This way I could control multiple small windows within the patcher before “mixing” them to the large floating window…

#220842
Jan 17, 2012 at 5:43am

Here is what I am working with ,,,

#220843
Jan 17, 2012 at 5:46am

Here is the file … I am super new using gl with max .. Wanted to create a control window for this…

#220844
Jan 17, 2012 at 5:44pm

on your jit.gl.node set @adapt 0 and @dim to the dimensions of your large window.

#220845
Jan 17, 2012 at 6:51pm

Ok got it ! Thanks Robert ! … PS can you show me how to connect my above attached patch in order to integrate this method into a patch… Thanks ! Like I said, I am pretty ok using msp … but not jitter .. I am a total novice.

#220846

You must be logged in to reply to this topic.