Sign in to follow this  

3D Array and rendering a Graphic

This topic is 3727 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
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

This topic is 3727 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this