Path: chuka.playstation.co.uk!news From: Harvey Cotton Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Looking for... Date: Fri, 01 Jan 1999 10:39:44 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 43 Message-ID: <368CA5F0.6EB6@mdx.ac.uk> References: <368a4f74.24103378@news.playstation.co.uk> Reply-To: hc054@mdx.ac.uk NNTP-Posting-Host: stu-dialup13.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) Robert Ruza wrote: > > Hello! > > I'm looking for an simple tree Model in RSD-Format with 4Bit Textures. > 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 > > Meanwhile...I wish you happy new YEAR!!!!!!! > > PlayStation ruuullleeeeeeezzzz. > > With best regards, > > Rob Heres a function to draw a 3d sprite: void draw_3dsprite (GsSPRITE *sprite,long x,long y,long z,short precision) { VECTOR transformedPosition,position={x,y,z}; ApplyMatrixLV(&GsWSMATRIX,&position,&transformedPosition); transformedPosition.vz+=GsWSMATRIX.t[2]; if (transformedPosition.vz>0) { transformedPosition.vx+=GsWSMATRIX.t[0]; transformedPosition.vy+=GsWSMATRIX.t[1]; sprite.scalex=sprite.scaley=16777216/transformedPosition.vz; sprite.x=(transformedPosition.vx*250)/transformedPosition.vz; sprite.y=(transformedPosition.vy*250)/transformedPosition.vz; GsSortSprite(&sprite,&OTable_Header[CurrentBuffer],transformedPosition.vz>>(precision-2)); } } Substitute the "250" for the whatever you've set your projection distance to. -- Regards | E-mail: hc054@mdx.ac.uk Harvey | ICQ: 4269478