Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4020000
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:10:26+00:00 2026-05-20T10:10:26+00:00

I am working in Android using Open GL ES. I have been trying to

  • 0

I am working in Android using Open GL ES. I have been trying to move our UI from Android Views into 3D. I am seeing some odd behavior with the vertex placements.

I have two different Quads. One is -0.5,-0.5 -> 0.5,0.5 and the other is 0,0 -> 1,1 yet when I render them they both appear on top of each other. As if they were both 0,0 -> 1,1 (the Ortho projection is setup from 0,0 to 1,1). They are both being sent through the same pipeline so I am not sure how this can happen.

Another odd and possibly related issue. Giving one of then quads a translation of 0.5 moves it entirely across the screen, rather than just half way as I would expect with a projection of 0,0 -> 1,1.

Here are some snippets from the Java…

//Fixed Point Class
public static final int FIXED_POINT = 16;

public static final int ONE = (1 << FIXED_POINT);
public static final int HALF = (ONE >> 1);

//Vertex Setup
mNumVerts = 6;

    ByteBuffer vbb = ByteBuffer.allocateDirect( mNumVerts * 2 * 4 );
    vbb.order( ByteOrder.nativeOrder() );
    mVtxBuf = vbb.asIntBuffer();

    vbb = ByteBuffer.allocateDirect( mNumVerts * 2 * 4 );
    vbb.order( ByteOrder.nativeOrder() );
    mTexBuf = vbb.asIntBuffer();

    mVtxBuf.put( -Fixed32.HALF ); mVtxBuf.put( -Fixed32.HALF ); mTexBuf.put( 0 ); mTexBuf.put( Fixed32.ONE );
    mVtxBuf.put(  Fixed32.HALF ); mVtxBuf.put( -Fixed32.HALF ); mTexBuf.put( Fixed32.ONE ); mTexBuf.put( Fixed32.ONE );
    mVtxBuf.put(  Fixed32.HALF ); mVtxBuf.put(  Fixed32.HALF ); mTexBuf.put( Fixed32.ONE ); mTexBuf.put( 0 );

    mVtxBuf.put( -Fixed32.HALF ); mVtxBuf.put( -Fixed32.HALF ); mTexBuf.put( 0 ); mTexBuf.put( Fixed32.ONE );
    mVtxBuf.put(  Fixed32.HALF ); mVtxBuf.put(  Fixed32.HALF ); mTexBuf.put( Fixed32.ONE ); mTexBuf.put( 0 );        
    mVtxBuf.put( -Fixed32.HALF ); mVtxBuf.put(  Fixed32.HALF ); mTexBuf.put( 0 ); mTexBuf.put( 0 );

    mVtxBuf.position( 0 );        
    mTexBuf.position( 0 );

//and….

    mVtxBuf.put( 0 ); mVtxBuf.put( 0 ); mTexBuf.put( 0 ); mTexBuf.put( Fixed32.ONE );
    mVtxBuf.put( Fixed32.ONE ); mVtxBuf.put( 0 ); mTexBuf.put( Fixed32.ONE ); mTexBuf.put( Fixed32.ONE );
    mVtxBuf.put( Fixed32.ONE ); mVtxBuf.put( Fixed32.ONE ); mTexBuf.put( Fixed32.ONE ); mTexBuf.put( 0 );

    mVtxBuf.put( 0 ); mVtxBuf.put( 0 ); mTexBuf.put( 0 ); mTexBuf.put( Fixed32.ONE );
    mVtxBuf.put( Fixed32.ONE ); mVtxBuf.put( Fixed32.ONE ); mTexBuf.put( Fixed32.ONE ); mTexBuf.put( 0 );        
    mVtxBuf.put( 0 ); mVtxBuf.put( Fixed32.ONE ); mTexBuf.put( 0 ); mTexBuf.put( 0 );

    mVtxBuf.position( 0 );        
    mTexBuf.position( 0 );

//Projection Setup

                gl.glMatrixMode( GL10.GL_PROJECTION );
                gl.glLoadIdentity();
                gl.glOrthox( 0, Fixed32.ONE, 0, Fixed32.ONE, -Fixed32.ONE, Fixed32.ONE );

//Render

                {
                    gl.glDisableClientState( GL10.GL_NORMAL_ARRAY );

                    gl.glScalef( thing.getXScale(), thing.getYScale(), thing.getZScale() );
                    gl.glTranslatef( thing.getX(), thing.getY(), thing.getZ() );

                    gl.glFrontFace( GL10.GL_CW );
                    gl.glVertexPointer( 2, GL10.GL_FIXED, 0, mdl.getVtxBuf() );
                }


                gl.glTexCoordPointer( 2, GL10.GL_FIXED, 0, mdl.getTexBuf() );
                // gl.glColorPointer( 4, GL10.GL_FLOAT, 0, mColorBuffer );
                gl.glDrawArrays( GL10.GL_TRIANGLES, 0, mdl.getVtxCount() );    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:10:27+00:00Added an answer on May 20, 2026 at 10:10 am

    As many of you may have guessed, I must have missed something. The vertices were being edited in my objects super class on a per-frame basis to handle an old issue with aspect ratio. Thus the vertices were not really -.5,-.5 – .5,.5 they were all reset to be 0,0-1,1. Thanks for the time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that appends some rows to a table. One of the
I'm working on a project in C# w/ XNA, and I want to reorganize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.