Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: 2d sprites in a 3d world Date: Sun, 29 Nov 1998 13:57:40 +0000 Organization: Sony Computer Entertainment Europe Lines: 34 Message-ID: <366152D4.FDA4A6B3@scee.sony.co.uk> References: <36610839.30F5@mdx.ac.uk> NNTP-Posting-Host: mailgate.scee.sony.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5b2 [en] (Win95; I) X-Accept-Language: en "Harvey.C" wrote: > > > I managed to get this code working, and sure enough I got my sprite on the screen with > the correct x,y position and depth priority. However, it positions the sprite relative > to the camera, not the world. > > For example, my game uses a chase cam for the car (using the super field). When I > display the sprite at say 0,0,5000 it will position it in front of the of the camera > regardless of the position or direction of the camera! Hmmmm... Are you sure you're using the right matrix (GsWSMATRIX, sorry, I forgot the 'WS' part in the code that I posted)? If you're using that, are you using it _after_ you call GsSetRefView2()? Also, I recall that ApplyMatrixLV doesn't add in the translation of the matrix. So try this: ApplyMatrixLV(&GsWSMATRIX,&spritePosition, &transformedPosition); transformedPosition.vx += GsWSMATRIX.t[0]; transformedPosition.vy += GsWSMATRIX.t[1]; transformedPosition.vz += GsWSMATRIX.t[2]; That would make a big difference! Let me know if it works, this code would be a useful addition to the FAQ. Cheers, James -- == James_Russell@scee.sony.co.uk +44 (171) 447-1626 == Developer Support Engineer - Sony Computer Entertainment Europe Easter is canceled this year. They've found the body.