Using OpenGL just for transformations

Would it be advantages to use OpenGL for matrix transformations and other mathmatical transforms instead of my own C functions for the same? Or would calling gluProject a whole mess of times (> 1000) be just too much overhead?
I know (At least on my mac) OpenGl takes advantage of Altivec (And probably other vector processing units on other chips), so I’d imagine I could get a performance boast from OpenGL’s optimizations. But I don’t know… What do you think?

Hi !

gluProject is pretty slow so I don’t think you would have much use for it.

Mikael

Don’t use OpenGL as a math library. Even though OpenGL might use optimized code, it’s not just the actual calculation that takes time. You must send the vectors/matrices to OpenGL, OpenGL must calculate the result, and then give it back to you. This last step is what usually takes time. Over all, this is (very) slow.

If the driver can use special instructions, there is (or atleast should be) no reason you can’t.

This has been stressed many times before on the board. You should not use OpenGL as a math library. Your own math routines should be much faster. If you want to take advantage of Altivec you should learn to take advantage of it yourself, or find a math library that does (I’d think such a library exists and is likely available from the chip maker).

<edit>
I have since looked and discovered that Motorola does not actively support Altivec by providing a math library, but they do provide a link to an Altivec web ring. Surely some Altivec tools are available within that ring.

[This message has been edited by DFrey (edited 08-16-2001).]