public override void Rotate(Matrix4 rotationMatrix) { LookAt = VectMatrix.Multiply(LookAt, rotationMatrix); RotVect = VectMatrix.Multiply(RotVect, rotationMatrix); LookAt = LookAt.Normalize(); RotVect = RotVect.Normalize(); }
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); }
public Plane(Vect3 position, Vect3 normal) : base(position, normal) { LookAt = LookAt.Normalize(); }