Clipping before transformation

Hi, all.
glLoadIdentity();
<translate, rotate, scale>
<draw stuff>

That’s OK,
But I want to clip the <stuff> to a smaller area thatn the screen, etc.

I have tried adding
glpushmatrix();
glloadientity();
<insert clipping here>
glpopmatrix();

just after the translations, but the clipped area is not a clear rectangle around the screen, it seems to be transforming the clipping plane anyway.

er, help?

Can you clear one thing up for me, do you mean Screen as whole viewing area or as the opengl viewing context/canvas
if my guess is correct you are creating the context as a full screen window, you might only want it to be over a part of the display not full screen

I am wanting to clip the openGL canvas.
My code runs happily in a window or fullscreen.

I am just wanting to limit part of my scene to a fixed are. After this part is drawn, I will remove the clipping planes and draw other things in the rest of the screen/window.

Search the spec for ‘Scissor’. Works only for rectangular regions, but that might be sufficient for you. If it’s not, you need user clip planes.

glScissor(x,y,width,height);
glEnable(GL_SCISSOR_TEST);

//draw stuff

glDisable(GL_SCISSOR_TEST);

Hiya.

Yeah scissor does what I asked for, but sadly I hve moved teh goal-posts.

I was hoping to render part of my scene in a clipped area into the selection buffer, and scissor only stops screen pixel changes, so objects clipped with scissor still end up in the buffer :frowning:

I have resorted to the “correct” method of gluProject.

See new post for my new question.

Thanx for the help