delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/04/00:10:55

Message-Id: <3.0.6.32.19990203224445.008bf9a0@pop.netaddress.com>
X-Sender: pderbysh AT pop DOT netaddress DOT com
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Wed, 03 Feb 1999 22:44:45 -0500
To: djgpp AT delorie DOT com
From: Paul Derbyshire <pderbysh AT usa DOT net>
Subject: Re: Floating Point Problems... HELP
In-Reply-To: <36B8EA98.59FAFF73@ibm.net>
References: <36AAA3C3 DOT 6DB3459F AT ibm DOT net>
<36aac69e DOT 388339665 AT news DOT snafu DOT de>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019