Ejemplo n.º 1
0
        public void SetLookAt(Vector3d eye, Vector3d target, Vector3d up)
        {
            // Make rotation matrix
            // Z vector
            Vector3d column2 = eye - target;

            column2.Normalize();

            Vector3d column1 = up;

            Vector3d column0 = column1.Cross(column2);

            // Recompute Y = Z cross X
            column1 = column2.Cross(column0);

            column0.Normalize();
            column1.Normalize();

            basis = new Basisd(column0, column1, column2);

            origin = eye;
        }
Ejemplo n.º 2
0
 public Planed(Vector3d v1, Vector3d v2, Vector3d v3)
 {
     _normal = (v1 - v3).Cross(v1 - v2);
     _normal.Normalize();
     D = _normal.Dot(v1);
 }