[ODE] Can't seem to make a simple plane - please help.
DjArcas
djarcas at hotmail.com
Thu Aug 28 08:15:02 2003
This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C36D80.43BFF180
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
void CreatePlane(float lXp, float lYp, float lZp, float lXn, float lYn, =
float lZn)
{
VECTOR3 lPos;
VECTOR3 lNormal;
lPos.x =3D lXp;
lPos.y =3D lYp;
lPos.z =3D lZp;
lNormal.x =3D lXn;
lNormal.y =3D lYn;
lNormal.z =3D lZn;
//Work out 'd'
//first, normalise the normal
D3DXVec3Normalize(&lNormal,&lNormal);
//now get the doc product
float d;
d =3D D3DXVec3Dot(&lNormal,&lPos);
mGeomID =3D dCreatePlane(gPhysicsManager.mSpaceID,lNormal.x, lNormal.y, =
lNormal.z, d);
}
Hope that's some helped, it certainly confused the hell out of me =
originally!
----- Original Message -----=20
From: Denny Bromley=20
To: ode@q12.org=20
Sent: Thursday, August 28, 2003 3:50 PM
Subject: [ODE] Can't seem to make a simple plane - please help.
I'm trying to make a box that I can bounce balls around in, but it =
wasn't working so I tried
altering an example file. I tried to add walls to test_boxstack to =
contain the objects when they fall.
But now they're slipping and sliding all over the place- they don't =
even touch the ground.
Here are the planes I added:
dCreatePlane (space,0,-1,0,100);
dCreatePlane (space,0,1,0,100);
dCreatePlane (space,1,0,0,100);
dCreatePlane (space,-1,0,0,100);
Should this not make four walls, each 100 units away from the origin?
Somehow, I'm defining them incorrectly - please help, even if it seems =
trivial.
I can't seem to make it work. What is the correct way to define a =
plane?
Thanks!
-Denny-
p.s. I think I solved my dissapearing sphere problem from yesterday. =
I took the source files and rebuilt itfrom within my vc++ project and
it workds great. I think it was incompatible (or at least different) =
c runtime libraries.
-d-
------=_NextPart_000_000A_01C36D80.43BFF180
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.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2><FONT color=3D#0000ff>
<P>void</FONT> <FONT color=3D#880000>CreatePlane</FONT>(<FONT=20
color=3D#0000ff>float</FONT> <FONT color=3D#7d9ec0>lXp</FONT>, <FONT=20
color=3D#0000ff>float</FONT> <FONT color=3D#7d9ec0>lYp</FONT>, <FONT=20
color=3D#0000ff>float</FONT> <FONT color=3D#7d9ec0>lZp</FONT>, <FONT=20
color=3D#0000ff>float</FONT> <FONT color=3D#7d9ec0>lXn</FONT>, <FONT=20
color=3D#0000ff>float</FONT> <FONT color=3D#7d9ec0>lYn</FONT>, <FONT=20
color=3D#0000ff>float</FONT> <FONT color=3D#7d9ec0>lZn</FONT>)</P>
<P>{</P>
<P>VECTOR3 <FONT color=3D#7d9ec0>lPos</FONT>;</P>
<P>VECTOR3 <FONT color=3D#7d9ec0>lNormal</FONT>;</P>
<P><FONT color=3D#7d9ec0>lPos</FONT>.<FONT color=3D#7d9ec0>x</FONT> =3D =
<FONT=20
color=3D#7d9ec0>lXp</FONT>;</P>
<P><FONT color=3D#7d9ec0>lPos</FONT>.<FONT color=3D#7d9ec0>y</FONT> =3D =
<FONT=20
color=3D#7d9ec0>lYp</FONT>;</P>
<P><FONT color=3D#7d9ec0>lPos</FONT>.<FONT color=3D#7d9ec0>z</FONT> =3D =
<FONT=20
color=3D#7d9ec0>lZp</FONT>;</P>
<P><FONT color=3D#7d9ec0>lNormal</FONT>.<FONT color=3D#7d9ec0>x</FONT> =
=3D <FONT=20
color=3D#7d9ec0>lXn</FONT>;</P>
<P><FONT color=3D#7d9ec0>lNormal</FONT>.<FONT color=3D#7d9ec0>y</FONT> =
=3D <FONT=20
color=3D#7d9ec0>lYn</FONT>;</P>
<P><FONT color=3D#7d9ec0>lNormal</FONT>.<FONT color=3D#7d9ec0>z</FONT> =
=3D <FONT=20
color=3D#7d9ec0>lZn</FONT>;</P>
<P>//Work out 'd'</P>
<P>//first, normalise the normal</P>
<P>D3DXVec3Normalize(&<FONT =
color=3D#7d9ec0>lNormal</FONT>,&<FONT=20
color=3D#7d9ec0>lNormal</FONT>);</P>
<P>//now get the doc product</P>
<P><FONT color=3D#0000ff>float</FONT> <FONT =
color=3D#7d9ec0>d</FONT>;</P>
<P><FONT color=3D#7d9ec0>d</FONT> =3D D3DXVec3Dot(&<FONT=20
color=3D#7d9ec0>lNormal</FONT>,&<FONT =
color=3D#7d9ec0>lPos</FONT>);</P>
<P><FONT color=3D#7d9ec0>mGeomID</FONT> =3D dCreatePlane(<FONT=20
color=3D#7d9ec0>gPhysicsManager</FONT>.<FONT =
color=3D#7d9ec0>mSpaceID</FONT>,<FONT=20
color=3D#7d9ec0>lNormal</FONT>.<FONT color=3D#7d9ec0>x</FONT>, <FONT=20
color=3D#7d9ec0>lNormal</FONT>.<FONT color=3D#7d9ec0>y</FONT>, <FONT=20
color=3D#7d9ec0>lNormal</FONT>.<FONT color=3D#7d9ec0>z</FONT>, <FONT=20
color=3D#7d9ec0>d</FONT>);</P>
<P>}</P>
<P> </P>
<P>Hope that's some helped, it certainly confused the hell out of me=20
originally!</P></FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A title=3Ddenny@ingeeni.com href=3D"mailto:denny@ingeeni.com">Denny =
Bromley</A>=20
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A title=3Dode@q12.org=20
href=3D"mailto:ode@q12.org">ode@q12.org</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, August 28, 2003 =
3:50=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [ODE] Can't seem to =
make a=20
simple plane - please help.</DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DArial size=3D2>I'm trying to make a box that I can =
bounce balls=20
around in, but it wasn't working so I tried</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>altering an example file. I =
tried to add=20
walls to test_boxstack to contain the objects when they =
fall.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>But now they're slipping and sliding =
all over the=20
place- they don't even touch the ground.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Here are the planes I =
added:</FONT></DIV>
<DIV><FONT face=3DArial color=3D#000000 size=3D2>
<P> </P></FONT><FONT size=3D2>
<P>dCreatePlane (space,0,-1,0,100);</P>
<P>dCreatePlane (space,0,1,0,100);</P>
<P>dCreatePlane (space,1,0,0,100);</P>
<P>dCreatePlane (space,-1,0,0,100);</P>
<P> </P>
<P><FONT face=3DArial>Should this not make four walls, each 100 units =
away from=20
the origin?</FONT></P>
<P><FONT face=3DArial>Somehow, I'm defining them incorrectly - please =
help, even=20
if it seems trivial.</FONT></P>
<P><FONT face=3DArial>I can't seem to make it work. What is the =
correct=20
way to define a plane?</FONT></P>
<P><FONT face=3DArial></FONT> </P>
<P><FONT face=3DArial>Thanks!</FONT></P>
<P><FONT face=3DArial>-Denny-</FONT></P>
<P><FONT face=3DArial></FONT> </P>
<P><FONT face=3DArial>p.s. I think I solved my dissapearing sphere =
problem from=20
yesterday. I took the source files and rebuilt itfrom within my =
vc++=20
project and</FONT></P>
<P><FONT face=3DArial>it workds great. I think it was =
incompatible (or at=20
least different) c runtime libraries.</FONT></P>
<P><FONT face=3DArial>-d-</FONT></P>
<P><FONT =
face=3DArial></FONT> </P></FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_000A_01C36D80.43BFF180--