The 3D camera determines the way 3D `world' points are mapped into pixel coordinates in the graphics window. In Tina 3D floating point positions are specified by a structure
typedef struct vec3
{
Ts_id ts_id; /* Tina structure identifier */
float el[3];
} Vec3;
they can be created with calls to
Vec2 vec3(double x, double y, double z)
of the form
Vec3 p; p = vec3(0.0, 0.5, 1.0).
(For further details on vector algebra see the Tinamath documentation). The 3D projection function can be called explicitly with
Ipos tv_proj3(Tv *tv, Vec3 p)
3D cameras are usually specified initially by a call to
void tv_camera3(Tv * tv, Vec3 centre, double radius, double pscale,
Vec3 aim, Vec3 down)
This sets the 3D camera used by tv so that:
This `implicit' camera specification is very convenient for visualisation of 3D objects - usually Tina provides a function which gives the centre and radius of an enclosing sphere for such objects, calling tv_camera3 above with varying aim and up directions allows the observer to move round the object, keeping it always in the field of view (see the zoom facility below).