Exemple #1
0
        /**
         * Creates a camera positioning matrix from the given eye and target points
         * and up vector.
         *
         * @param eye location of the eye
         * @param target location of the target
         * @param up vector pointing upwards
         * @return
         */
        public static Matrix4 lookAt(Point3 eye, Point3 target, Vector3 up)
        {
            Matrix4 m = Matrix4.fromBasis(OrthoNormalBasis.makeFromWV(Point3.sub(eye, target, new Vector3()), up));

            return(Matrix4.translation(eye.x, eye.y, eye.z).multiply(m));
        }