   3d to 2d nonlinear perspective projection
  Hello there, through this thread (http://www.gamedev.net/community/forums/topic.asp?topic_id=494026) I've easily created a working transform for drawing the world, however I am having a bit of trouble where when I turn the view of the world warps towards the center of the screen then inverts.The code I have is as follows: vector transform(vector org){    local float ax, az, ay;    local float dx, dy, dz;local float bx, by;   local float crx, cry, crz;    local float cx, cy, cz;   // z is vertical in other logic    ax = org.x;    az = org.y;    ay = org.z;  crx = player.pitch * DEG2RAD;    cry = player.angle * DEG2RAD;    crz = 0;  // again conform to z being depth cx = player.origin.x;    cy = player.origin.z + player.view_ofs;    cz = player.origin.y;   dx = cos(cry)*(sin(crz)*(ay-cy)+cos(crz)*(ax-cx))-sin(cry)*(ax-cx);    dy = sin(crx)*(cos(cry)*(az-cz)+sin(cry)*(sin(crz)*(ay-cy)+cos(crz)*(ax-cx)))+cos(crx)*(cos(crz)*(ay-cy)-sin(crz)*(ax-cx));    dz = cos(crx)*(cos(cry)*(az-cz)+sin(cry)*(sin(crz)*(ay-cy)+cos(crz)*(ax-cx)))-sin(crx)*(cos(crz)*(ay-cy)-sin(crz)*(ax-cx));   bx = dx * conwidth / dz;by = dy * conheight / dz;bx = bx + center_screen.x;by = center_screen.y - by;   return vector(bx, by, 0);   }From my knowledge the example should support nonlinear perspective or am I wrong in assuming so and would only work for orthogonal? I am new to 3d rendering in general and was hoping to try to wrap my mind around this first. I understand this'd be a lot more smart using 4x4 matrices also then you can overlay multiple transforms however the scripting language I am using does not easily support such matrices and would like to work off of what is available. Thank you in advance for any input :)   