Bounty Collector
Bounty Collector

Reputation: 635

How to get the 4x4 transformation matrix for an operation

I have this data and i need to come up with the transformation matrix:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); 

Suppose that there is a unit cube centered at the origin and we want to view it by looking directly at one of its corners (i.e., at to the three axes). What 4X4 transformation matrix would be required?

I understand that it is translation +Scaling, but i am not sure how to put it in matrices form.

Upvotes: 0

Views: 254

Answers (1)

Wilbert
Wilbert

Reputation: 7419

Look at the OpenGL glOrtho man page:

glOrtho

It tells you how the matrix is computed.

Here is a copy of the man page better formatted for web use:

glOrtho

Upvotes: 1

Related Questions