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 7445933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:10:21+00:00 2026-05-29T12:10:21+00:00

I am curious how glDrawElements uses it’s indices. Let’s say I have array of

  • 0

I am curious how glDrawElements uses it’s indices. Let’s say I have array of indices {1, 2, 3, 4, 5, 6}, drawn by GL_TRIANGLES. My question is, whether it forms 2 triangles by indices “123”, “456” or 4 triangles “123”, “234”, “345”, “456”. I am importing .obj model, data are loaded as they should, but the rendering just gets messed up.

  • 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-29T12:10:23+00:00Added an answer on May 29, 2026 at 12:10 pm

    In GL_TRIANGLES mode, it needs 3 vertices for every triangle, thus it will pull 3 indices at a time (so, it will draw the two triangles with indices 1,2,3 and 4,5,6).

    Different figures apply if you have adjacency or draw a triangle strip, of course.

    Also, since you mentioned that you are importing an OBJ file, do note that there may be different indices on vertices and texture coordinates and/or normals in the OBJ file.
    This is not a bug, but a feature. This is allowable in OBJ, and many exporters do that when surfaces are smooth shaded (i.e. two faces share a normal) to conserve space.
    You must construct a list of unique vertices, each with its own normal, texcoord, etc. and use the indices for these.

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

Sidebar

Related Questions

Curious whether folks have setup 2 way transactional replication on the tables ASP.NET uses
Curious what recommendations anyone has. I have an existing asp.net forms application that does
Curious question: Take this function: function something():Array { var ar:Array = []; var i:MovieClip;
curious if anyone might have some insight in how I would do the following
Curious to get people's thoughts. I conduct frequent interviews, and have had enough in
Curious if anyone ever noticed this, but I have a WYSIWYG that users occassionally
Just curious if anyone has had sufficient time with WinRT yet to understand whether
Curious about how the handle STDERR works? Lets keep it down to say Batch
I curious to how different people solve integration of systems. I have a feeling
curious what the BSON::ObjectId.id.data array represents? for example [77, 145, 20, 13, 225, 96,

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.