Forums > Jitter

OpenGL Position

Oct 30 2010 | 11:44 am

I have a plane in 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…

Thank you.

Oct 30 2010 | 1:02 pm

Jitter tutorial 32

Oct 30 2010 | 2:44 pm

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…

Oct 30 2010 | 9:02 pm

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…

Oct 30 2010 | 9:04 pm

Three possible things which may be of use:

1. 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.* 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. glortho command: Please see OpenGL documentation for usage, and read tutorial 40 for how to use standard opengl commands in

Oct 31 2010 | 1:41 am

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…

Oct 31 2010 | 3:24 am

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 or 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…

Nov 04 2010 | 2:20 pm

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.

-- Pasted Max Patch, click to expand. --

Viewing 8 posts - 1 through 8 (of 8 total)

Forums > Jitter