Maintaing object size

how would i render a scene, clipping the edges instead of scaling the image?

all of the ways i’ve tried end up also losing the “squareness” of the objects…

If I understand it right do you want to use glOrtho in some way. (?)

oh, i’m sorry, friend, i guess i didn’t explain correctly.

no, this is for a 3d scene using perspective projection.

what i mean is that when you render a scene to a window, then shrink the window by half, the image is scaled by 1 half…

well, i want to keep the image the same size, just clip it instead…

well, i figured, glScalef() the images to divide out the size of the window, then mutiply by the width of the screen… no dice. everything now is shaped relative to the shape of the window (long tall window == long tall image)

so i tried including aspect ratios (the screen’s and the window’s): in gluPerspective, incorporating it into the glScalef(), using both aspects, dividing one into another… still, no dice, nothing works right.

has anyone else solved it? i’m sure i can, but i just wanted to see if someone else already had…

thank you for your bandwidth

-Succinct

Originally posted by Succinct:
[b]
what i mean is that when you render a scene to a window, then shrink the window by half, the image is scaled by 1 half…

well, i want to keep the image the same size, just clip it instead…
-Succinct[/b]

why not create a new frustrum that matches the viewport? so when the viewport is resisized, resize the view frustrum accordingly. this would save all the glScale* calculations…

glViewPort() is the way to go…

if you’re using GLUT, then follow this:

create a function
void myViewPort(GLint x, GLint y)
{
calculate new view port
glModelViewMatrix(GL_PROJECTION);
glLoadIdentity();
glViewPort(new viewport)
set the persective (if needed)
}

in your main()
after you create a window call
glutReshapeWindow(myViewPort);

Hope this helps,
Rizo