Path: chuka.playstation.co.uk!news From: Jim Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: 3D Sprite TMDs? Date: Thu, 12 Feb 1998 09:54:48 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 75 Message-ID: <34E2C6E8.2BA8BD0F@micronetics.com> References: <01bce267$32a34140$0300010a@mario> NNTP-Posting-Host: 193.132.195.245 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.03 [en] (WinNT; I) 3d sprites rears its head again.. oh that old chestnut.. Has there been a solution to this problem yet? I was up until the early hours again this morning trying to place a sprite in three dimensions. I have something reasonable working, just a couple of glitches here and there. My major problem is I have a roving camera style view and the sprite has trouble translating in relation to its [camera] position. Here's some pseudo code from what I can remember, am I doing anything unusual? VECTOR v; // coord system VECTOR p; // resulting location for sprite MATRIX m; long x,y; v.vx = 0; v.vy = 0; v.vz = 0; GsInitCoordinate2 ( WORLD, &local); // init coord system GsGetLS (&local, &m); // combine with GsWSMATRIX for camera ApplyMatrix (&m, &v, &p); // project coordinates // perspective calcs and display here... Now this code produces the expected result ( or at least I convinced myself the result was expected). But if I translate that point or coordinate system anywhere else, I get nada, or something unexpected and a bit bizarre.. I've not shown the perspective calcs because they were a hack. essentially. x = -p.vx; y = p.vz; // not a typo with vz But this does place the sprite where it should be.. Does ApplyMatrix add the translation terms as well? I wrote my own version of applymatrix to compare the results and I got the same as ApplyMatrix only if I neglected to do the translation. I also get the same result if I replace the GsGetLs with ApplyMatrix (&GsWSMATRIX, &v, &p); I guess as an alternative to this I would have to try a bill boarding approach, although not really ideal for the application I have in mind, and quite possibly slower. Can anyone please help me out, as I don't think I could handle many more sleepless nights. Many thanks Regards Jim Mario Wynands wrote: > I have noticed in the TMD descriptions that there is a sprite primitive > available. However, some brief experimentation has not resulted in a > working sprite based TMD object, as my engine just dies (unsupported code > error) when it tries to process a TMD with a single 'sprite' in it. > RSDLink seems quite happy to make TMD objects with sprites in them though. > > Has anybody managed to get sprite based TMDs working? Are they even > supported by the Yaroze libs? > > Thanks in advance, > > Mario