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

  • Home
  • SEARCH
  • 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 8504817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:08:32+00:00 2026-06-11T02:08:32+00:00

I’m currently working on a 3d bin packing problem to which I want to

  • 0

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

  • 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-11T02:08:33+00:00Added an answer on June 11, 2026 at 2:08 am

    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.

        public PointF[] convertCoords()
        {
            float x;
            float y;
            PointF p;
            PointF[] pointFs = new PointF[7];
            int x1 = 0;
            int y1 = 0;
            int z1 = 0;
    
            double rads = Helpers.DegreeToRadian(30);
    
            //point 0 in iso
            x = ((float)Math.Cos(rads) * xloc) + ((float)Math.Cos(rads) * yloc);
            y = ((float)Math.Sin(rads) * yloc) + zloc - ((float)Math.Sin(rads) * xloc);
            y = (-y) + 250;
    
            p = new PointF(x,y);
            pointFs[0] = new PointF(p.X,p.Y);
            //point 1 in iso
            x1 = xloc + packingObject.Depth;
            y1 = yloc;
            z1 = zloc;
    
            x = ((float)Math.Cos(rads) * x1) + ((float)Math.Cos(rads) * y1);
            y = ((float)Math.Sin(rads) * y1) + z1 - ((float)Math.Sin(rads) * x1);
            y = (-y) + 250;
    
            p = new PointF(x, y);
            pointFs[1] = new PointF(p.X, p.Y);
            //point 2 in iso
            x1 = xloc + packingObject.Depth;
            y1 = yloc;
            z1 = zloc + packingObject.Height;
    
            x = ((float)Math.Cos(rads) * x1) + ((float)Math.Cos(rads) * y1);
            y = (-((float)Math.Sin(rads) * x1)) + ((float)Math.Sin(rads) * y1) + z1;
            y = (-y) + 250;
    
            p = new PointF(x, y);
            pointFs[2] = new PointF(p.X, p.Y);
            //point 3 in iso
            x1 = xloc;
            y1 = yloc;
            z1 = zloc + packingObject.Height;
    
            x = ((float)Math.Cos(rads) * x1) + ((float)Math.Cos(rads) * y1);
            y = (-((float)Math.Sin(rads) * x1)) + ((float)Math.Sin(rads) * y1) + z1;
            y = (-y) + 250;
    
            p = new PointF(x, y);
            pointFs[3] = new PointF(p.X, p.Y);
            //point 4 in iso
            x1 = xloc;
            y1 = yloc + packingObject.Width;
            z1 = zloc + packingObject.Height;
    
            x = ((float)Math.Cos(rads) * x1) + ((float)Math.Cos(rads) * y1);
            y = (-((float)Math.Sin(rads) * x1)) + ((float)Math.Sin(rads) * y1) + z1;
            y = (-y) + 250;
    
            p = new PointF(x, y);
            pointFs[4] = new PointF(p.X, p.Y);
            //point 5 in iso
            x1 = xloc + packingObject.Depth;
            y1 = yloc + packingObject.Width;
            z1 = zloc + packingObject.Height;
    
            x = ((float)Math.Cos(rads) * x1) + ((float)Math.Cos(rads) * y1);
            y = (-((float)Math.Sin(rads) * x1)) + ((float)Math.Sin(rads) * y1) + z1;
            y = (-y) + 250;
    
            p = new PointF(x, y);
            pointFs[5] = new PointF(p.X, p.Y);
            //point 6 in iso
            x1 = xloc + packingObject.Depth;
            y1 = yloc + packingObject.Width;
            z1 = zloc;
    
            x = ((float)Math.Cos(rads) * x1) + ((float)Math.Cos(rads) * y1);
            y = (-((float)Math.Sin(rads) * x1)) + ((float)Math.Sin(rads) * y1) + z1;
            y = (-y) + 250;
    
            p = new PointF(x, y);
            pointFs[6] = new PointF(p.X, p.Y);
    
            return pointFs;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I have an autohotkey script which looks up a word in a bilingual dictionary
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.