Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!liuida!isy!lysator.liu.se!zap From: zap@lysator.liu.se (Zap Andersson) Newsgroups: comp.sys.amiga.programmer Subject: Re: Fast 3d Graphics Keywords: fast 3d optimizing assembly cycles Message-ID: <558@lysator.liu.se> Date: 4 Apr 91 12:10:36 GMT Article-I.D.: lysator.558 References: <9529@star.cs.vu.nl> <1047@cbmger.UUCP> Sender: news@isy.liu.se (Lord of the News) Organization: Lysator Computer Club, Linkoping University, Sweden Lines: 41 peterk@cbmger.UUCP (Peter Kittel GERMANY) writes: >In article <9529@star.cs.vu.nl> mmblom@cs.vu.nl (Marc Blom) writes: >>'m wondering how fast 3D graphics can really go. I've written some rotation >>and perspective routines (in assembly) and profiling shows that 60 % of the >>time is spend in my routine RotatePoint. This routine rotates 1 point around >>all three axes in only about 900 cycles minimum and about 1100 cycles maximum. Instead of rotation around one axis at the time, you may create a rotation matrix, that rotates around all three axis simultaneously, with 9 multiplies. The tecnique is picked up from any elementary cumputer graphics book, but simply, it is: NewX = OldX * XX + OldY * XY + OldZ * XZ NewY = OldY * YX + OldY * YY + OldZ * YZ New>Z = OldZ * ZX + OldY * ZY + OldZ * ZZ where XX,XY,XZ,YX,YY,YZ,ZX,ZY,ZZ is your rotation matrix. You can think of XX,XY,XZ as the (new) direction of the old X axis, and YX,YY,YZ as the (new) direction of the old Y axis and so forth. You may easily build these by taking the points: XX = 1, XY = 0, XZ = 0 YX = 0, YY = 1, YZ = 00 ZX = 0, ZY = 0, ZZ = 1 And rotate these using "your" method. Then Use these to rotate the other points. >-- >Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions... >Commodore Frankfurt, Germany \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk -- * * * * * * * * * * * * * * * * * (This rent for space) * My signature is smaller than * Be warned! The letter 'Z' is Copyright 1991 * yours! - zap@lysator.liu.se * by Zap Inc. So are the colors Red, Green and * * * * * * * * * * * * * * * * * Greenish-yellow (Blue was taken by IBM) -- * * * * * * * * * * * * * * * * * (This rent for space) * My signature is smaller than * Be warned! The letter 'Z' is Copyright 1991 * yours! - zap@lysator.liu.se * by Zap Inc. So are the colors Red, Green and * * * * * * * * * * * * * * * * * Greenish-yellow (Blue was taken by IBM)