Thursday, June 24, 2010

[android-developers] Re: OpenGL works incorrectly when projection matrix is set to identity?

On Jun 24, 12:05 am, satlan esh <satlan_...@yahoo.com> wrote:
> I have an OpenGL app that manipulates it's geometry in screen space to
> acheive some effects, and therefore bypasses OpenGL's matrices by
> setting modelview and projection to identity. For some reason,
> Android's OpenGL implementation seems to be unhappy with this, and
> doesn't draw anything.

You should at least call glOrtho{f,x} to establish the mapping. The
homogeneous clipping limits are:

-w <= x <= w
-w <= y <= w
-w <= z <= w

If your vertex is of form (x, y, z, 1) you will only see xyz values
between -1 and 1 if you simply pass-through the vertex values. This
doesn't work the same way the xyz_rhw vertices work in D3D if you are
trying to do the same thing with GLES. Just a guess as don't know your
input range.

In case I missed something obvious, the glOrtho should do the trick.

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

No comments:

Post a Comment