I am developing 3d flash game and my question is very simple.
How to convert 3d point to 2d point?
I've found next formula in Internet(camera is situated in origin)
- x' = x/z y' = y/z
- ratio = focal length/(focallength + z)
x = x*ratio
y = y*ratio
But these formulae give me strange result when z are less than zero(z<0)
I need build line from A(100,100,100) to B (100,100;-100) As you can see these equations give really strange result when I try to convert B point in 2D dimension
How can I solve this problem?