Xref: news-dnh.mv.net comp.graphics.algorithms:10926 comp.os.msdos.djgpp:2322 comp.os.msdos.programmer:14311 rec.games.programmer:29729 Path: news-dnh.mv.net!mv!news.sprintlink.net!in1.uu.net!newstf01.news.aol.com!newsbf02.news.aol.com!not-for-mail From: kptben AT aol DOT com (KPT Ben) Newsgroups: rec.games.programmer,comp.os.msdos.djgpp,comp.os.msdos.programmer,comp.graphics.algorithms Subject: Re: Fixed-point Math Library Date: 2 Oct 1995 08:18:42 -0400 Organization: America Online, Inc. (1-800-827-6364) Lines: 34 Sender: root AT newsbf02 DOT news DOT aol DOT com References: <44oi23$1gt AT alpha DOT cisi DOT unige DOT it> Reply-To: kptben AT aol DOT com (KPT Ben) Nntp-Posting-Host: newsbf02.mail.aol.com To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp fritz AT dibe DOT unige DOT it (Fabrizio Giudici) wrote: >In article <43rf7k$cdj AT freenet3 DOT scri DOT fsu DOT edu>, joeo AT freenet2 DOT scri DOT fsu DOT edu >says... >> >>I'm trying to write some very simple 3d stuff for a DOS machine using >>DJGPP, but the floating point stuff is just WAYYYY too slow on my machine >>(a 486SX). So I tried using integral math (multiplying all results by >>10000 or more), but that causes all results to eventually end up at zero >>due to rounding and precision losses. > >A suggestion: don't multiply for a ten power, but use a two power!! For >example, use 10240 instead of 10000, so you'll able to change many rescaling >mul/divs into simpler (and faster) bit-shifts!! > >Concerning precision losses, try to use just a few bits (i.e. multiply for >256 or 512 instead of 10240), or however make experiments with many values: >often too many decimal bits are a waste and more decimal bits ==> more chances >of overflow. For example, I'm writing a complex (and working ;-) 3-D engine >for a flight simulator for which 8-bits (x 256) are pretty good!! Uh, 10240 is not a power of 2, last time I checked... try 8192 or 16384 :) -- Ben Weiss Senior Software Engineer MetaTools Inc. (formerly HSC Software)