What's Necessary?

Started by
5 comments, last by GavRobbs 15 years, 11 months ago
Well, I've more or less fought my way through learning the basics of 3d graphics, and I have written a math library, but I don't think its complete. Therefore, I've posted to ask, what classes do you think a math library should have, and what classes do you think a physics library should have? I haven't started seriously learning physics, but I know enough math. My math library has the following classes, with full support for most common operations: 2D and 3D Vectors Quaternions 3x3 and 4x4 Matrix(inverses using determinant method) Lines Planes So, what else do you think I need. This probably isn't going to be used for a full-fledged game, but rather, to mess around with some techdemo stuff with openGL. Thanks in advance.
Advertisement
It rather depends on what you are trying to accomplish. A math lib for games is pretty vague. The only thing your list looks like it is missing from a general list of things that might be useful to someone somewhere is triangles, general meshes, the various trees(bsp, quad, oct) and collision detection (hit detection routines and the data structures that often go with that like AABBs).
Crap...forgot triangles. But wouldn't collision detection fall under the physics engine. And as for the trees, wouldn't those have to do with scenegraphs?
Quote:Original post by GavRobbs
But wouldn't collision detection fall under the physics engine.

I would provide intersection routines in the Math library. You will probably need them for more than Physics. Of the top of my head:
* Picking (if the user clicks on an item, how do you figure out which item that is?)
* View frustum culling.
I see. Okay then, so that means that I have to add the following classes to the math library:

Boxes
Spheres
Triangles

and ray/intersection support for all three of those primitive types. Is that about right?
I would recommend writing little projects, and adding to the library as you go.. rather than trying to predict future requirements. plus, you never really know exactly what you are going to need until you need it.
Ok, thanks for the advice everyone. I'll do as ibebrett says.

This topic is closed to new replies.

Advertisement