Original Post
I'm trying to make a simple 3d renderer, without dx or ogl. I have all objects in world space as standard, and I use right = +x, up = +y, forward = +z, which is left-handed I believe. With the camera at (0,0,0) and facing the positive z-axis, all objects are rendered how they should. However, the camera should ideally be able to move around and rotate. I can handle the code for moving, but I can't figure out how to transform the points accordingly. The camera simply has two 3d vectors, one for the eyepoint, and the other for the lookAt point. The up vector is by default (0,1,0). I have functions for getting the view, side, and up vectors based on the eye and lookAt. However since I can't get the transformations to work, I can't be sure they are right. My current process is to subtract each point by the camera's eyepoint, setting it at the origin. The part I can't get is properly rotating the view vector to point along the positive z-axis. I've looked online extensively, and everything I find either tells me how to use directx or opengl's functions, or it didn't work for me. I have implementations of 3d vectors, 4d vectors, 3x3 matrices, 4x4 matrices, tons of stuff tried and failed. Alternatively, not a problem per se, but a question. Currently, my implementation of projection is just to divide the x and y coords by the z coord, something I remember hearing a while ago. It works, and moving the camera around (the eyepoint... it still has to look straight ahead) seems realistic. However, it tends to stretch things along the z-axis, ie. things look longer than they really are. I have seen many projection transformations in my searches for view transformations, and although I didn't try any of them, I still wonder: is my implementation acceptable and/or what is the best way to do projection?