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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:48:03+00:00 2026-05-23T11:48:03+00:00

I have a simple task: I have 10,000 3D boxes, each with a x,y,z,

  • 0

I have a simple task: I have 10,000 3D boxes, each with a x,y,z, width, height, depth, rotation, and color. I want to throw them into a 3D space, visualize it, and let the user fly through it using the mouse. Is there an easy way to put this together?

  • 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-23T11:48:04+00:00Added an answer on May 23, 2026 at 11:48 am

    One easy way of doing this using recent (v 3.2) OpenGL would be:

    • make an array with 8 vertices (the corners of a cube), give them coordinates on the unit cube, that is from (-1,-1, -1) to (1, 1, 1)
    • create a vertex buffer object
    • use glBufferData to get your array into the vertex buffer
    • bind the vertex buffer
    • create, set up, and bind any textures that you may want to use (skip this if you don’t use textures)
    • create a vertex shader which applies a transform matrix that is read from “some source” (see below) according to the value of gl_InstanceID
    • compile the shader, link the program, bind the program
    • set up the instance transform data (see below) for all cube instances
    • depending on what method you use to communicate the transform data, you may draw everything in one batch, or use several batches
    • call glDrawElementsInstanced N number of times with count set to as many elements as will fit into one batch
    • if you use several batches, update the transform data in between
    • the vertex shader applies the transform in addition to the normal MVP stuff

    To communicate the per-cube transform data, you have several alternatives, among them are:

    • uniform buffer objects, you have a guaranteed minimum of 4096 values, respectively 256 4×4 matrices, but you can query the actual value
    • texture buffer objects, again you have a guaranteed minimum of 65536 values, respectively 4096 4×4 matrices (but usually something much larger, my elderly card can do 128,000,000 values, you should query the actual value)
    • manually set uniforms for each batch, this does not need any “buffer” stuff, but is most probably somewhat slower

    Alternatively: Use pseudo-instancing which will work even on hardware that does not support instancing directly. It is not as elegant and very slightly slower, but it does the job.

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

Sidebar

Related Questions

I want to automate a fairly simple task. For this I have written a
I have a simple task which I'm failing at. I want to take this
i Have been given this simple task , I want to connect to facebook
I have a simple task. I have an existing project with a web service
I know zero javascript, and have one simple task: Find all text in the
I have a very simple task: add the contents of a textField to an
I'm trying to do a simple task with jQuery: I have a list of
I have a simple Word to Pdf converter as an MSBuild Task. The task
I have a task of parsing a simple XML-formatted string in a MySQL stored
I have this simple Ant task that lists all '.png' files in a folder:

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.