Exemplo n.º 1
0
 static void LoadObjects(Camera camera)
 {
     using (StreamReader reader = new StreamReader("../../wredny.json"))
     {
         string jsonContent = reader.ReadToEnd();
         ObjectJsonFileStructure parsedContent = JsonConvert.DeserializeObject <ObjectJsonFileStructure>(jsonContent);
         Object3D newObj;
         foreach (ObjectStructure obj in parsedContent.objects)
         {
             try
             {
                 newObj = new Object3D(obj.Name, obj.Position, obj.Walls, obj.Color);
                 camera.AddObject(newObj);
             }
             catch (Exception e)
             {
                 Console.WriteLine(e.Message);
             }
         }
         //DevTests(new Vector3(2, 4, 1), new Vector3(-2,3,1), new Vector3(1,-4,2)); // -x + 4y + 31z -45 = 0
         //DevTests(new Vector3(3,2,1), new Vector3(2,-2,4), new Vector3(1,-4,2));   // 14x - 5y - 2z - 30 = 0
         //DevTests(new Vector3(3,1,1), new Vector3(1,-1,2), new Vector3(3,-1,2));   // 2y + 4z - 6 = 0
     }
 }
Exemplo n.º 2
0
 public void AddObject(Object3D obj)
 {
     this.objects.Add(obj);
 }