Exemple #1
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // =============================================== CONSTRUCTORS =========================================== //
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region Initialization

        static LineManipulator3D()
        {
            var b1 = new MeshBuilder();

            b1.AddSphere(Vector3.Zero, END_GRIP_SIZE, 8, 8);
            NodeGeometry = b1.ToMeshGeometry3D();

            var b2 = new MeshBuilder();

            b2.AddSphere(Vector3.Zero, MID_GRIP_SIZE, 8, 8);
            MidEdgeGeometry = b2.ToMeshGeometry3D();

            var b3 = new MeshBuilder();

            b3.AddCylinder(new Vector3(0f, 0f, 0f), new Vector3(1f, 0f, 0f), EDGE_GRIP_SIZE, 4);
            EdgeGeometry = b3.ToMeshGeometry3D();

            var b4 = new LineBuilder();

            b4.AddBox(new Vector3(0f, 0f, 0f), 1, 1, 1);
            LineGeometry = b4.ToLineGeometry3D();
        }
Exemple #2
0
        /// <summary>
        /// Returns a line geometry of the axis-aligned bounding-box of the given mesh.
        /// </summary>
        /// <param name="mesh">Input mesh for the computation of the b-box</param>
        /// <returns></returns>
        public static LineGeometry3D GenerateBoundingBox(Geometry3D mesh)
        {
            var bb = global::SharpDX.BoundingBox.FromPoints(mesh.Positions);

            return(GenerateBoundingBox(bb));
        }
Exemple #3
0
 static Sphere()
 {
     var b1 = new MeshBuilder();
     b1.AddSphere(new Vector3(0, 0, 0), 0.5);
     geometry = b1.ToMeshGeometry3D();
 }
Exemple #4
0
 /// <summary>
 /// Returns a line geometry of the axis-aligned bounding-box of the given mesh.
 /// </summary>
 /// <param name="mesh">Input mesh for the computation of the b-box</param>
 /// <returns></returns>
 public static LineGeometry3D GenerateBoundingBox(Geometry3D mesh)
 {
     var bb = global::SharpDX.BoundingBox.FromPoints(mesh.Positions);
     return GenerateBoundingBox(bb);
 }
Exemple #5
0
 static Cube()
 {
     var b1 = new MeshBuilder();
     b1.AddBox(new Vector3(0, 0, 0), 1, 1, 1);
     geometry = b1.ToMeshGeometry3D();
 }