DLink

02-01-2001, 09:57 PM

Hi all, I was wondering if you'd see improved performance out of your engine by writing some of your own transfomation functions.

Say we wanted to rotate a cube around its local z-axis. We already know that we could take each point and say that

x' = x*cos(T) - y*sin(T)

y' = x*sin(T) + y*cos(T)

z' = z

Would it be faster to directly perform these calculations on each point on the cube? (Before we call glBegin and glEnd, of course http://www.opengl.org/discussion_boards/ubb/smile.gif ) Most transformation matrices seem to be sparse, so aren't we wasting time by multiplying by and adding zero to things?

Would it be faster if you could do most of your calculations this way, and only used the matrix multiplication sparingly?

Sorry in advance if this seems like a dumb question, I really don't know how hardware accelerated Matrix multiplication works http://www.opengl.org/discussion_boards/ubb/smile.gif

-Thanks!

Say we wanted to rotate a cube around its local z-axis. We already know that we could take each point and say that

x' = x*cos(T) - y*sin(T)

y' = x*sin(T) + y*cos(T)

z' = z

Would it be faster to directly perform these calculations on each point on the cube? (Before we call glBegin and glEnd, of course http://www.opengl.org/discussion_boards/ubb/smile.gif ) Most transformation matrices seem to be sparse, so aren't we wasting time by multiplying by and adding zero to things?

Would it be faster if you could do most of your calculations this way, and only used the matrix multiplication sparingly?

Sorry in advance if this seems like a dumb question, I really don't know how hardware accelerated Matrix multiplication works http://www.opengl.org/discussion_boards/ubb/smile.gif

-Thanks!