Following my previous thread about Allegro 5 transformations, I'm now trying to understand Allegro's projection transforms.
Suppose I have a 3D point (x, y, z) and I want to find out it's screen coordinates. Allegro uses an orthographic transform by default, does that mean I can simply ignore the z coordinate and draw, say, a rectangle representing that point at (x, y)?.
What if, instead, I set up a perspective transform using al_perspective_transform() and al_use_projection_transform()? How would I then find the screen coordinates for a point? I thought that using al_transform_coordinates_3d() with the current projection transform would give me the screen coordinates but the results I'm getting are not what I expected. It seems like the resulting values from al_transform_coordinates_3d() lie within (-1, -1) and (1, 1) so I have to multiply those values by the screen -or window- width and height to get the actual screen coordinates, is that correct?. Also, I see there are a couple of new functions in 5.2.4 to simplify this kind of things, al_transform_coordinates_4d() and al_transform_coordinates_3d_projective(); haven't tried those yet since I'm still using 5.2.3 but they look like what I need in this case, right?.
Finally, and somewhat related, Allegro's default projection transform uses near and far values of -1 and 1, respectively. That is not a problem if you're using only 2D operations but, as soon as you use any of the al_*_transform_3d() functions, it might be a problem. I know it makes sense that, if you're going to use any of the 3D transformation functions, you set up a corresponding projection transform but that may not be so obvious at first for unexperienced users, so I guess at least a mention about this in the documentation would be nice.