示例#1
0
        public override void Rotate(Matrix4 rotationMatrix)
        {
            LookAt  = VectMatrix.Multiply(LookAt, rotationMatrix);
            RotVect = VectMatrix.Multiply(RotVect, rotationMatrix);

            LookAt  = LookAt.Normalize();
            RotVect = RotVect.Normalize();
        }
示例#2
0
        public Sphere(Vect3 position, Vect3 lookAt, double rotationRad, Color color) : base(position, lookAt)
        {
            Color  = color;
            Radius = lookAt.Length();

            // calculate the rotation of the 0-meridian
            RotVect = lookAt;

            // check so we don't end up with two linear dependent vectors
            if (System.Math.Abs(RotVect.Y) > Constants.EPS &&
                System.Math.Abs(RotVect.X) < Constants.EPS &&
                System.Math.Abs(RotVect.Z) < Constants.EPS)
            {
                RotVect.X += 1;
            }
            else
            {
                RotVect.Y += 1;
            }
            RotVect = RotVect.CrossProduct(lookAt).Normalize();
            LookAt  = LookAt.Normalize();
            Rotate(lookAt, rotationRad);
        }
示例#3
0
 public Plane(Vect3 position, Vect3 normal) : base(position, normal)
 {
     LookAt = LookAt.Normalize();
 }