Click here to Skip to main content
Rate this: bad
good
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
 

http://stock-image.mediafocus.com/images/previews/stack-carton-boxes-pallet-isolated-white-am1112087.jpg[^]
 
How can we do this for different combination 2x3x5, 2x2x2 etc??
Posted 5-Oct-12 19:12pm
Comments
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.
 
--SA

1 solution

Rate this: bad
good
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.
  Permalink  
v2

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

  Print Answers RSS
0 DamithSL 320
1 OriginalGriff 155
2 Peter Leow 115
3 Afzaal Ahmad Zeeshan 114
4 deepakdynamite 110
0 OriginalGriff 7,510
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 4,994
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 3 Nov 2012
Copyright © CodeProject, 1999-2014
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