Advertisement
stefanpu

3D Max Walk Input

Feb 4th, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. private static void ReadCuboid()
  2.         {
  3.             // Read the cuboid size
  4.             string cuboidSize = Console.ReadLine();
  5.             string[] sizes = cuboidSize.Split();
  6.             width = int.Parse(sizes[0]);
  7.             height = int.Parse(sizes[1]);
  8.             depth = int.Parse(sizes[2]);
  9.  
  10.             // Read the cuboid content
  11.             cuboid = new short[width, height, depth];
  12.             for (int h = 0; h < height; h++)
  13.             {
  14.                 string line = Console.ReadLine();
  15.                 string[] sequences = line.Split('|');
  16.                 for (int d = 0; d < depth; d++)
  17.                 {
  18.                     string[] numbers = sequences[d].Split(
  19.                         new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
  20.                     for (int w = 0; w < width; w++)
  21.                     {
  22.                         short cubeValue = short.Parse(numbers[w]);
  23.                         cuboid[w, h, d] = cubeValue;
  24.                     }
  25.                 }
  26.             }
  27.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement