Exemplo n.º 1
0
 public bool Equals(RtVector other)
 {
     return(other.X.ApproximateEquals(X) &&
            other.Y.ApproximateEquals(Y) &&
            other.Z.ApproximateEquals(Z) &&
            other.W.ApproximateEquals(W));
 }
Exemplo n.º 2
0
 public Triangle(RtPoint point1, RtPoint point2, RtPoint point3, RtVector normal1, RtVector normal2, RtVector normal3)
 {
     Point1  = point1;
     Point2  = point2;
     Point3  = point3;
     Normal1 = normal1;
     Normal2 = normal2;
     Normal3 = normal3;
 }
Exemplo n.º 3
0
        public RtVector NormalToWorld(RtVector normal)
        {
            normal = RtMatrix.Transpose(Transform.Inverse()) * normal;
            normal = normal.Normalize();

            if (Parent != null)
            {
                normal = Parent.NormalToWorld(normal);
            }

            return(normal);
        }
Exemplo n.º 4
0
        public AreaLight(RtPoint corner, RtVector uVector, int uSteps, RtVector vVector, int vSteps, RtColor intensity)
        {
            Corner    = corner;
            UVector   = uVector / uSteps;
            USteps    = uSteps;
            VVector   = vVector / vSteps;
            VSteps    = vSteps;
            Intensity = intensity;

            var middle = (uVector / 2) + (vVector / 2);

            Position = new RtPoint(middle.X, middle.Y, middle.Z);
            Samples  = uSteps * vSteps;
        }
Exemplo n.º 5
0
 public Ray(RtPoint origin, RtVector direction)
 {
     Origin    = origin;
     Direction = direction;
 }