Original Post
I was just thinking about how you would structure a 3D game engine and I ran into sum problems.
(1) I’d store animations as a bunch of nested “frames”. Each frame would have a matrix (for each Key frame of the animation) and hold a mesh and/or more frames. So 1 way would be to have only 1 copy of each mesh in the model in memory and render the model 1 mesh at a time (setting (the mesh’s matrix*the model’s matrix) as the World Matrix). But suppose the model has 500 vertexes and fore animation it has 10 frames. That averages only 50 vertexes per model.
So it would take 10 calls render calls per model. Or rather then transforming the animation real time I could build (from the file) a mesh for each frame of the animation render the it in 1 call.
(2)
Collision detection: The way DerictX transforms(with the World Martrix) you
never have a copy of the model in world space to do collision detection on.
So I have to manually transform the models I want to test. I was reading that
instead of transforming both models you can transform one model by it’s matrix *
the inverse of the other model’s matrix. With two models that’s fine but what if
I hade 100 models to test? If I did it that way then I would have transform one
model per test. That’s 100*99 transforms! (I know that bonding spheres and an
axis sort would take out most of the tests) but I think the problem still stands. The
other way would be to transform all 100 objects before you start testing. But the
problem there is that takes a lot of memory to hold all the object (you’d have to
hold a copy of every collision object in the game).
So what I was wondering is how you all structure this stuff.
Abob