Path: chuka.playstation.co.uk!news From: Harvey Cotton Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Looking for... Date: Thu, 07 Jan 1999 11:42:26 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 36 Message-ID: <36949DA2.2956@mdx.ac.uk> References: <368a4f74.24103378@news.playstation.co.uk> <368CA5F0.6EB6@mdx.ac.uk> <3691A8DA.E2D92BBC@znet.com> Reply-To: hc054@mdx.ac.uk NNTP-Posting-Host: stu-dialup1.mdx.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.04Gold (Win95; I) > > > And could someone give me a functioning 3d Sprite Routine, or post it > > > here? Yes, I saw the old messages, but I would like to get it in one > > > piece, that would be more than nice....8-D > > > Heres a function to draw a 3d sprite: > > > > thanks. I'm curious about-- > > > sprite.scalex=sprite.scaley=16777216/transformedPosition.vz; > > Where does the 16777216 value come from? I use > sprite.scalex=sprite.scaley=ONE*projectionDistance/transformedPosition.vz; > where ONE=4096 (from libps.h) The value is a scaling constant. There is no perfect value because it all depends on how big you've drawn your sprite. It your sprites are tiny, you may wish to use much larger constants. > GsSortSprite(&sprite,&OTable_Header[CurrentBuffer],transformedPosition.vz>>(precision-2)); > > What is "precision" (I assume it's the number of bits of the ot size?) > and why do you subtract 2? > Mine works, I it's just that I found the right value by trial and error. I think is +2 but I cannot remember. Its something to do with the way polygons are inserted into the ordering table (sprites work differently). It was mentioned early on this newsgroup. -- Regards | E-mail: hc054@mdx.ac.uk Harvey | ICQ: 4269478