ax,ay,az (point to draw)
cx,cy,cz (camera)rx,ry,rz (camera rotation)ex,ey,ez (the viewer's position relative to the display surface)-> bx,by (2D projection of a)
Quote:
dx=cos(rx)*(sin(rz)*(ay-cy)+cos(rz)*(ax-cx))-sin(ry)*(az-cz)dy=sin(rx)*(cos(ry)*(az-cz)+sin(ry)*(sin(rz)*(ay-cy)+cos(rz)*(ax-cx)))+cos(rx)*(cos(rz)*(ay-cy)-sin(rz)*(ax-cx))dz=cos(rx)*(cos(ry)*(az-cz)+sin(ry)*(sin(rz)*(ay-cy)+cos(rz)*(ax-cx)))+sin(rx)*(cos(rz)*(ay-cy)-sin(rz)*(ax-cx))bx=(dx-ex)*(ez/dz)by=(dy-ey)*(ez/dz)
#