Click here to Skip to main content
11,490,007 members (69,766 online)
Rate this: bad
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
Sergey Alexandrovich Kryukov at 6-Oct-12 0:44am
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
0 Sergey Alexandrovich Kryukov 595
1 Andy Lanng 233
2 OriginalGriff 213
3 Maciej Los 170
4 _duDE_ 141
0 Sergey Alexandrovich Kryukov 9,608
1 OriginalGriff 8,475
2 Sascha Lefèvre 3,419
3 Maciej Los 3,106
4 Richard Deeming 2,370

Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 3 Nov 2012
Copyright © CodeProject, 1999-2015
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