Ejemplo n.º 1
0
 public Illumination(Construction primitives, IRandomFactory randomFactory, TriangleSampler triangleSampler)
 {
     this.lights          = new List <Triangle>();
     this.primitives      = primitives;
     this.randomFactory   = randomFactory;
     this.triangleSampler = triangleSampler;
 }
Ejemplo n.º 2
0
        public TriangleLocator(Mesh mesh, IPredicates predicates)
        {
            this.mesh = mesh;
            this.predicates = predicates;

            sampler = new TriangleSampler(mesh);
        }
Ejemplo n.º 3
0
        public Engine(Matrix3D camera)
        {
            var ambient  = 0.00;
            var diffuse  = 0.95;
            var scale    = 75;
            var distance = 100.0;

            this.camera = camera;


            this.screen = new Screen(width, height);
            this.window = new Window(width, height, scale, distance, camera);

            var randomFactory      = new RandomFactory();
            var hemiSamplerFactory = new HemiSamplerFactory();
            var triangleSampler    = new TriangleSampler(randomFactory);
            var primitives         = new Construction();
            var illumination       = new Illumination(primitives, randomFactory, triangleSampler);

            var seedFactory = new Random();

            this.tracer = new Tracer(primitives, new Emissive(Constant.WHITE, ambient, 1.0), randomFactory, hemiSamplerFactory);

            ExampleUtil.buildCornelBox(primitives, illumination, diffuse, tracer, randomFactory, hemiSamplerFactory);
        }