/// <summary> Gets the bottom. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Bottom() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X + width, origin.Y - height, origin.Z), -width, 0, depth); return(r); }
/// <summary> Gets the right. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Right() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X + width, origin.Y, origin.Z), 0, height, depth); return(r); }
/// <summary> Gets the left. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Left() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X, origin.Y, origin.Z + depth), 0, height, -depth); return(r); }
/// <summary> Adds a cube to mesh. </summary> /// /// <param name="p0"> The p 0. </param> /// <param name="w"> The width. </param> /// <param name="h"> The height. </param> /// <param name="d"> The double to process. </param> /// <param name="mesh"> The mesh. </param> /// <param name="useTexture"> true to use texture. </param> public static void addCubeToMesh(Point3D p0, double w, double h, double d, MeshGeometry3D mesh, bool useTexture) { ObjectCube cube = new ObjectCube(p0, w, h, d); double maxDimension = Math.Max(d, Math.Max(w, h)); PointCollection textureCoordinatesCollection = new PointCollection(); ObjectRectangle front = cube.Front(); ObjectRectangle back = cube.Back(); ObjectRectangle right = cube.Right(); ObjectRectangle left = cube.Left(); ObjectRectangle top = cube.Top(); ObjectRectangle bottom = cube.Bottom(); if (useTexture) { Point3D extents = front.getDimensions(); addTextureCoordinates(textureCoordinatesCollection, extents.X / maxDimension, extents.Y / maxDimension); extents = back.getDimensions(); addTextureCoordinates(textureCoordinatesCollection, extents.X / maxDimension, extents.Y / maxDimension); extents = right.getDimensions(); addTextureCoordinates(textureCoordinatesCollection, extents.X / maxDimension, extents.Y / maxDimension); extents = left.getDimensions(); addTextureCoordinates(textureCoordinatesCollection, extents.X / maxDimension, extents.Y / maxDimension); extents = top.getDimensions(); addTextureCoordinates(textureCoordinatesCollection, extents.X / maxDimension, extents.Y / maxDimension); extents = bottom.getDimensions(); addTextureCoordinates(textureCoordinatesCollection, extents.X / maxDimension, extents.Y / maxDimension); } front.addToMesh(mesh); back.addToMesh(mesh); right.addToMesh(mesh); left.addToMesh(mesh); top.addToMesh(mesh); bottom.addToMesh(mesh); if (useTexture) { mesh.TextureCoordinates = textureCoordinatesCollection; } }
/// <summary> Gets the back. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Back() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X + width, origin.Y, origin.Z + depth), -width, height, 0); return(r); }
/// <summary> Gets the front. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Front() { ObjectRectangle r = new ObjectRectangle(origin, width, height, 0); return(r); }
/// <summary> Gets the top. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Top() { ObjectRectangle r = new ObjectRectangle(origin, width, 0, depth); return(r); }
/// <summary> Gets the back. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Back() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X + width, origin.Y, origin.Z + depth), -width, height, 0); return r; }
/// <summary> Gets the front. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Front() { ObjectRectangle r = new ObjectRectangle(origin, width, height, 0); return r; }
/// <summary> Gets the bottom. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Bottom() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X + width, origin.Y - height, origin.Z), -width, 0, depth); return r; }
/// <summary> Gets the top. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Top() { ObjectRectangle r = new ObjectRectangle(origin, width, 0, depth); return r; }
/// <summary> Gets the right. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Right() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X + width, origin.Y, origin.Z), 0, height, depth); return r; }
/// <summary> Gets the left. </summary> /// /// <returns> An ObjectRectangle. </returns> public ObjectRectangle Left() { ObjectRectangle r = new ObjectRectangle(new Point3D(origin.X, origin.Y, origin.Z + depth), 0, height, -depth); return r; }