Click here to Skip to main content
12,623,511 members (28,258 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# GDI graphics 3D
I need to display cartons as when it is placed in pallets in C# desktop program.
I need to display one by one, after the robo places the carton in pallet. i.e, initally the pallet will be empty. when the robo places first pallet i need to show carton in first positon.

NOTE: No need to show the exact picture. A simple drawing is enough.

similar to this[^]

How can we do this for different combination 2x3x5, 2x2x2 etc??
Posted 5-Oct-12 19:12pm
I'm not sure that GDI is best here. Did you think about WPF?

As to your whole request -- it's not really a well-defined question. There is nothing to "answer". This is just work to be done: design, implementation... You "how to" could be interpreted in many different ways, and most of those ways would require at least a short article, not a Quick answer. And this is a forum named Quick Questions & Answers.


1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You draw a single carton as an hexagon formed of three parallelograms. Two of the sides are vertical. Adjust the lightness of the three faces to mimic the effect of ambiant lighting. You can also draw the six visible edges. Use the Graphics.FillPolygon method.

Now, when you place the cartons next to each other, the hexagons just translate, with the translation vector being equal to one of the inner edges, corresponding to X, Y, Z moves. This allows you to compute the position of a box anywhere on the pallet.

To render the cartons with hidden parts removal, you will resort to the painter's algorithm: start drawing the boxes at the back. The ones in front will hide those behind.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 3 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100