Ejemplo n.º 1
0
        public void Draw(Camera camera)
        {
            Guard.IsNotNull(nameof(camera), camera);

            Colour[,] imageBuffer = new Colour[camera.ViewPort.Width, camera.ViewPort.Height];

            for (int x = 0; x < camera.ViewPort.Width; x++)
            {
                for (int y = 0; y < camera.ViewPort.Height; y++)
                {
                    Ray ray = camera.GetRay(x, y);
                    imageBuffer[x, y] = TraceRay(ray, 0);
                }
            }

            //todo return something
        }
 public void SetPixel(int x, int y, Colour c)
 {
     _pixels[x][y] = c;
 }
Ejemplo n.º 3
0
 private Color ToDrawingColor(Colour c)
 {
     return(Color.FromArgb(c.RedByte(), c.GreenByte(), c.BlueByte()));
 }
Ejemplo n.º 4
0
 public Colour Minus(Colour c2)
 {
     return(new Colour(R - c2.R, G - c2.G, B - c2.B));
 }
Ejemplo n.º 5
0
 public Colour Plus(Colour c2)
 {
     return(new Colour(R + c2.R, G + c2.G, B + c2.B));
 }
Ejemplo n.º 6
0
 public Colour MultiplyBy(Colour c2)
 {
     return(new Colour(R * c2.R, G * c2.G, B * c2.B));
 }
 public Light(Point position, Colour intensity)
 {
     Position  = position;
     Intensity = intensity;
 }
Ejemplo n.º 8
0
 public Scene()
 {
     Bodies = new List<SolidBody>();
     Lights = new List<LightSource>();
     Background = new Colour();
 }
 public RayPixelResult(int x, int y, Colour c)
 {
     X = x;
     Y = y;
     C = c;
 }