Jump to content
  • Advertisement
Sign in to follow this  
jtiger12

3D Array and rendering a Graphic

This topic is 4034 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I figured this would be the place to come for a little help, or some guidance related to making a rendering app for a homegrown WMS i developed at my work. One of the functions in this system, is shipping carton determination based on an H3D packing algorithm. I create a virtual container using a 3d array, and recursively pack items into the box, (rotating as needed), until the carton is full. I would like to export a graphic showing the packing container, or to use this graphic for debugging results from the algorithm. Eventually, I could modify the algorithm to include packing order, etc.. It works as follows in theory Class Carton { boolean arrLocation[x,x,x] //Stores a 3d array of X,Y,Z locations Public Carton(int Length, int Height, int Width) { arrLocation = new bool[(Height), (Length), (Width)] } Public bool PackItem() //Loops through the 3d array, and places "items" //into the array where a location value == false } after all items are packed, I am left with a "grid" in memory of where an item has been placed in my virtual cube. Currently, I discard this memory, but would like to export it to a file or oracle BLOB for retreival and rendering. I am not a graphics programmer and concepts such as vertex and co-ordinate mapping is way more than I care to learn about. It would be great if I could output the rendered object to a plane where I could rotate the object to inspect any ideas? I would really appreciate a head start.

Share this post


Link to post
Share on other sites
Advertisement
1) Boost::multi_array to represent the storage.
2) I assume you rather *iteratively* pack things into the box (i.e. one at a time; the thing to pack is not composed of smaller things).
3) You'll have to render the graphic somehow. A rendered 2d image can't be rotated, but you can cause the program to re-render it at a different angle based off the same "model" data.
4) The simplest way, if you don't want to learn any 3D graphics programming, is to work with isometric tiles: make some image (possibly translucent) that represents one "cell" of the box (possibly in different colours to represent usage by different "things"), and repeatedly draw them onto a canvas - there is a simple transformation from the cell's (x, y, z) position into the canvas (x, y) position, depending on the shape of your cell image.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!