Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!rutgers!njin!princeton!phoenix!kadickey From: kadickey@phoenix.Princeton.EDU (Kent Andrew Dickey) Newsgroups: comp.sys.apple Subject: Re: 3-D vector graphics in assembly Summary: A better way Message-ID: <7899@phoenix.Princeton.EDU> Date: 22 Apr 89 02:00:08 GMT References: <23400@agate.BERKELEY.EDU> <722@ultb.UUCP> Reply-To: kadickey@phoenix.Princeton.EDU (Kent Andrew Dickey) Organization: Princeton University, NJ Lines: 43 In article <722@ultb.UUCP> lmb7421@ultb.UUCP (L.M. Barstow (674SPS)) writes: >In article <23400@agate.BERKELEY.EDU> labc-3dc@web-4b.berkeley.edu (Andy McFadden) writes: >>Question is, does anybody have source/object/vague general notions of >>how to do 3-D transformations in assembly language? >> >>I have a couple of old Nibble magazines, but those requires some transcen- >>dental functions and square roots (the latter of which is not well handled >>in the GS toolbox... +/- 3...). Is there a better/faster way? >> >How about taking the transcendentals and changing them into series >expansions...then all you have to do is run about 3-4 terms of the >series expansion through the computer (something that, if programmed >with care, can be done without too much reliance on SANE) > >I make no claims on the ability of this method, as I have never actually >programmed it, but it should be faster than using SANE. Using tricks >like multiplying by bit-shifting, and storing polynomials in >bit-patterns, you should be able to create some fairly fast code. Most commercial games don't actually do the 3-D computation on the fly-- instead, they compute the actual bit-image of the shape rotated at various angles and store those directly into memory. There could be dozens of different rotations all stored in memory at once. They can then 'rotate' the object by just copying directly to the screen the bit-image of the correct rotation. All of the calculations for the proper shapes can be computed before-hand using BASIC if so desired. For 'on-the-fly' type graphics, you are probably best off computing a table of approximate sines and cosines, and using that with a fixed point representation. If possible, look into how Applesoft does shape table rotations...it's a pretty good method. I also don't understand what the storing polynomials in bit-patterns means exactly...what polynomials??? NEVER USE SANE!! You must be joking if you were seriously considering using that! Find the actual code that does integer multiplications, and recode that directly into your programs...it's an efficient routine, but calls through the tool manager slow it down a lot. Kent Dickey KADICKEY@phoenix.arpa KADICKEY@PUCC.Bitnet