public static Vector3[] GenerateSimplePointField(IVolumeScene scene, Vector3 origin, float sceneCubeVolSize, int numCubes) { List<Vector3> points = new List<Vector3>(); float spacing = sceneCubeVolSize / (float)numCubes; // scan for points float startX = origin.X - (sceneCubeVolSize / 2f); float startY = origin.Y - (sceneCubeVolSize / 2f); float startZ = origin.Z - (sceneCubeVolSize / 2f); float x, y, z = startZ; for (int zPointIdx = 0; zPointIdx < numCubes; zPointIdx++) { x = startX; for (int xPointIdx = 0; xPointIdx < numCubes; xPointIdx++) { y = startY; for (int yPointIdx = 0; yPointIdx < numCubes; yPointIdx++) { Vector3 point = new Vector3(x, y, z); if (!scene.IsOutside(point)) { points.Add(point); } y += spacing; } x += spacing; } z += spacing; } return points.ToArray(); }
public static Vector3[] GenerateSimplePointField(IVolumeScene scene, Vector3 origin, float sceneCubeVolSize, int numCubes) { List <Vector3> points = new List <Vector3>(); float spacing = sceneCubeVolSize / (float)numCubes; // scan for points float startX = origin.X - (sceneCubeVolSize / 2f); float startY = origin.Y - (sceneCubeVolSize / 2f); float startZ = origin.Z - (sceneCubeVolSize / 2f); float x, y, z = startZ; for (int zPointIdx = 0; zPointIdx < numCubes; zPointIdx++) { x = startX; for (int xPointIdx = 0; xPointIdx < numCubes; xPointIdx++) { y = startY; for (int yPointIdx = 0; yPointIdx < numCubes; yPointIdx++) { Vector3 point = new Vector3(x, y, z); if (!scene.IsOutside(point)) { points.Add(point); } y += spacing; } x += spacing; } z += spacing; } return(points.ToArray()); }
public static Bitmap GenerateBitmapSurface(int width, int height, float xScale, float yScale, IVolumeScene scene) { // create bitmap Bitmap bitmap = new Bitmap(width, height); // map volume per-pixel for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (!scene.IsOutside(new Vector3(x, y, 0))) bitmap.SetPixel(x, y, Color.Black); } } return bitmap; }
public static Bitmap GenerateBitmapSurface(int width, int height, float xScale, float yScale, IVolumeScene scene) { // create bitmap Bitmap bitmap = new Bitmap(width, height); // map volume per-pixel for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { if (!scene.IsOutside(new Vector3(x, y, 0))) { bitmap.SetPixel(x, y, Color.Black); } } } return(bitmap); }