[ODE] ode to directx coordinates and orientation

Ivan Bolcina ivan.bolcina at volja.net
Mon Oct 21 12:15:02 2002


This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C27946.B83F8F40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi.
Sorry cant speak Russian. I am from Slovenia, so we have slavic language =
in common.
I have this problem. Mapping 3-d coordinats from ode to directx. It is =
not one to one. I have come to conclusion that positions, velocities are =
mapped one to one, but orientation is like this function:

//from ode to directx
D3DXVECTOR3 convertVector(const dReal *in)
{
D3DXVECTOR3 out;
out.x=3Din[0];
out.y=3Din[1];
out.z=3Din[2];
return out;
}

//from ode to directx

D3DXQUATERNION convertQuaternion(const dReal *in)
{
D3DXQUATERNION out;
out.x=3D(float)in[0];
out.y=3D(float)in[1];
out.z=3D(float)in[2];
out.w=3D-(float)in[3];
return out;
}


So ODE is doing steps on objects and then I need to display it with =
directx in corrent position and orientation. Position seem to be ok, but =
orientation.....

btw, I see you are professional game developer. How does it feel like?

Lep pozdrav in dobro se imej tam v mrzli Rusiji. :-)


------=_NextPart_000_000B_01C27946.B83F8F40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Sorry cant speak Russian. I am from =
Slovenia, so we=20
have slavic language in common.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have this problem. Mapping 3-d =
coordinats from=20
ode to directx. It is not one to one. I have come to conclusion that =
positions,=20
velocities are mapped one to one, but orientation is like this=20
function:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//from ode to directx</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>
<P>D3DXVECTOR3 convertVector(</FONT><FONT color=3D#0000ff =
size=3D2>const</FONT><FONT=20
size=3D2> dReal *in)<BR></FONT><FONT size=3D2>{<BR></FONT><FONT =
size=3D2>D3DXVECTOR3=20
out;<BR>out.x=3Din[0];<BR>out.y=3Din[1];<BR>out.z=3Din[2];<BR></FONT><FON=
T=20
color=3D#0000ff size=3D2>return</FONT><FONT size=3D2> =
out;<BR>}</FONT></P>
<P><FONT size=3D2>//from ode to directx</P>
<P>D3DXQUATERNION convertQuaternion(</FONT><FONT color=3D#0000ff=20
size=3D2>const</FONT><FONT size=3D2> dReal *in)<BR>{<BR>D3DXQUATERNION=20
out;<BR>out.x=3D(</FONT><FONT color=3D#0000ff size=3D2>float</FONT><FONT =

size=3D2>)in[0];<BR>out.y=3D(</FONT><FONT color=3D#0000ff =
size=3D2>float</FONT><FONT=20
size=3D2>)in[1];<BR>out.z=3D(</FONT><FONT color=3D#0000ff =
size=3D2>float</FONT><FONT=20
size=3D2>)in[2];<BR>out.w=3D-(</FONT><FONT color=3D#0000ff =
size=3D2>float</FONT><FONT=20
size=3D2>)in[3];<BR></FONT><FONT color=3D#0000ff =
size=3D2>return</FONT><FONT size=3D2>=20
out;<BR>}</P></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>So ODE is doing steps on objects and =
then I need to=20
display it with directx in corrent position and orientation. Position =
seem to be=20
ok, but orientation.....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>btw, I see you are professional game =
developer. How=20
does it feel like?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Lep pozdrav&nbsp;in dobro se imej tam v =
mrzli=20
Rusiji. :-)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_000B_01C27946.B83F8F40--