Path: chuka.playstation.co.uk!news From: "Harvey.C" Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: 2d sprites in a 3d world Date: Sun, 29 Nov 1998 15:13:42 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 45 Message-ID: <366164A6.660A@mdx.ac.uk> References: <36610839.30F5@mdx.ac.uk> <366152D4.FDA4A6B3@scee.sony.co.uk> Reply-To: hc054@mdx.ac.uk NNTP-Posting-Host: dialup-98-49.barrysworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.04Gold (Win95; I) James Russell wrote: > > "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. Ahhhhh, I knew there was something missing because I couldn't figure out the purpose in applying an empty matrix. I'll try it out and let you know if it works. Thanks mate - you da man! -- Regards | E-mail: hc054@mdx.ac.uk Harvey | ICQ: 4269478