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

  • Home
  • SEARCH
  • 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 995421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:43:12+00:00 2026-05-16T06:43:12+00:00

I’m creating an Android app utilising OpenGL ES, and need some help with the

  • 0

I’m creating an Android app utilising OpenGL ES, and need some help with the vertex, texture and normal pointers. The examples I’ve seen stop at a fairly basic level so I seem to be missing a bit of information.

My basic draw() process is

gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
gl.glTexCoordPointer(3, GL10.GL_FLOAT, 0, uvBuffer);
gl.glDrawElements(GL10.GL_TRIANGLES, faceBufferLength, GL10.GL_UNSIGNED_BYTE, faceBuffer);

The vertex and uv are FloatBuffers constructed from the various x, y and z coordinates of the respective vertices and uv’s.

The faceBuffer is a ByteBuffer of indices pointing to the relevant vertexBuffer.

Each face consists of three vertices, and each face defines a different UV for it’s vertices (correct?)

My question therefore is, do I need to re-define each distinct vertex/uv combination in all the buffers?

Consider a simple tetrahedron. It consists of

4 vertices (three ‘base’ and one ‘point’):

Vertex 1: <1,1,1> (the point)
Vertex 2: <2,1,0>
Vertex 3: <0,0,0>
Vertex 4: <2,0,0>

3 uv coordinates (all faces have the same image)

UV 1: <0,0,0> (top left)
UV 2: <0,1,0> (bottom left)
UV 3: <1,0,0> (top right)

4 faces:

Face 1: v1/u1, v2/u2, v3/u3
Face 2: v1/u1, v3/u2, v4/u3
Face 3: v1/u1, v4/u2, v2/u3
Face 4: v2/u1, v3/u2, v4/u3

So my question is, how do I tell GL which UV to use for each face/vertex?

Should vertexBuffer have 4 sets of values in it, or 12? Must uvBuffer and vertexBuffer have the same number of items?

Basically, can I “re-use” vertices if they have different UV and/or normal values?

Or do I have to be unique:

Vertex  1: <1,1,1> (face A)
Vertex  2: <2,1,0> (face A)
Vertex  3: <0,0,0> (face A)
Vertex  4: <1,1,1> (face B)
Vertex  5: <0,0,0> (face B)
Vertex  6: <2,0,0> (face B)
Vertex  7: <1,1,1> (face C)
Vertex  8: <2,0,0> (face C)
Vertex  9: <2,1,0> (face C)
Vertex 10: <2,1,0> (face D)
Vertex 11: <0,0,0> (face D)
Vertex 12: <2,0,0> (face D)

UV  1: <0,0,0> (face A)
UV  2: <0,1,0> (face A)
UV  3: <1,0,0> (face A)
UV  4: <0,0,0> (face B)
UV  5: <0,1,0> (face B)
UV  6: <1,0,0> (face B)
UV  7: <0,0,0> (face C)
UV  8: <0,1,0> (face C)
UV  9: <1,0,0> (face C)
UV 10: <0,0,0> (face D)
UV 11: <0,1,0> (face D)
UV 12: <1,0,0> (face D)

Face 1: v1/u1, v2/u2, v3/u3
Face 2: v4/u5, v5/u5, v6/u6
Face 3: v7/u7, v8/u8, v9/u9
Face 4: v10/u10, v11/u11, v12/u12
  • 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-16T06:43:13+00:00Added an answer on May 16, 2026 at 6:43 am

    Duplicate the position data, as in have 12 vertex positions in vertexData. Do the same for the texture coordinates.

    The indices, as you noticed, index all the arrays with the same indices, so it is standard to duplicate the vertex positions so that each index has its own vertex data (position + UV).

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

Sidebar

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.