Path: chuka.playstation.co.uk!news From: "Harvey.C" Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: 3d sprites solved! Date: Wed, 02 Dec 1998 09:35:09 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 35 Message-ID: <366509CD.572E@mdx.ac.uk> References: <36619C02.1961@mdx.ac.uk> <36647950.24798766@www.netyaroze-europe.com> Reply-To: hc054@mdx.ac.uk NNTP-Posting-Host: dialup-98-221.barrysworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.04Gold (Win95; I) Robert Swan wrote: > > On Sun, 29 Nov 1998 19:09:54 +0000, "Harvey.C" > wrote: > > // Scales the tree - 16777216=4096<<12 is a constant (works for me) > > sprite->scalex=sprite->scaley=16777216/transformedPosition.vz; > > Im guessing that the reason the value 16777216 works is because a) > this value will depend on the size of the sprite to begin with, but > more importantly b) is wher you 'scale' the sprite in order to give a > comparable scale to the 3D objects in the scene. There is no point > having your sprite to be the equivalent of 3 world units in size when > your road is something like 2000, or vica versa. Guessing that > 16777216 makes it just the right magnitude for your scene. Only reason > I point this out is in case people start asking why their sprites dont > come out the right size :) > > Rob Well, to give everyone some idea my game uses a funky looking tree which is 48x64. Using 4096<<12 is just about right. Ideally you'd want the sprite to be at its natural resolution at half its maximum viewing distance from the camera. For example, if your viewing distance was 10000 pixels, then the tree should be 48x64 at 5000 pixels. Therefore, the constant should be: sprite->scalex=sprite->scaley=(half of viewing distance<<12)/transformedPosition.vz. Ugh, maybe I should have pointed this out earlier! -- Regards | E-mail: hc054@mdx.ac.uk Harvey | ICQ: 4269478