I’m currently working on a 3d bin packing problem to which I want to represent my results as an image.
I have the results stored as a list of packing objects as follows
public class LoadedPackage
{
private PackingObject packingObject;
private int xloc, yloc, zloc;
private bool flipped = false;
}
public class PackingObject
{
private int ID, checkerMaster, height, width, depth, number;
}
I want to use the xloc,yloc,zloc and dimensions to draw the packages 1 at a time to build up an image. Is there some sort of image library way of doing this or am I going to be forced to use an openGL solution which seems a little overkill to me for just a simple image.
I was thinking of maybe using a isometric method using 2d gdi lib
In the end I opted for an isometric approach and added a method to each package to convert itself from a 3d coordinates over to isometric. I hope the following code helps someone else with a similar predicament!
An Isometric cube has 6 points so I return an array of 6 points. In reality i use 3 sub methods to return the 3 isometric polygons for the GDI lib to process but for the sake of this answer I’ll just post the more general 6 point method.