////////////////////////////////////////////////////////////////////////////////////////////////////////////// // =============================================== 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(); }
/// <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)); }
static Sphere() { var b1 = new MeshBuilder(); b1.AddSphere(new Vector3(0, 0, 0), 0.5); geometry = b1.ToMeshGeometry3D(); }
/// <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); }
static Cube() { var b1 = new MeshBuilder(); b1.AddBox(new Vector3(0, 0, 0), 1, 1, 1); geometry = b1.ToMeshGeometry3D(); }