Mail Archives: djgpp/1999/02/04/00:10:55
Betcha your code is dividing by zero.
1. Get DJGPP 2.02, and programs you build with it won't crash from such
math errors.
2. Make sure your math is correct -- you probably shouldn't be dividing
by zero there. Divisions by 0 in 3D code often result when applying
perspective transformations to something behind the camera or
exactly in a plane with the camera perpendicular to the direction
the camera is facing. To avoid that, z clip things so they don't
come closer to the camera than a small distance, e.g. by chopping
off polygons and parts of polygons that come closer to the camera
than z=0.01, assuming 0.01 is a small small distance in your system
and z is the direction parallel to the camera's viewing center
direction. Your z buffering can do the z clipping.
--
.*. "Clouds are not spheres, mountains are not cones, coastlines are not
-() < circles, and bark is not smooth, nor does lightning travel in a
`*' straight line." -------------------------------------------------
-- B. Mandelbrot |http://surf.to/pgd.net
_____________________ ____|________ Paul Derbyshire pderbysh AT usa DOT net
Programmer & Humanist|ICQ: 10423848|
- Raw text -