예제 #1
0
 public override void Do(IDemoChartControl chartControl)
 {
     chartControl.Axes.IsAxes3DVisible = true;
     chartControl.DataSource           = new Prism[]
     {
         new Prism
         {
             //Prism side should be defined in 2d space by convex polygon
             Side = new[] { new Vector2F(-0.5f, 0), new Vector2F(-0.5f, 1), new Vector2F(1, 1) },
             //Vector that define translate between top and bottom sides
             BottomToTopVector = Vector3F.UnitZ,
             Color             = Colors.Cyan,
             Transform         = Matrix4F.RotationAxis(Vector3F.UnitY, -Math.PI / 4),
             Name = "Prism 1"
         },
         new Prism
         {
             //Prism side should be defined in 2d space by convex polygon
             Side = new[] { new Vector2F(1, 0), new Vector2F(0.4f, 0.5f), new Vector2F(1) },
             //Vector that define translate between top and bottom sides
             BottomToTopVector = new Vector3F(0.5f, 0.5f, 0.5f),
             Color             = Colors.Blue,
             Name = "Prism 2"
         }
     };
 }
예제 #2
0
 public override void Do(IDemoChartControl chartControl)
 {
     chartControl.Axes.IsAxes3DVisible = true;
     chartControl.DataSource           = new []
     {
         new Cube
         {
             Color = Colors.Cyan,
             //Size of cube sizes
             Size = new Vector3F(1, 1, 0.5f),
             //Position relative to cube center
             Position = new Vector3F(1, 1, -1),
             //Cube direction (Also transform matrix can be used for more accurate rotations)
             Direction = new Vector3F(1, 1, 1),
             //Primitive presentation type
             PresentationType = PrimitivePresentationType.Solid,
             Name             = "Cube 1"
         },
         new Cube
         {
             Color = Colors.Blue,
             //Size of cube sizes
             Size = new Vector3F(0.2f, 0.2f, 0.5f),
             //Position relative to cube center
             Position = new Vector3F(0, 0, 0),
             //Transformation matrix example
             Transform = Matrix4F.RotationAxis(Vector3F.UnitX, Math.PI / 3) * Matrix4F.RotationAxis(Vector3F.UnitZ, Math.PI / 3),
             //Primitive presentation type
             PresentationType = PrimitivePresentationType.Solid,
             Name             = "Cube 2"
         },
         new Cube
         {
             Color = Colors.DarkBlue,
             //Size of cube sizes
             Size = new Vector3F(1.2f, 1.2f, 0.7f),
             //Position relative to cube center
             Position = new Vector3F(1, 1, -1),
             //Cube direction (Also transform matrix can be used for more accurate rotations)
             Direction = new Vector3F(1, 1, 1),
             //Primitive presentation type
             PresentationType = PrimitivePresentationType.Wireframe,
             Name             = "Cube 3"
         }
     };
 }
예제 #3
0
 public override void Do(IDemoChartControl chartControl)
 {
     chartControl.Axes.IsAxes3DVisible = true;
     chartControl.DataSource           = new RenderData[]
     {
         new Sphere
         {
             //Resolution for radial part of item. Means number of generated points. For sphere it is approximate number due to mesh generation algorithm.
             Resolution = 100,
             Color      = Colors.DarkBlue,
             //Item radius
             Radius = 0.5f,
             //Item position relative to center
             Position = new Vector3F(),
             Name     = "Sphere 1"
         },
         new Sphere
         {
             //Resolution for radial part of item. Means number of generated points. For sphere it is approximate number due to mesh generation algorithm.
             Resolution = 100,
             Color      = Colors.Cyan,
             //Item radius
             Radius = 0.5f,
             //Ietm position relative to center
             Position = new Vector3F(0.5f),
             //We can create ellipse using transform matrices
             Transform = Matrix4F.Scaling(1f, 0.5f, 0.5f),
             Name      = "Sphere 2"
         },
         new Sphere
         {
             //Resolution for radial part of item. Means number of generated points. For sphere it is approximate number due to mesh generation algorithm.
             Resolution = 100,
             Color      = Colors.Blue,
             //Item radius
             Radius = 0.5f,
             //Item position relative to center
             Position = new Vector3F(0.5f, -0.5f, 0.5f),
             //We can create ellipse using transform matrices
             Transform = Matrix4F.Scaling(1f, 1f, 0.5f) * Matrix4F.RotationAxis(Vector3F.UnitX, Math.PI / 4),
             Name      = "Sphere 3"
         },
         new SemiSphere
         {
             //Resolution for radial part of item. Means number of generated points. For sphere it is approximate number due to mesh generation algorithm.
             Resolution = 100,
             Color      = Colors.DarkCyan,
             //Item radius
             Radius = 0.55f,
             //Item position relative to center
             Position = new Vector3F(),
             //For semi sphere direction can be defined
             Direction = -Vector3F.UnitX,
             //Define if semi sphere base is required
             DrawBottomBase = false,
             //Item presentation type
             PresentationType = PrimitivePresentationType.Wireframe,
             Name             = "Sphere 4"
         },
     };
 }