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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:14:59+00:00 2026-06-16T16:14:59+00:00

I have managed to get a cube rendered in OpenGL using a VBO. My

  • 0

I have managed to get a cube rendered in OpenGL using a VBO. My next goal is actually creating a for loop to create multiple cubes. I’m stuck on this part though, do I put this code:

GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
    ARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, vertexBufferID);
    GL11.glVertexPointer(3, GL11.GL_FLOAT, 0, 0);
    GL11.glDrawArrays(GL11.GL_QUADS, 0, 24);
    GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);

Into a for loop? Wouldn’t I have to use some sort of glPopMatrix command along with a translate function? I barely understand how to create one cube in a VBO, so sorry if its obvious whats wrong.

  • 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-16T16:15:00+00:00Added an answer on June 16, 2026 at 4:15 pm

    You can use the following way:

    GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
    ARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, vertexBufferID);
    GL11.glVertexPointer(3, GL11.GL_FLOAT, 0, 0);
    
    for (int i = 0; i < cubeCount; i++) {
      GL11.glPushMatrix();
      // do translation/rotation for cube no i
      GL11.glDrawArrays(GL11.GL_QUADS, 0, 24);
      GL11.glPopMatrix();
    }
    
    GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
    

    Please note that the glPushMatrix/glPopMatrix way is deprecated in newer openGl versions. For you it should work because you are using GL11.

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

Sidebar

Related Questions

I'm writing a MVC website and using jqGrid. I have managed to get it
Hi I have managed to get my form to submit without reloading, using this
I have managed to get windows authentication working with a service call using this
I have managed to get a list of locations from my webserver using JSON
I've just started using the awesome AFIncrementalStore and have managed to get a basic
I am have managed to get fsi.exe become 64 bit... next I want it
I'm new to using Hibernate and have managed to get it working, but my
Creating a client server application i have managed to get the server to link
I'm attempting to create an Magento staging site and have managed to get the
I'm using the EntityFramework (for the first time) and have managed to get as

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.