Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Is there a limit for coords?

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    3

    Is there a limit for coords?

    Hi everybody,

    I can see a red and green triangle with this code:

    Code :
    vert.setVertices(( new float[] {    -14302f,-12200f,			1, 0, 0, 1,
    					      -14300f,-12200f,			1, 0, 0, 1,
    					       -14301f,-12202f,			1, 0, 0, 1,
    					      -14305f,-12200f,			0, 1, 0, 1,
    					       -14308f,-12200f,			0, 1, 0, 1,
    					       -14306f,-12202f,			0, 1, 0, 1,}),0, 6 * 6);

    Code :
    gl.glViewport(0, 0, width, height);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    GLU.gluPerspective(gl, 67, width/ height, 1f, 15f);
    gl.glMatrixMode(GL10.GL_MODELVIEW); 
    gl.glLoadIdentity(); 
    GLU.gluLookAt(gl, -14301f, -12201f, 10f, -14301f, -12201f, 0, 0, 1, 0);

    But can't see changing the first "1" for "2" in my coords.

    Code :
    vert.setVertices(( new float[] {    -24302f,-22200f,			1, 0, 0, 1,
    					      -24300f,-22200f,			1, 0, 0, 1,
    					       -24301f,-22202f,			1, 0, 0, 1,
    					      -24305f,-22200f,			0, 1, 0, 1,
    					       -24308f,-22200f,			0, 1, 0, 1,
    					       -24306f,-22202f,			0, 1, 0, 1,}),0, 6 * 6);

    Code :
    gl.glViewport(0, 0, width, height);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    GLU.gluPerspective(gl, 67, width/ height, 1f, 15f);
    gl.glMatrixMode(GL10.GL_MODELVIEW); 
    gl.glLoadIdentity(); 
    GLU.gluLookAt(gl, -24301f, -22201f, 10f, -24301f, -22201f, 0, 0, 1, 0);



    I only change the triangles and cam position.

    What's is wrong?

    Thanks.

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    3
    A few more details.
    I'm coding for Android Opengl ES 1.0

    And why a can see this triangle:

    -14302f,-12200f,
    -14300f,-12200f,
    -14301f,-12202f,

    with this lookat: GLU.gluLookAt(gl, -14301f, -12201f, 10f, -14301f, -12201f, 0, 0, 1, 0);

    and can't see:

    -24302f,-22200f,
    -24300f,-22200f,
    -24301f,-22202f,

    with this lookat: GLU.gluLookAt(gl, -24301f, -22201f, 10f, -24301f, -22201f, 0, 0, 1, 0);

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941
    Your limit is precision.
    No matter your GPU uses floating point values or fixed point values for storing the inputs you give to OpenGL, the implementation might not be able to represent that. With fixed point values you have a range [a,b] that can be represented with certain number of bits of precision, while with floating point, the number of digits that can be represented are the primary limiting factor, which, again, is based on the number of bits used as storage.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2012
    Posts
    3
    OK aqnuep thanks.

    But can you see a problem in my code?

    I mean, i'm giving some coords and looking to these coords and can't see my triangle, why?

    I expected same result with these different coords because i'm looking to the same point in these two scenes.

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •