1persp_project(3) Allegro manual persp_project(3)
2
3
4
6 persp_project, persp_project_f - Projects a 3d point into 2d screen
7 space. Allegro game programming library.
8
10 #include <allegro.h>
11
12
13 void persp_project(fixed x, fixed y, fixed z, fixed *xout, fixed
14 *yout);
15
16 void persp_project_f(float x, float y, float z, float *xout, float
17 *yout);
18
20 Projects the 3d point (x, y, z) into 2d screen space, storing the
21 result in (*xout, *yout) and using the scaling parameters previously
22 set by calling set_projection_viewport(). This function projects from
23 the normalized viewing pyramid, which has a camera at the origin and
24 facing along the positive z axis. The x axis runs left/right, y runs
25 up/down, and z increases with depth into the screen. The camera has a
26 90 degree field of view, ie. points on the planes x=z and -x=z will map
27 onto the left and right edges of the screen, and the planes y=z and
28 -y=z map to the top and bottom of the screen. If you want a different
29 field of view or camera location, you should transform all your objects
30 with an appropriate viewing matrix, eg. to get the effect of panning
31 the camera 10 degrees to the left, rotate all your objects 10 degrees
32 to the right.
33
34
35
36
38 set_projection_viewport(3), get_camera_matrix(3), ex3d(3), exstars(3)
39
40
41
42Allegro version 4.4.2 persp_project(3)