Пример #1
0
        public async Task InitialiseSceneAsync()
        {
            var cameraPosition = new Vector3(0, 8, -20);
            var camera = new Camera(-cameraPosition, cameraPosition);
            _scene = new Scene(camera);

            var square = await _shapeFactory.GetShape<Cube>();
            square.Shader = Shader.MattShaderFromColour(Color.Red);

            var cylinder = await _shapeFactory.GetShape<Cylinder>();
            cylinder.Shader = Shader.MattShaderFromColour(Color.Blue);

            var plane = await _shapeFactory.GetShape<ObjPlane>();
            plane.Shader = Shader.MattShaderFromColour(Color.Wheat);

            _scene.AddBinding(cylinder,Vector3.Zero);
            _scene.AddBinding(square, Vector3.Zero);
            _scene.AddBinding(plane, Vector3.Zero);

            _scene.Lights.Add(new Light(new Vector3(0, 10, 0), Color.White, 10));
            _scene.Lights.Add(new Light(new Vector3(-10, 10, 0), Color.White, 10));
            _scene.Lights.Add(new Light(new Vector3(10, 10, 0), Color.White, 10));
            _scene.Lights.Add(new Light(new Vector3(20, 10, -10), Color.White, 100));
            _scene.Lights.Add(new Light(new Vector3(0, 10, 10), Color.White, 10));

            _scene.Shader = Shader.MattShaderFromColour(Color.Black);

            Initialised = true;
        }
Пример #2
0
 public Color Colorise(Scene scene, Shapes.Ray ray, Matrix transform, Vector3 translation, Vector3 intersection)
 {
     throw new System.NotImplementedException();
 }