public MyCuboid CreateTransformed(ref Matrix worldMatrix) { Vector3[] vertices = new Vector3[8]; int index = 0; foreach (Vector3 vector in this.Vertices) { vertices[index] = Vector3.Transform(vector, (Matrix)worldMatrix); index++; } MyCuboid cuboid = new MyCuboid(); cuboid.CreateFromVertices(vertices); return(cuboid); }
public MyCuboid CreateTransformed(ref Matrix worldMatrix) { Vector3[] vertices = new Vector3[8]; int i = 0; foreach (Vector3 vertex in Vertices) { vertices[i] = Vector3.Transform(vertex, worldMatrix); i++; } MyCuboid transformedCuboid = new MyCuboid(); transformedCuboid.CreateFromVertices(vertices); return(transformedCuboid); }
public static void DrawTransparentCuboid(ref MatrixD worldMatrix, MyCuboid cuboid, ref Vector4 vctColor, bool bWireFramed, float thickness, string lineMaterial = null) { foreach (Line line in cuboid.UniqueLines) { Vector3D from = Vector3D.Transform(line.From, worldMatrix); Vector3D to = Vector3D.Transform(line.To, worldMatrix); DrawLine(from, to, lineMaterial ?? "GizmoDrawLine", ref vctColor, thickness); } }
public MyCuboid CreateTransformed(ref Matrix worldMatrix) { Vector3[] vertices = new Vector3[8]; int i = 0; foreach (Vector3 vertex in Vertices) { vertices[i] = Vector3.Transform(vertex, worldMatrix); i++; } MyCuboid transformedCuboid = new MyCuboid(); transformedCuboid.CreateFromVertices(vertices); return transformedCuboid; }