Class View

java.lang.Object
org.flag4j.linalg.transformations.View

public final class View extends Object
Utility class containing static for generating view matrices.
  • Method Details

    • lookAt

      public static Matrix lookAt(Vector cameraPos, Vector center, Vector up)
      Constructs a view matrix for a camera at world position cameraPos, looking at the point center where up is the direction of the upwards vector in world coordinates. This function is identical to glm's lookAt function.
      Parameters:
      cameraPos - Camera position in world coordinates. Must have length 3.
      center - The point the camera is looking at. Must have length 3.
      up - The vector in the direction fo the worlds 'upward' vector. Must have length 3.
      Returns:
      A view matrix for a camera at world position cameraPos, looking at the point center where up is the direction of the upwards vector in world coordinates.
      Throws:
      IllegalArgumentException - If any of the argument vectors do not have length 3.