예제 #1
0
 public Intersection(IPrimitive hitPrimitive, Point3D hitPoint, Vector3D normal, float tMin, float tMax,
     bool hitFromInSide)
 {
     this.HitPoint = hitPoint;
     this.Normal = normal;
     this.TMin = tMin;
     this.TMax = tMax;
     this.HitPrimitive = hitPrimitive;
     this.HitFromInSide = hitFromInSide;
     this.CurrentTextureCoordinate = UVCoordinate.Zero;
 }
예제 #2
0
 //public static implicit operator Texture(Bitmap texture)
 //{
 //    return new Texture(texture);
 //}
 //public void ProcessTextureImage(Bitmap texture)
 //{
 //    textureMatrix = new RGBColor[texture.Width, texture.Height];
 //    for (int i = 0; i < texture.Width; i++)
 //    {
 //        for (int j = 0; j < texture.Height; j++)
 //        {
 //            textureMatrix[i, j] = RGBColor.FromColor(texture.GetPixel(i, j));
 //        }
 //    }
 //    texture.Dispose();
 //}
 public RGBColor GetPixel(UVCoordinate uv)
 {
     return this.textureMatrix[(int) (uv.U * this.Width), (int) (uv.V * this.Height)];
 }