[ODE] converting opengl matrices to ODE positions. or something!
cr88192
cr88192 at hotmail.com
Sun Sep 11 09:29:24 MST 2005
I will reply (my recent stuff has been off in xml and compiler land, so...).
----- Original Message -----
From: "Dan" <danfrith at gmail.com>
To: <ode at q12.org>
Sent: Sunday, September 11, 2005 3:34 AM
Subject: Re: [ODE] converting opengl matrices to ODE positions. or
something!
> Thanks! that works. I have done the reverse to set the ode positions
> from a matrix and that seems to work too.
>
> I have a couple more queries while i'm here.
>
> I notice that elements 3, 7, and 11 (counting from 0) of the rotation
> matrix are not used. Is this significant?
>
maybe, but it depends on how you look at it.
oftentimes applications/... will ignore some parts of the matrices (eg:
eliminating multiplies and additions that will normally have no effect).
often times, one doesn't want to do anything differently with the matrices
than the rest of the application, eg:
because some code may make assumptions about the layout or properties of the
matrix;
similarly, the application may actually use the matrix in it's entirety (I
presume opengl does this given the way it does things...).
as for the ode rotation matrices in particular, I think the extra element is
used as padding, but I am not sure on this.
> Also, if I use scaling on the gl matrices, will this method of
> conversion still work?
this one is a lot more questionable.
this depends a lot on how ode does things, and imo this seems like a bad
idea anyways.
even if it did work, there is a lot of risk for weird side effects, eg,
scaled matrix does not result in scaled solid-behavior, or the mass gets
messed up, or something...
of course, for all I know, ode could have been designed to handle this case
sensibly as well, leaving no problems.
someone knowing more about ode's internals could probably answer this
better.
> Would I have to do some scaling upon whatever the collision functions
> are? (although I haven't tried collisions yet so I might be asking the
> question wrong)
>
depends.
I would guess possible would be, eg, to renormalize the matrices upon
passing them to ode, keeping note of each axis length.
one could then probably make ajustments to the body or whatever to reflect
the current size and other stuff.
likely, some fudging would be needed for any passed or returned coordinates
(eg: depending if they are in local or global space, scale, ...).
in general, I would probably opt for some "other" means to pull off scale,
eg, if reasonable.
I might be wrong here though...
More information about the ODE
mailing list