I am new to openGL and I am probably misunderstanding something
fundamental here, so any hints would be appreciated...

In a nutshell, glOrthof() does not seem to be clipping within its
bounds (as glFrustrumf() does). I expected the left, right, top,
bottom, near and far bounds of the glOrthof() call to define a 3D
clipping box, but it does not seem to be so. Have I missed something?
Do I need to do my own clipping for an orthographic projection
(possibly with clip planes)?

Here is my perspective test (the model view and projection matrices
are both the identity matrix). I am running the emulator.

    glViewport( 10, 10, 50, 50 );
    graphics.glFrustumf( -100, +100, -100, +100, 1, 20 );
    ... // Draw a huge 5000x5000, 4-vertex red rectangle centered on
the plane z == -10

This draws exactly as expected - a small viewport-sized (50x50) red
rectangle appears about 10 pixels from the lower left edges of the
screen. The large rectangle was clipped neatly into the view frustum
and fitted into the viewport. Now, try an orthographic projection
instead of the perspective one, with no other changes:

    glViewport( 10, 10, 50, 50 );
    graphics.glOrthof( -100, +100, -100, +100, 1, 20);
    ... // Draw a huge 5000x5000, 4-vertex red rectangle centered on
the plane z == -10

Here, the entire screen is filled with red. The red rectangle was not
clipped to the view frustum (which, for an orthographic projection, is
a view box), so the rendering spilled outside the viewport.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to