🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #1420

Re: Need hard core help doing some 3d optimizations

#1420
From: 2fmlcalls
Date: Fri, 12 Apr 1991 01:24
28 lines
1487 bytes
> I just ran Turbo Profiler on some code of mine, and it looks like roughly
> 90% of my CPU time is being shoved into one function.  Any help on the
> optimizations would be really appreciated.

snip

> float xa, ya, za;

snip

> AngPerspFactor is a float, as are the assorted factors.  I have already
> used a COS and SIN lookup table in another part of the module to expedite
> things, but this is really slowing things down considerably.
> 
> Any help is appreciated.
> 
> Brian

I don't fully follow C, but I know float.  Go with scaled integers or longs and
use integer division.  As well, use scaled integers for your sin/co look=up
tables (i.e. sin(45 degrees) = 707 rather than 0.707).  When you are through
multiplying, do a div 1000 (or C equivalent of integer division).

General optimizations - use fewer points.  If you get creative you may find you
can represent your planes/tanks/whatnots with less points (and thus fewer lines
to draw as well).

john calhoun
Technical Details
Message-ID: <1991Apr11.202429.29648@kuhub.cc.ukans.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!kuhub.cc.ukans.edu!2fmlcalls
References: <27979@uflorida.cis.ufl.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!kuhub.cc.ukans.edu!2fmlcalls
From: 2fmlcalls@kuhub.cc.ukans.edu
Newsgroups: rec.games.programmer,comp.os.msdos.programmer,comp.graphics
Subject: Re: Need hard core help doing some 3d optimizations
Message-ID: <1991Apr11.202429.29648@kuhub.cc.ukans.edu>
Date: 12 Apr 91 01:24:29 GMT
References: <27979@uflorida.cis.ufl.EDU>
Organization: University of Kansas Academic Computing Services
Lines: 28