Beispiel #1
0
        public ActionResult GetAllFilms()
        {
            List <Film> AllFilms = database.Films.ToList();
            // Lista obiektów do wyświetlenia
            List <MyFilm> ViewFilms = new List <MyFilm>();

            foreach (var Film in AllFilms)
            {
                MyFilm viewFilm = new MyFilm(Film.Name, Film.Director, Convert.ToInt32(Film.YearOfProduction), Film.Photo);
                ViewFilms.Add(viewFilm);
            }

            // Przekazanie listy filmów do widoku
            return(View(ViewFilms));
        }
        private void InitNewScene()
        {
            _scene = new Scene();
            var screen = new raytracer.core.Screen(1024, 768);

            _film = new MyFilm(screen, NSamples);
            Camera camera = new SimpleCamera(screen,
                                             Transformation.Translation((float)PositionX.Value, (float)PositionY.Value, (float)PositionZ.Value) *
                                             Transformation.RotateX((float)(RotationX.Value % 360)) *
                                             Transformation.RotateY((float)(RotationY.Value % 360)) *
                                             Transformation.RotateZ((float)(RotationZ.Value % 360)));

            _renderer = new Renderer(_scene,
                                     new GridSampler(screen), camera, _film,
                                     new WhittedIntegrator());
            _scene.Lights.Add(new PointLight(Transformation.Translation(100, 650, -500), SampledSpectrum.White() * 2000000));
            _scene.Lights.Add(new PointLight(Transformation.Translation(0, 0, -1000), SampledSpectrum.Random() * 200000));
            SimpleObjParser(_scene, _file);
        }
Beispiel #3
0
 /// <summary>
 ///     This function is called to create a new scene to render.
 /// </summary>
 private void InitNewScene()
 {
     _film     = new MyFilm(_screen, NSamples);
     _scene    = new Scene();
     _renderer = new Renderer(_scene, new GridSampler(_screen), _camera, _film, new WhittedIntegrator());
 }