Path: chuka.playstation.co.uk!chuka.playstation.co.uk!chuka.playstation.co.uk!not-for-mail From: Lewis_Evans@Playstation.sony.com Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: 3D Sprite TMDs? Date: 13 Feb 1998 20:39:46 -0000 Organization: Sony Computer Entertainment Europe - 119.SS5 Lines: 95 Sender: news@chuka.playstation.co.uk Message-ID: <6c2b2i$9po1@emeka.playstation.co.uk> Reply-To: Lewis_Evans@Playstation.sony.com NNTP-Posting-Host: emeka.playstation.co.uk From: Lewis_Evans@Playstation.sony.com To: news@playstation.co.uk Hi Jim, There's a SCEE demo called '3dsprites' in which I tried to sort it out. Didn't use TMDs at all, used GsSPRITES and coordinate conversion with perspective. It does work though. Also, in many of the demos you'll find a function in main.c called SortSpriteObjectPosition; this is doing much the same business. Lewis To: Lewis Evans cc: From: news @ playstation.co.uk Subject: Re: 3D Sprite TMDs?:scee.yaroze.programming.3d_graphics From: Jim Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: 3D Sprite TMDs? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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