Mar 21, 2012 at 6:57am UTC
I've tried in many ways to project a point to the screen. I read somewhere that this was the way.
screen_x = ((+((point_x-viewpoint_x) / (point_z-viewpoint_z))*screen_w/2) + screen_w/2);
This doesn't work. When I increase the distance between the x coordinates (right and left) it projects the points away from the middle.
What is the correct formula for projecting a point?
Is it difficult?
Should I buy a book for this?
Is there a good web page for this?
Mar 21, 2012 at 10:27am UTC
you should use a transformation matrix.
Mar 21, 2012 at 10:53am UTC
How do I write a matrix in c++? Something like this[5][5]?
Mar 21, 2012 at 12:08pm UTC
There isn't enough information here.
What API are you using for drawing the point? Is it 2D or 3D? Is your viewport set up correctly? Is the object big enough to be seen? Is it within the range of your near/far planes?
You need to be more specific.