natiny_camera_set_clip
void natiny_camera_set_clip(NatinyCamera cam, float near_z, float far_z);
Sets the near and far planes of a camera, in world units. Nothing closer than
near_z or further than far_z is drawn, and the depth buffer spreads its
precision between them.
Parameters
| Name | Type | Description |
|---|---|---|
cam |
NatinyCamera |
Camera handle |
near_z |
float |
Distance to the near plane; must be above 0 |
far_z |
float |
Distance to the far plane; must be beyond near_z |
Example
natiny_camera_set_clip(cam, 0.2f, 2000.0f);
Notes
- Defaults are
0.1fand100.0f. near_zis clamped to at least0.0001f;far_zis clamped to at leastnear_z * 1.001f.- A large
far_z / near_zratio reduces depth-buffer precision.