Macaw OS C reference

Function project3d

#include <macaw3d.h>
int project3d(
    double x,
    double y,
    double z,
    double *sx,
    double *sy,
    double *dist
);

Works out where a place in the world shows up in the picture, seen through camera3d's camera.

Parameters

xdouble
The place's position across, in world units.
ydouble
The place's height.
zdouble
The place's position along z.
sxdouble *
Where to put how far across the picture it is, in pixels: the address of a double, like &sx.
sydouble *
Where to put how far down the picture it is, in pixels: the address of a double, like &sy.
distdouble *
Where to put how far ahead of the camera it is, in world units: the address of a double.

Returns int

1 if the place is in front of the camera, or 0 if it's behind (and nothing is written).

In Lamps, fog and lines, with pointlight3d, fog3d, nofog3d, line3d, stats3d.