I have a plane in jit.gl.sketch that I am setting the position of. I am not sure what the values should be and what they depend on. Do they depend on the resolution of the jit.window? How? If I wanted to align 4 planes so that the first would be filling the windows and the rest would be positioned side by side along x, how would I do it? If I, say, have 1280×1024 and 1360×768 windows?
An example would be great but a pointer to an explanation would be good too. Am not managing to find this in the docs…
Jitter tutorial 32
Thank you. I had a look but this tutorial does not answer my questions (above).
I my case the view is set @ortho 2 @up 0. 1. 0.
So, what I need to know is how to set the dimensions and the position of my plane to match the resolution/proportions of my window….
Thanks again. Excuse beginner’s questions. I am sure it is simple enough…
I don’t think the window size matters at all, it’s just the window proportions. If the window is square you should get a full plane by going from -1 to 1 in each axis (X and Y). Modify to suit for rectangular windows, like typical 4X3 proportions would be 1.333 for X and 1.0 for Y.
Be sure your camera is at default position, which I think is 4.0 in the Z axis, though not totally sure about that…
Three possible things which may be of use:
1. jit.gl.render/sketch screentoworld message:
Converts screen coordinates to world coordinates, output out the dump outlet. The input x and y input coordinates are in pixels, and the input z coordinate is in normalized distance from camera (0.-1.), where 0. is the near clipping plane and 1. is the far clipping plane.
2. jit.gl.* transform_reset attribute:
Modelview and projection transform reset flag (default = 0) When the flag is set, the modelview and projection transforms are set to the identity transform before rendering the object. This is useful for sprite or billboard overlays, or automatic scaling to window size. The transform_reset flag modes are:
0 = do nothing (default)
1 = proportional orthographic glOrtho(-aspect, aspect, -1.0, 1.0, near_clip, far_clip);
2 = orthographic normalized glOrtho(-1.0, 1.0, -1.0, 1.0, near_clip, far_clip);
3 = proportional perspective with near clip = 0.001 gluPerspective(lens_angle, aspect, 0.001/*near_clip*/, far_clip);
4 = normalized perspective with near clip = 0.001 gluPerspective(lens_angle, 1.0, 0.001/*near_clip*/, far_clip);
3. jit.gl.sketch glortho command: Please see OpenGL documentation for usage, and read jit.gl.sketch tutorial 40 for how to use standard opengl commands in jit.gl.sketch
Thank you all. Knowing about -1 to 1 range and scaling to proportions fixed it for me it seems.
Thank you for the links. I shall check them out…
thanks jkc for the detailed answer. I’ve done a lot of experimentation with these kinds of commands and it’s not always totally clear what’s happening.
One other note, you could simply draw everything as though it was in a square (make your objects symmetrical in X and Y), then stretch the sketch object or stretch the whole GL world, by sending "scale 1.333 1. 1." to jit.gl.sketch or jit.gl.render. This would stretch everything in the X axis by 1.333, so a square object should then fit a 640×480 window, for example.
When you have a ton of objects and you start stretching them in different axes, it looks pretty awesome…
In this patch i’m testing videoplane positioning on a jit.window of specific size. The images should be evenly spaced i.e have a border of equal size. In the past using jit.render @scale .885 .885 1. @ortho 2 has made sense (trial and error), in this case something’s amiss.
----------begin_max5_patcher---------- 1190.3ocyZl0aapDE.9Y6eEGY02Zi0rwhqTTa+Sbe4lpHLLwdhfYbgwwN2p9 e+NK3Tm3k.1.JJVPXXxgy7MmUb983QSlq1xql.eE9WXzneOdzH2P1AFUe8nI EIaSySpbSaRppnfK0S9h+dZ9VsabQQxBdEHUZf+DWl+LTsJIkm8susap4BIO UsV5lOodP45BgLmqcBGWO3CJoVlTvcB9e3kYIxjcRQj4FUM+wav3I+UJp05c hAsmXpD+mSLX7zcCuJQmtTHWbeIOU6W5QQQlaC3.zdmnzoH3m1+l+Ldr8vWt RDgiQvJwVddEHpfLQkNQlxgGJUEPN+AC3xVvA0CPUZImKAPqfTifJcC5lgix 2RPeFGhtSdTxR6.xFF1UjMj4PIwdjPhsmXQWHWk7MFk6.rlqRxJ3UUfguS5h EO43K9chwOj94Ub+RbxD3mslKXuEW7L2Q2uSPWHWrKdiYwAf4FxzHFCyhAzT ymixFRKc4lMDrw6+wHANuQqen4T7kZ0rtXNurKLLvQGewSN0hWXCB.SlmHWb E1HXryswCkK1H4DNOkFklWGvQq1nJyy5u30zVxOK7NA3Pm2.xG0Ixa.g7gyw cr60qfF7Ibm3ew5F+qyiGVc1NWT4YdH0aAk6jPxrAHrCI1Sh.6rfHZe3tYwh KbPW.EZKgxkFGJzCFB1gjP7UAlSUbTdxyFEFnPcgjTBB1BDFB1HzKMOOeoSv bUYFur5NoeBzagYgl6kutBXG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