Ejemplo n.º 1
0
        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]];
             */
        }
Ejemplo n.º 2
0
        public MVertex(IFace face, Point3D point, MFaceIlluminanceAngles illuminanceAngles)
        {
            if (illuminanceAngles == null)
            {
                throw new NotImplementedException();
            }
            Face              = face;
            Point             = point;
            IlluminanceAngles = illuminanceAngles;

            IlluminanceDirect   = new List <Spectrum>();
            IlluminanceIndirect = new List <Spectrum>();
            foreach (var illAng in illuminanceAngles.Directions)
            {
                IlluminanceDirect.Add(new Spectrum());
                IlluminanceIndirect.Add(new Spectrum());
            }
        }
Ejemplo n.º 3
0
        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));
            }
        }