예제 #1
0
        public void TestUVSubMapping()
        {
            HdrImage          image  = new HdrImage(4, 2);
            PerspectiveCamera camera = new PerspectiveCamera(aspectRatio: 2.0f);
            ImageTracer       tracer = new ImageTracer(image, camera);

            Ray ray1 = tracer.fireRay(0, 0, 2.5f, 1.5f);
            Ray ray2 = tracer.fireRay(2, 1, 0.5f, 0.5f);

            Assert.True(ray1.isClose(ray2), "TestUVSubMapping failed - Assert 1/1");
        }
예제 #2
0
        public void TestOrientation()
        {
            HdrImage          image  = new HdrImage(4, 2);
            PerspectiveCamera camera = new PerspectiveCamera(aspectRatio: 2.0f);
            ImageTracer       tracer = new ImageTracer(image, camera);
            Ray   topLeftRay         = tracer.fireRay(0, 0, 0.0f, 0.0f);
            Point p = new Point(0.0f, 2.0f, 1.0f);

            Assert.True(p.isClose(topLeftRay.at(1.0f)));
        }