[ODE] Problem's when profiling graphics engine

Andreas Fredriksson deplinenoise at gmail.com
Tue Dec 12 01:44:40 MST 2006


On 12/12/06, Kyle Hubert <khubert at gmail.com> wrote:
> I'm profiling my application and got interesting results. This is my
> worst funtion and eating 40% of my time:
>
> /* Convert ODE's rotation matrix and pos into a GL matrix */
> void convert_ode_to_gl(float *m, const float *p, const float *r) {
>   m[0] = r[0]; m[4] = r[1]; m[8]  = r[2];  m[12] = p[0];
>   m[1] = r[4]; m[5] = r[5]; m[9]  = r[6];  m[13] = p[1];
>   m[2] = r[8]; m[6] = r[9]; m[10] = r[10]; m[14] = p[2];
>   m[3] = 0;    m[7] = 0;    m[11] = 0;     m[15] = 1;
> }
>

Looks like you're transposing ODE's matrices to change handedness
before uploading them to OpenGL? If so, I would recommend you look in
the the OpenGL extension (standard in 1.5 IIRC) that lets you upload
transposed matrices instead. Many GL drivers can do clever things with
that anyway so you don't have to :-)

http://oss.sgi.com/projects/ogl-sample/registry/ARB/transpose_matrix.txt

HTH, Andreas

-- 
My other car is a cons.


More information about the ODE mailing list