示例#1
0
 /** A scale matrix */
 public static Mat4f scale(ConstVec3f v) {
   return scale(v.x(), v.y(), v.z());
 }
示例#2
0
 /** A view matrix defined by its forward and up vectors. */
 public static Mat4f view(ConstVec3f forward, ConstVec3f up, ConstVec3f eye) {
   Vec3f left = up.cross(forward);
   return new Mat4f(
       new Vec4f(left, 0), new Vec4f(up, 0), new Vec4f(forward, 0), new Vec4f(eye, 1));
 }
示例#3
0
 /** A translation matrix */
 public static Mat4f translation(ConstVec3f v) {
   return translation(v.x(), v.y(), v.z());
 }
示例#4
0
 /** A rotation matrix around the u-axis with length 1. */
 public static Mat4f rotation(ConstVec3f u, double radians) {
   return rotation(u.x(), u.y(), u.z(), radians);
 }