public Camera(int hsize, int vsize, float fov)
        {
            Hsize     = hsize;
            Vsize     = vsize;
            FOV       = fov;
            Transform = new IdentityMatrix();

            float halfview = MathF.Tan(FOV / 2);

            float aspect = (float)Hsize / (float)Vsize;

            if (aspect >= 1)
            {
                HalfWidth  = halfview;
                HalfHeight = halfview / aspect;
            }
            else
            {
                HalfWidth  = halfview * aspect;
                HalfHeight = halfview;
            }

            PixelSize = (HalfWidth * 2) / Hsize;
        }
Exemple #2
0
 public Shape()
 {
     setGlobalId(this);
     Transform = new IdentityMatrix();
     Material  = new Material();
 }