[ODE] 2d Rotation/tranformation
Ed Jones
ed.jones at oracle.com
Mon Dec 1 11:09:38 MST 2003
Howdy,
I reckon the best way to use ODE in 2D is to utilise Peter Serocka's
fabulous Plane2D joint, which you can find here;
http://www.mathematik.uni-bielefeld.de/~pserocka/ODE-Plane2D/
If you rummage about in the mailing list archives for posts with "2D" in
the title then you'll find that there have been a few discussions of
this in the past.
There is a way to get Google to search the archives for you, but I can
never remember how to do that!
<offtopic>
Just out of interest; Which sprite engine are you using? I've looked at
Kyra and ZEngine in the past, but neither seemed to do exactly what I
wanted. Or have you rolled your own?
</offtopic>
Cheers,
Ed.
garry wrote:
> Hi,
>
> This is my first day using ODE, and the learning curve is a bit
> steep.. So here's my questions.
>
> I'm going to be using it in a 2d game, ideally to have boxes and stuff
> to shoot about. This means that I have no use for the 3rd dimension,
> therefore - would this be acceptable to do?
>
> const dReal *dr =dBodyGetPosition(objbody[i]);
> dBodySetPosition (objbody[i], dr[0],1,dr[2]);
>
> Which would 'stick' the boxes to that one plane? Would that work?
>
>
> Also, I do this
>
> const dReal *R2 = dBodyGetRotation (objbody[i]);
>
> then
>
> gfx.SpriteDrawEx(texture, dr[0], dr[2], R2[0],.....
>
> The X and Y seem to work properlu (dr[0], dr[2]) But the rotation
> (R2[0])seems a bit dodgy. Is the rotation from dBodyGetRotation in
> radians?
>
> Final question, related to the last one. I need to restrict the
> rotation of the objects to one dimension, what would be the best way
> of doing that? I was looking at something like this:-
>
> dRFromAxisAndAngle (r,1,0,0,angle);
>
> But the radians problem creeps in, I can't determine whether the ange
> is in radians or if i'm rotating along the wrong axis..
>
> Any help is really appreciated..
>
> garry.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>
More information about the ODE
mailing list