Mail Archives: djgpp/1995/10/03/02:04:03
Xref: | news-dnh.mv.net comp.graphics.algorithms:10950 comp.os.msdos.djgpp:2341
|
| comp.os.msdos.programmer:14336 rec.games.programmer:29804
|
Path: | news-dnh.mv.net!mv!news.sprintlink.net!tank.news.pipex.net!pipex!oleane!univ-lyon1.fr!dsi.unimi.it!news.unige.it!poseidon!fritz
|
From: | fritz AT dibe DOT unige DOT it (Fabrizio Giudici)
|
Newsgroups: | rec.games.programmer,comp.os.msdos.djgpp,comp.os.msdos.programmer,comp.graphics.algorithms
|
Subject: | Re: Fixed-point Math Library
|
Followup-To: | rec.games.programmer,comp.os.msdos.djgpp,comp.os.msdos.programmer,comp.graphics.algorithms
|
Date: | 2 Oct 1995 11:22:42 GMT
|
Organization: | University of Genoa
|
Lines: | 30
|
References: | <43rf7k$cdj AT freenet3 DOT scri DOT fsu DOT edu> <44edp8$3vc AT due DOT unit DOT no>
|
Nntp-Posting-Host: | poseidon.dibe.unige.it
|
To: | djgpp AT sun DOT soe DOT clarkson DOT edu
|
Dj-Gateway: | from newsgroup comp.os.msdos.djgpp
|
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!!
Good luck...
--
..---------------------------------------------------------------------------.
| Fabrizio Giudici, PhD Student (fritz AT dibe DOT unige DOT it) | |
| WWW-PAGE: http://poseidon.dibe.unige.it/~fritz/ | Style distinguishes |
| PHONE: +39 10 3532163 / 3532780 | excellence from |
| Dept. of Biophys. and Elect. Eng. (DIBE) | accomplishment. |
| University of Genoa - ITALY, EUROPE, EARTH | |
`---------------------------------------------------------------------------'
All expressed opinions are personal and not of the organization I work for.
- Raw text -