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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:28:45+00:00 2026-06-02T02:28:45+00:00

If I have multiple meshes in a single VBO, is there a way to

  • 0

If I have multiple meshes in a single VBO, is there a way to apply transformations to those meshes independently?

If I call glDrawElements while a VBO with two meshes is bound, it’s going to draw those two meshes with whatever the current MVP matrix is. So if I have upwards of 20 independently moving meshes on the screen at a time, would I need 20 VBOs? Or is there some way of specifying an offset and a count to glDrawElements so that it only renders the first mesh stored in the VBO? This way I could change the MVP Matrix and then render the second mesh in the VBO.

  • 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-06-02T02:28:47+00:00Added an answer on June 2, 2026 at 2:28 am

    Say you have three meshes with 5, 11 and 13 triangles respectively packed into one index buffer, you can draw the two separate meshes as:

    // assumes index buffer has been bound
    // set modelview
    glDrawElements(GL_TRIANGLES, 5 * 3, GL_UNSIGNED_SHORT, 0);
    // set modelview
    glDrawElements(GL_TRIANGLES, 11 * 3, GL_UNSIGNED_SHORT, 5 * 3 * sizeof(unsigned short));
    // set modelview
    glDrawElements(GL_TRIANGLES, 13 * 3, GL_UNSIGNED_SHORT, (5 + 11) * 3 * sizeof(unsigned short));
    

    You specify the offset by offsetting the pointer in the last argument.

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

Sidebar

Related Questions

I have multiple websites run on single database. My question related table Structure is
I have multiple entities stored in a single NHibernate Search index, in the hope
i have multiple files each containing 8/9 columns. for a single file : I
I have multiple Tkinter listboxes that I have scrolling together using a single scrollbar,
Is it possible to share meshes or geometry between scenes? I have multiple scenes
I have multiple selects: <select id=one> <option value=1>one</option> <option value=2>two</option> <option value=3>three</option> </select> <select
I have multiple arrays in javascript and I want to do sum of those
I have multiple buttons that are using a single command with a command parameter
I have multiple ajax requests with javascript code as response, and I need to
I have multiple projects which are to be hosted together in a Tomcat container,

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.