Exemplo n.º 1
0
        public Texture RenderImage(Scence scence, int x, int y)
        {
            Image img  = new Image((uint)x, (uint)y, Color.Black);
            var   FOWV = FOW / x / y;
            uint  xPos = 0;
            uint  yPos = 0;

            for (double i = -FOW / 2; i < FOW / 2; i += FOW / x)
            {
                for (double j = -FOWV / 2; j < FOWV / 2; j += FOWV / x)
                {
                    try
                    {
                        Ray3D tmpRay = new Ray3D(Position, Direct + new Direction(i, 0, j), 1);
                        var   p      = tmpRay.GetEndpoint(scence);
                        img.SetPixel(xPos, yPos, p.Color);
                        yPos++;
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                }
                xPos++;
                yPos = 0;
                Console.WriteLine();
            }
            return(new Texture(img));
        }
Exemplo n.º 2
0
 public void Handle()
 {
     curScence = scenceDict["login"];
     while (!isLeavel)
     {
         curScence.Handle();
     }
 }
Exemplo n.º 3
0
 public player(Scence scence, int x, int y)
 {
     this.scence = scence;
     this.x      = x;
     this.y      = y;
 }