Home > Net > How to put a lot of three-dimensional rectangle drawn into visual three-dimensional mold by location
How to put a lot of three-dimensional rectangle drawn into visual three-dimensional mold by location
Time:10-08
Cuboid position be drawn into the stereo mode of visual I have a lot of 3 d coordinate data of the cuboid, including position dimensions, like timeout put goods shelves, layers, each layer has more columns, each column have more than one box, I need to draw them into a three-dimensional model of the visual, need to use technology to achieve or what class libraries, such as the use of c #, or any other tools?
CodePudding user response:
Code is not long, has more than 200 lines,
Public class Cube { Public int width=0, height=0, the depth=0; Double xRotation=0.0, yRotation=0.0, zRotation=0.0; Math3D. Camera camera1=new Math3D. Camera (); Math3D. Point3D cubeOrigin; Public Point [and] Area=new Point (6, 4), Public double RotateX {get {return xRotation; } the set {xRotation=value; }} Public double RotateY {get {return yRotation; } the set {yRotation=value; }} Public double RotateZ {get {return zRotation; } the set {zRotation=value; }} Public Cube (int Width, int Height, int the Depth) { Width=width; Height=height; The depth=the depth; CubeOrigin=new Math3D. Point3D (width/2, height/2, the depth/2); } Public static Rectangle getBounds (PointF [] points) { Double left=points [0]. X; Double right=points [0]. X; Double top=points [0]. Y; Double bottom=points [0]. Y; for (int i=1; I & lt; Points. The Length; I++) { If (points [I] X & lt; Left) Left=points [I]. X; If (points [I] X & gt; Right) Right=points [I]. X; If (points [I] Y & lt; Top) Top=points [I] Y; If (points [I] Y & gt; Bottom) Bottom=points [I] Y; } Return the new Rectangle (0, 0, (int) Math. Round - left (right), (int) Math. Round - top (bottom)); } ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
3 d cube good picture, but to be attached on the surface of the each image, need to image deformation processing, Also don't trouble, two file has more than 300 line, including support for transparent shadow etc. Download https://pan.baidu.com/s/15mJroMcZphg8mzi9GB7v-g
But if high real-time requirements, this thing is slow, according to the 800 * 600 size, deformation of 180 degrees, each face of each scale to generate images, a total of about 1.5 seconds (180 image), Winform do this or not, with WPF or GPU related library operation
CodePudding user response:
Above address is wrong, is the https://pan.baidu.com/s/1fl6eyQl0JUBOhLbTiz_zgQ