
The simplest thing to do is to build the matrix yourself. The advantage of this is even if you are working in something like D3D (which renders lefthanded) you can build the matrix out of a right handed system.
Let me show you how to set up a D3D camera in a right handed scene. All the math/visualization in right handed systems is very close to what is taught in most high school/college math courses. But that doesn't preclude you from setting up a LeftHanded view matrix. I'll try to explain all the essential steps very clearly (i.e. this may be a bit basic for many people but I'll try to be complete). Also it will apply to OpenGL or other custom renderers. You may just have to flip some of the vectors.
First of all, you have to build the basis vectors for the camera. This is easy, all you have to do is think about how to describe the camera's location in your space. Your view matrix is built out of these basis vectors. So you know you'll need to find the camera's x, y, and z vectors. For a Left Handed System these are "Right"(x), "Up"(y), and "View"(z). If you think about this, and remember your "lefthand rule" you'll see that right, up and view form a left handed system. According to the left hand rule, crossing x to y should give the z vector if you use your left hand. And if you place the fingertips of your open left hand toward the your right (x vector), palm up, then curl your fingers upward (y vector), you'll find that your thumb does point toward your "view." (z vector)
You remember the cross product (hopefully). Take the fingers of your right hand and place them along the first vector. Then curl them toward the second vector. Your right thumb points to the result of the cross product. This is defined in code like so (for example):
Vector3f temp; temp.x = v1.y * v2.z  v1.z * v2.y; temp.y = v1.z * v2.x  v1.x * v2.z; temp.z = v1.x * v2.y  v1.y * v2.x; return temp;
This cross product is used to build the basis vectors for your camera. What should you have so far from the rest of your program? Coordinates for the camera and the target. Also you will want to assume (or provide) an "up" vector for your camera.
Vector3f vWorldUp; vWorldUp.x = 0.0f; vWorldUp.y = 0.0f; vWorldUp.z = 1.0f;
Vector3f vTarget; Vector3f vPosition;
Now the rest is a piece of cake. As Dr. GUI says, "It couldn't be easier." First we need to find the "view" (z axis) vector for the camera. This is simply the direction you are looking at.
Vector3f vView = vTarget  vPosition;
Also, now is a good time to check to see if you are too close to your target, if so you will get some division errors, etc. So have some code like:
if(vView.magnitude() > >>I've set up a camera matrix and a camera position and the rotation seems to work okay BUT I cannot move the camera. It's driving me mad cos I think I'm close to getting the basic working. >> >>Any help would be great. Thanks.
