Esempio n. 1
0
        public TriMesh CreateShape(EnumShapeDeform shape)
        {
            TriMesh mesh = null;
            switch(shape)
            {
                case EnumShapeDeform.Cylinder:
                    mesh =  CreateCylinder(CylinderLength, CylinderWidth, CylinderHeight);
                    break;
                case EnumShapeDeform.CylinderV2:
                    mesh = CreateCylinderV2(CylinderLength, CylinderWidth, CylinderHeight);
                    break;
                case EnumShapeDeform.Plane2D:
                    mesh =  CreateSquare(SquareLength, SquareWidth);
                    break;
                case EnumShapeDeform.PlaneSpoke:
                    mesh= CreateSquareSpoke(SquareLength, SquareWidth);
                    break;


            }
            mesh.FileName = shape.ToString();
            TriMeshUtil.SetUpNormalVertex(mesh);
            //TriMeshUtil.MoveToCenter(mesh);
            //TriMeshUtil.ScaleToUnit(mesh, 1.0);
            return mesh;
                 
        }
Esempio n. 2
0
        public TriMesh CreateShape(EnumShapeDeform shape)
        {
            TriMesh mesh = null;

            switch (shape)
            {
            case EnumShapeDeform.Cylinder:
                mesh = CreateCylinder(CylinderLength, CylinderWidth, CylinderHeight);
                break;

            case EnumShapeDeform.CylinderV2:
                mesh = CreateCylinderV2(CylinderLength, CylinderWidth, CylinderHeight);
                break;

            case EnumShapeDeform.Plane2D:
                mesh = CreateSquare(SquareLength, SquareWidth);
                break;

            case EnumShapeDeform.PlaneSpoke:
                mesh = CreateSquareSpoke(SquareLength, SquareWidth);
                break;
            }
            mesh.FileName = shape.ToString();
            TriMeshUtil.SetUpNormalVertex(mesh);
            //TriMeshUtil.MoveToCenter(mesh);
            //TriMeshUtil.ScaleToUnit(mesh, 1.0);
            return(mesh);
        }
Esempio n. 3
0
        private void shapeType_Click(object sender, EventArgs e)
        {
            EnumShapeDeform type = (EnumShapeDeform)((ToolStripMenuItem)sender).Tag;

            Mesh = TriMeshShape.Instance.CreateShape(type);

            OnChanged(EventArgs.Empty);
        }