Exemple #1
0
        public Picture RenderSceneWithCamera(Scene scene, PerspectiveCamera camera)
        {
            var picture = new Picture(camera.Resolution);

            foreach (var pixelRay in camera.GetPixelRays())
            {
                picture.SetColor(pixelRay.Position, GetColor(scene, pixelRay.Ray));
            }
            return(picture);
        }
Exemple #2
0
        public Picture RenderSceneWithCamera(Scene scene, PerspectiveCamera camera)
        {
            var depth = new DepthMap(camera.Resolution);

            foreach (var pixelRay in camera.GetPixelRays())
            {
                depth[pixelRay.Position.X, pixelRay.Position.Y] = GetDepth(scene, pixelRay.Ray);
            }
            return(DepthAsPicture(depth));
        }