|
The JGLU class must include utilitarian functions associated with 3D geometric transformations. How do I implement the following utilities in the OpenGl4 environment, which were used in earlier versions and are now being implemented.
float [] matrixIdentity (void) - returns 4x4 identity array.
float [] matrixMult (float [] m0, float [] m1) - returns the result of the multiplication of matrices m0 and m1 (m0.m1). The result and matrices m0 and m1 are 4x4 matrices.
float [] matrixTranslate (float x, float y, float z) - computes and returns 4x4 translation matrix. The input parameters x, y and z specify the translation in x, y and z, respectively;
float [] matrixRotate (float angle, float x, float y, float x) - calculates and returns 4x4 rotation matrix counterclockwise around the axis passing through the origin y at the point (x, y, z) . The angle parameter specifies the angle of rotation in degrees.
float [] matrixScale (float x, float y, float x) - calculates and returns 4x4 scale transformation matrix. The parameters x, y and z specify the scaling factors in the x, y and z directions, respectively.
float [] lookAt (float ey, float ez, float cx, float cy, float cz, float ux, float uy, float uz) - computes and returns display matrix as the glLookAt function.
float [] ortho (float l, float r, float b, float t, float n, float f) - computes and returns the orthographic parallel projection matrix as the glOrtho function.
float [] frustum (float l, float r, float b, float t, float n, float f) - computes and returns the perspective projection matrix as the glFrustum.
Can someone help me with this problem?
|