I would like to know if we can do a matrix that give a frustum volume with a triangular base
I would like to know if we can do a matrix that give a frustum volume with a triangular base
Triangular cant be done but you can approximate it with a trapezoidal projection.
What you need to do is establish a scale matrix to scale one of the coordinates (y in this case), along one of the axis (y axis in this case)
Something like this should do:
glLoadIdentity()
glFrustum(0, value, 0, value, 1.0, far);
glScalef(1.0, y, 1.0);
where y is some large positive value.
V-man
[This message has been edited by V-man (edited 05-02-2002).]
------------------------------
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);