Math API?

Just wondering why OpenGL doesn’t expose/provide an API for 3D math-related structures and operations such as vectors, matrices, scaling, normalizing, cross-products, etc.

Hi !

I guess it’s because OpenGL is a rendering API and not designed to manage geometry at any higher level, this is better done in software anyway as it would be difficult to make any geometry operations outside the rendering pipeline work in an efficient way on OpenGL hardware.

Just a guess though, I have no idea for the exact reason.

Mikael

Originally posted by mikael_aronsson:
[b]Hi !

I guess it’s because OpenGL is a rendering API and not designed to manage geometry at any higher level, this is better done in software anyway as it would be difficult to make any geometry operations outside the rendering pipeline work in an efficient way on OpenGL hardware.

Mikael[/b]

Surely though, OpenGL implementations must do this sort of math internally. And since OpenGL programs often have to do the same math, why wouldn’t OpenGL provide this API?

In any case, is there a popular API out there that provides this sort of functionality? Or do most OpenGL programmers just “roll their own”?

this has been discussed often in these forums
basically its gonna be very slow, quick to do the calculations but slow for the card to give back the results of the calculations to you

Originally posted by zed:
basically its gonna be very slow, quick to do the calculations but slow for the card to give back the results of the calculations to you

Who says the calculations have to be done in hardware by the card? Or is that some sort of stipulation or requirement of the OpenGL spec?

Most people in this forum feel and understand your concern, beginner. I think it is a matter of where the line is drawn. GL is graphics library, so it provides a set of APIs to draw stuff onto the framebuffer. Why should it concern of cross product or determinant which are not required to draw a triangle on the screen?
You may also argue DirectX should be called Direct3D instead…