Exemplo n.º 1
0
 private Model3DGroup CreateGeometry(bool isFinal)
 {
     return(ConverterMatterToFuelDesign.CreateGeometry(this.MaterialBrushes, base.SelectionEmissives,
                                                       GetTransformForGeometry(isFinal),
                                                       WorldColors.ConverterBase_Color, WorldColors.ConverterBase_Specular, WorldColors.ConverterEnergy_Color, WorldColors.ConverterEnergy_Specular,
                                                       isFinal));
 }
Exemplo n.º 2
0
        private Model3D CreateGeometry(bool isFinal)
        {
            Model3DGroup retVal = new Model3DGroup();

            #region box

            MaterialGroup material = new MaterialGroup();

            Color           ringColor = WorldColors.DirectionControllerRing_Color;
            DiffuseMaterial diffuse   = new DiffuseMaterial(new SolidColorBrush(ringColor));
            MaterialBrushes.Add(new MaterialColorProps(diffuse, ringColor));
            material.Children.Add(diffuse);

            SpecularMaterial specular = WorldColors.DirectionControllerRing_Specular;
            MaterialBrushes.Add(new MaterialColorProps(specular));
            material.Children.Add(specular);

            if (!isFinal)
            {
                EmissiveMaterial selectionEmissive = new EmissiveMaterial(Brushes.Transparent);
                material.Children.Add(selectionEmissive);
                SelectionEmissives.Add(selectionEmissive);
            }

            GeometryModel3D geometry = new GeometryModel3D
            {
                Material     = material,
                BackMaterial = material,

                Geometry = ConverterMatterToFuelDesign.GetMesh(.36d * SCALE, .04d * SCALE, 3),
            };

            retVal.Children.Add(geometry);

            #endregion

            #region brain

            ScaleTransform3D scaleTransform = new ScaleTransform3D(SCALE, SCALE, SCALE);

            if (!isFinal)
            {
                retVal.Children.AddRange(BrainDesign.CreateInsideVisuals(SCALE * .6, MaterialBrushes, SelectionEmissives, scaleTransform));
            }

            retVal.Children.Add(BrainDesign.CreateShellVisual(isFinal, MaterialBrushes, SelectionEmissives, scaleTransform));

            #endregion

            retVal.Transform = GetTransformForGeometry(isFinal);

            return(retVal);
        }
Exemplo n.º 3
0
        internal static MeshGeometry3D GetMesh(double half, double tip, int faceCount)
        {
            // Define 3D mesh object
            MeshGeometry3D retVal = new MeshGeometry3D();

            int pointOffset = 0;

            // Front
            Transform3DGroup transform = new Transform3DGroup();

            transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 90)));
            transform.Children.Add(new TranslateTransform3D(half, 0, 0));
            ConverterMatterToFuelDesign.GetMeshFace(ref pointOffset, retVal, transform, half, half, tip, faceCount);

            // Right
            transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), 90)));
            ConverterMatterToFuelDesign.GetMeshFace(ref pointOffset, retVal, transform, half, half, tip, faceCount);

            // Back
            transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), 90)));
            ConverterMatterToFuelDesign.GetMeshFace(ref pointOffset, retVal, transform, half, half, tip, faceCount);

            // Left
            transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), 90)));
            ConverterMatterToFuelDesign.GetMeshFace(ref pointOffset, retVal, transform, half, half, tip, faceCount);

            // Top
            transform = new Transform3DGroup();
            transform.Children.Add(new TranslateTransform3D(0, 0, half));
            ConverterMatterToFuelDesign.GetMeshFace(ref pointOffset, retVal, transform, half, half, tip, faceCount);

            // Bottom
            transform.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), 180)));
            ConverterMatterToFuelDesign.GetMeshFace(ref pointOffset, retVal, transform, half, half, tip, faceCount);

            // Exit Function
            return(retVal);
        }
Exemplo n.º 4
0
 public static MeshGeometry3D GetMeshColor(double scale)
 {
     return(ConverterMatterToFuelDesign.GetMesh(.35d * scale, .15d * scale, 1));
 }
Exemplo n.º 5
0
 public static MeshGeometry3D GetMeshBase(double scale)
 {
     //NOTE: These tips are negative
     return(ConverterMatterToFuelDesign.GetMesh(.5d * scale, -.35d * scale, 1));
 }