Sign in to follow this  
GavRobbs

What's Necessary?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this