home *** CD-ROM | disk | FTP | other *** search
- Path: news.sfu.ca!samy
- From: samy@news.sfu.ca (Sam Yee)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: TMapping again!
- Date: 24 Jan 1996 23:39:35 GMT
- Organization: Simon Fraser University
- Message-ID: <4e6fvn$ahf@morgoth.sfu.ca>
- References: <4dmnbq$pur@morgoth.sfu.ca> <DLL1MI.BqJ@si.hhs.nl>
- NNTP-Posting-Host: fraser.sfu.ca
- X-Newsreader: NN version 6.5.0 #5 (NOV)
-
- (please e-mail to jeremym@wimsey.com)
-
- Yep... a*b = exp(ln(a)+ln(b)) so use log lookups and exp lookups.
-
- Say, per scanline, u=um*t+uc v=vm*t+vc du=dum*t dv=dvm*t
- since um, vm, dum, dvm are constant per polygon, you only need to
- calc ln(um), ln(vm), ln(dum), ln(dvm) once per polygon (using log2 lookup
- table on the highest most sig digits), and t is the distance from the
- user which is constant per scanline (for floors), so ln(t) only needs to
- be calculated once per scanline...
-
- per scanline:
- lnt=ln(t) ; use log2 lookup tables on most sig digits, and compensate
- u=uc+exp(lnt+lnum) ; use exp2 lookup table
- v=vc+exp(lnt+lnvm)
- du=exp(lnt+lndum)
- dv=exp(lnt+lndvm)
-
- Poof.. No more multiplies...
-
- jeremym@wimsey.com
- ------------------
- "Let he who has no sword sell his cloak and buy one." - Jesus, Luke 22:36
-
-
-
-