Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Darco Newsgroups: scee.yaroze.freetalk.english Subject: Re: Primitive Naming Standard Date: Tue, 13 Oct 1998 17:12:52 -0400 Organization: SCEA News Server Lines: 87 Message-ID: <3623C254.9FA88473@datasys.net> References: <36228F2E.FF6F9041@datasys.net> <36234833.5957@manc.u-net.com> Reply-To: darco@bigfoot.com NNTP-Posting-Host: 301.dialup.datasys.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; U) James Shaughnessy wrote: > > Darco wrote: > > Is there a standard naming convention? If not, should we make one? > > A damn good question I reckon. Some form of standardisation, at > least between us Yarozers can only be a good thing. > What annoys me is the way people deliberately alter names of variables > and functions to avoid accusations of plagiarism, when all they're > doing is confusing themselves and everyone else who reads their code. > It's program structure and function content that is the copyright > of the author, not the object labels, so forming a convention for > TMD primitives should help our Yaroze cause no end, IMHO. > ? I haven't noticed this... > > > G3 - Gouraud Shaded Tri w/ Flat Pigment > > N3 - Non-Shaded Tri w/ Flat Pigment > > G4 - Gouraud Shaded Quad w/ Flat Pigment > > N4GT - Non-Shaded Quad w/ Gradient & Texture > > I am yet to get into dynamic TMDs so when I do I will go with > whatever we all agree on is an ideal standard. > So forgive me for asking a stupid question, but how can a > *gouraud shaded* triangle (G3 above) also have flat pigment? > Isn't that a contradiction? Or in N4GT, how can a *non-shaded* quad > have a gradient, when non-shaded means no normals will be calculated? > And I thought gradient meant the *same thing* as gouraud shaded? > I'll put money on this being a stupid question and I'm having > some form of mental block, but I /thought/ I understood all this! > Ahh... Ok, Here, I'll disect my primitive code: The first letter is describes the lighting system. F is a flat shaded light sourcing... The entire polygon is shaded depending on the alignment with the light source. G is a goraud shaded light sourcing... Instead of the whole polygon being shaded due to lights, each vertex is shaded. N means that the polygon is oblivious to any light source. The second character refers to the number of vertices....bleh... The third and possibly fourth character describe different characteristics of the polygon. For both Flat (f) and Goraud shaded (g) polyogns, you can have a flat pigment (no character), gradient pigment(g), or a texture (t). A gradient pigment is where YOU specify the colors at each vertex. This has NOTHING to to with lighting or normals. It just specifies the color of the polygon. So yes, you can have a goraud shaded gradient polygon. In fact, that'd make for an interesting looking sphere... Hmmm... If you aren't doing any light sourcing, you can use the N3GT or the N4GT primitives, which do texture mapping AND gradient pigments. But you can only do this on a non-shaded polygon. To add a G3T poly in my Dynamic TMD routines, I just use insert_G3T(); It's return value is a pointer to the primitive in memory... So you have something like this: focus_primitive = insert_G3T(); ... And then just have "focus_primitive" be a G3T* structure... You can probably see how this goes. Bleh. 'Darco