Very true. Great stuff.
Then you probably also have multiple GOB1 chunks; a GOB1 is a geob,
which is an object within the geode (the entire file, so to say).
Different materials often (if not always) use a separate GOB1 chunk,
which uses its own INDI chunk (which is just part of it all; you also
will have a VERT chunk for the vertex data etc).
So:
- A model = a geode
- A geode = 1 or more geobs
- A geob = vertex/normal/texcoord/index data
It gets worse with my own DOF files, as there may be multiple bursts
in one geob, but that seems unused in 99% (if not 100%) of the DOF
files out there.
It's really no different from good solid C coding, but a bit more
elegantly put.
myObject->function(x,y) is what you would write in C as:
objFunction(myObject,x,y)
It's just better coupled, so data and code are mixed in 1 object,
instead of leaving that issue up to the code.
It's not, not the basic stuff. Forget templates for a while, forget
multiple inheritance (I once wrote a compiler, studied multiple
inheritance, then forgot about it for ever more, since it is SO
complex to implement, it can lead only to bugs).
But if you do do single inheritance, use a virtual destructor in your
base class. Remember that. :)
You're welcome.
That was what I was talking about. Basically repeating (as you did
before) means just chopping of the integer part and using the decimal
part for the coordinates. Near the edges, it will wrap, which you
don't want, but you want it to clamp instead, so 1.001 would become
1.0, instead of 0.001.
DX and OpenGL are largely the same, DX just came about 10 years later
and took 8 versions to get up to speed. :)
After knowing OpenGL, reading a D3D book will almost get you started
on OpenGL things as well, since most parameters look the same, it's
just with D3D you have to type 2x or 3x more to get the same thing
done. And don't forget that for DX9 you'll have a ball converting your
stuff to the new API. ;-)
...
#define GL_CLAMP_TO_EDGE 0x812F
I'm sure though you cannot just use this, even if it might work.
There's an extension you have to check for.
Since you created the dots yourself, why not do a triangle strip (if
you're not already doing so)? That will ensure you have correctly
shared vertex data.
It's really quite simple in fact; the basic problems are just twofold;
one is creating a shader sort key from the shader's properties, and
the other is making good use of multitexturing when possible.
Basically you have:
struct RenderData
{
float *vertexData;
float *normalData;
//etc
int sortkey;
You put everything you want to draw in a big list, quicksort on
sortkey, then render in passes. The passes are walked piece by piece,
and only flushed when a pass can't be added to the previous pass.
Works for Quake. :)
Ruud van Gaal
Free car sim : http://www.marketgraph.nl/gallery/racer/
Pencil art : http://www.marketgraph.nl/gallery/