@@ -366,8 +366,10 @@ impl<S: BaseFloat> Matrix4<S> {
366
366
Self :: look_to_rh ( eye, dir, up)
367
367
}
368
368
369
- /// Create a homogeneous transformation matrix that will cause a vector to point at
370
- /// `dir`, using `up` for orientation.
369
+ /// Creates a homogeneous right-handed look-at transformation matrix.
370
+ ///
371
+ /// This matrix will transform a vector to point in `dir` direction, using `up` for orientation
372
+ /// assuming a right-handed corrdinate system.
371
373
pub fn look_to_rh ( eye : Point3 < S > , dir : Vector3 < S > , up : Vector3 < S > ) -> Matrix4 < S > {
372
374
let f = dir. normalize ( ) ;
373
375
let s = f. cross ( up) . normalize ( ) ;
@@ -382,8 +384,10 @@ impl<S: BaseFloat> Matrix4<S> {
382
384
)
383
385
}
384
386
385
- /// Create a homogeneous transformation matrix that will cause a vector to point at
386
- /// `dir`, using `up` for orientation.
387
+ /// Creates a homogeneous left-handed look-at transformation matrix.
388
+ ///
389
+ /// This matrix will transform a vector to point in `dir` direction, using `up` for orientation
390
+ /// assuming a left-handed corrdinate system.
387
391
pub fn look_to_lh ( eye : Point3 < S > , dir : Vector3 < S > , up : Vector3 < S > ) -> Matrix4 < S > {
388
392
Matrix4 :: look_to_rh ( eye, -dir, up)
389
393
}
@@ -395,14 +399,18 @@ impl<S: BaseFloat> Matrix4<S> {
395
399
Matrix4 :: look_to_rh ( eye, center - eye, up)
396
400
}
397
401
398
- /// Create a homogeneous transformation matrix that will cause a vector to point at
399
- /// `center`, using `up` for orientation.
402
+ /// Creates a homogeneous right-handed look-at transformation matrix.
403
+ ///
404
+ /// This matrix will transform a vector to point at `center`, using `up` for orientation
405
+ /// assuming a right-handed corrdinate system.
400
406
pub fn look_at_rh ( eye : Point3 < S > , center : Point3 < S > , up : Vector3 < S > ) -> Matrix4 < S > {
401
407
Matrix4 :: look_to_rh ( eye, center - eye, up)
402
408
}
403
409
404
- /// Create a homogeneous transformation matrix that will cause a vector to point at
405
- /// `center`, using `up` for orientation.
410
+ /// Creates a homogeneous left-handed look-at transformation matrix.
411
+ ///
412
+ /// This matrix will transform a vector to point at `center`, using `up` for orientation
413
+ /// assuming a left-handed corrdinate system.
406
414
pub fn look_at_lh ( eye : Point3 < S > , center : Point3 < S > , up : Vector3 < S > ) -> Matrix4 < S > {
407
415
Matrix4 :: look_to_lh ( eye, center - eye, up)
408
416
}
0 commit comments