adapt cornerpin to incoming model?

mr.l's icon

Hey,

is there any way to make a cornerpin object adapt to a gl.model?

I have several jit.gl.model objects. Each one reading a separate .dae (which are basically just planes) and then routing into individual cornerpin objects. (a jit.gl.node is in between).
My problem is, that the cornerpin takes the size of the window size and the model is sitting quite small inside of it.
Can I make the cornerpin adapt to the model instead of the window size?

Thanks!
luke

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

Rob Ramirez's icon

i'm not entirely sure what you are asking, but in general the solution is to make sure each node has adapt 0 and dims set to whatever output dims you want (if different then the window context dims), and each node has a jit.gl.camera bound to it.

the jit.gl.camera will handle proper viewport setting based on it's node's texture output dims.

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

mr.l's icon

Dear Rob,

thanks so much! Eventhough I do not understand why the camera needs to be bound to the node (or what it does), the adapt and dim do what I need.

To explain better I attach some screenshots.
In my original patch I loaded an object (also attached as s1.dae) and I got this result:

Mapping this onto a real-life screen is a pain.

In your solution (with my corrected dim-adjustments) I get this:

which I can then map easily:

That's more or less the other way around, as I meant.
I wondered if the cornerpin-object could adapt to what comes out of the jit.gl.node. Basically doing directly what is seen in screenshot3.
But I think I had a wrong understand of the cornerpin-object. As I understand now, the Upper-left 0. 0., upper-right 1. 0., lower-left 0. 1. and lower-right 1. 1. always descripe the corners of my final jit.window, right?
In your patch the content of what comes out of the jit.gl.node fills up the entire cornerpin object and when I map it correctly to it's original size I shouldn't loose quality, right?

I am sorry, my english is not good enough to explain it better.

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

s1.DAE.zip
zip 1.57 KB