Пример #1
0
		private void OnWindowLoad()
		{
			mainScene = new Scene(window);
			uiScene = new Scene(window);

			SceneObject cameraObject = new SceneObject("CameraObject", mainScene);
			cameraObject.AddModule<Camera>();
			cameraObject.AddModule<OrbitCamera>();

			PolyMesh polyMesh = new PolyMesh();
			polyMesh.geometry.Vertices.Add(-1, 0, 0);
			polyMesh.geometry.Vertices.Add(-1, 0, 2);
			polyMesh.geometry.Vertices.Add(1, 0, 2);
			polyMesh.geometry.Vertices.Add(1, 0, 0);

			polyMesh.geometry.Faces.AddFace(0, 1, 2, 3);

			PolyObject polyObject = new SceneObject("PolyObject", mainScene).AddModule<PolyObject>();
			polyObject.polyMesh = polyMesh;
			polyObject.UpdateMesh();
			polyObject.transform.localScale = Vector3.One*3;
		}