Showing posts with label matrix. Show all posts
Showing posts with label matrix. Show all posts

Saturday, June 4, 2011

How to create a view matrix

When I started with 3D I had this really handy function in the GLUT library called gluLookAt(...) which helps you position the viewer (camera) inside your scene.What this matrix does is to transform points from world space into camera space - or in other words in it answers this question: "What would be the coordinate of a world point if the camera was the origin of a new world coordinate system?". WebGL does not have it in its API, so let's create our own from scratch then.