public MScene(Scene scene, MeshSettings defaultMeshSettings) { Scene = scene; Objects = new List <MObj>(); foreach (var obj in scene.Objects) { Objects.Add(new MObj(obj, defaultMeshSettings)); } }
public MFace(IFace face, MObj obj, MVertex[] vertices, MeshSettings meshSettings, MFaceIlluminanceAngles illuminanceAngles) { MeshSettings = meshSettings; Face = face; Obj = obj; Deep = 0; IlluminanceAngles = illuminanceAngles; Vertices = vertices; /* * Vertices = new MVertex[3]; * for( int i = 0; i < 3; i++ ) * Vertices[i] = Obj.Vertices[face.VertexIndexes[i]]; */ }
public MObj(IObj obj, MeshSettings defaultMeshSettings) { Obj = obj; Faces = new List <MFace>(); Vertices = new List <MVertex>(); foreach (var face in Obj.Faces.Where(x => x.Material.Reflectance != null)) { var illuminanceAngles = new MFaceIlluminanceAngles(face.Normal, face.Material, defaultMeshSettings.SpectrumAngles.Theta, defaultMeshSettings.SpectrumAngles.Mu, defaultMeshSettings.SpectrumAngles.Phi, defaultMeshSettings.SpectrumAngles.GaussWeight, defaultMeshSettings.NSH); var vertices = new MVertex[3]; for (int i = 0; i < 3; i++) { var vertex = new MVertex(face, Obj.Vertices[face.VertexIndexes[i]], illuminanceAngles); Vertices.Add(vertex); vertices[i] = vertex; } Faces.Add(new MFace(face, this, vertices, defaultMeshSettings, illuminanceAngles)); } }