[ODE] Can't seem to make a simple plane - please help.

Denny Bromley denny at ingeeni.com
Thu Aug 28 14:18:02 2003


This is a multi-part message in MIME format.

------=_NextPart_000_0018_01C36D88.78BD5640
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks for the help!

Unfortunately, it's still acting exactly the same way.
When I make a plane like this
id =3D CreatePlane(kFieldLength/2,0,0,1,0,0);

and let my sphere go, it flies off to the right. (We're right-handed, +y =
straight up.)

It acts the same way when I add a plane:

id =3D CreatePlane(-kFieldLength/2,0,0,1,0,0);

So, it looks like it's flying in the direction of the plane normal.

A plane defined as=20

id =3D CreatePlane(0,kFieldHeight,0,0,1,0);

Makes the ball fly straight up.

It behaves well with the ground plane defined as=20

id =3D CreatePlane(0,0,0,0,1,0);



Any advice?

Thanks!

-denny-



  ----- Original Message -----=20
  From: DjArcas=20
  To: Denny Bromley ; ode@q12.org=20
  Sent: Thursday, August 28, 2003 11:20 AM
  Subject: Re: [ODE] Can't seem to make a simple plane - please help.


  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_0018_01C36D88.78BD5640
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.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks for the help!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Unfortunately, it's still acting =
exactly the same=20
way.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When I make a plane like =
this</FONT></DIV>
<DIV><FONT size=3D2>
<P>id =3D CreatePlane(kFieldLength/2,0,0,1,0,0);</P>
<P><FONT face=3DArial>and let my sphere go, it flies off to the right. =
(We're=20
right-handed, +y straight up.)</FONT></P>
<P><FONT face=3DArial>It acts the same way when I add a =
plane:</FONT></P><FONT=20
size=3D2>
<P>id =3D CreatePlane(-kFieldLength/2,0,0,1,0,0);</P></FONT>
<P><FONT face=3DArial>So, it looks like it's flying in the direction of =
the plane=20
normal.</FONT></P>
<P><FONT face=3DArial>A plane defined as </FONT></P><FONT size=3D2><FONT =
size=3D2>
<P>id =3D CreatePlane(0,kFieldHeight,0,0,1,0);</P>
<P><FONT face=3DArial>Makes the ball fly straight =
up.</FONT></FONT></FONT></P>
<P><FONT face=3DArial>It behaves well with the ground plane defined as=20
</FONT></P><FONT size=3D2>
<P>id =3D CreatePlane(0,0,0,0,1,0);</P>
<P>&nbsp;</P>
<P><FONT face=3DArial>Any advice?</FONT></P>
<P><FONT face=3DArial>Thanks!</FONT></P>
<P><FONT face=3DArial>-denny-</FONT></P>
<P>&nbsp;</P></FONT></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=3Ddjarcas@hotmail.com =
href=3D"mailto:djarcas@hotmail.com">DjArcas</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Ddenny@ingeeni.com=20
  href=3D"mailto:denny@ingeeni.com">Denny Bromley</A> ; <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 =
11:20=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [ODE] Can't seem =
to make a=20
  simple plane - please help.</DIV>
  <DIV><BR></DIV>
  <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(&amp;<FONT =
color=3D#7d9ec0>lNormal</FONT>,&amp;<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(&amp;<FONT=20
  color=3D#7d9ec0>lNormal</FONT>,&amp;<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>&nbsp;</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=20
    balls around in, but it wasn't working so I tried</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>altering an example file.&nbsp; 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=20
    the 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>&nbsp;</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>&nbsp;</P>
    <P><FONT face=3DArial>Should this not make four walls, each 100 =
units away=20
    from the origin?</FONT></P>
    <P><FONT face=3DArial>Somehow, I'm defining them incorrectly - =
please help,=20
    even if it seems trivial.</FONT></P>
    <P><FONT face=3DArial>I can't seem to make it work.&nbsp; What is =
the correct=20
    way to define a plane?</FONT></P>
    <P><FONT face=3DArial></FONT>&nbsp;</P>
    <P><FONT face=3DArial>Thanks!</FONT></P>
    <P><FONT face=3DArial>-Denny-</FONT></P>
    <P><FONT face=3DArial></FONT>&nbsp;</P>
    <P><FONT face=3DArial>p.s. I think I solved my dissapearing sphere =
problem=20
    from yesterday.&nbsp; I took the source files and rebuilt itfrom =
within my=20
    vc++ project and</FONT></P>
    <P><FONT face=3DArial>it workds great.&nbsp; I think it was =
incompatible (or=20
    at least different) c runtime libraries.</FONT></P>
    <P><FONT face=3DArial>-d-</FONT></P>
    <P><FONT=20
face=3DArial></FONT>&nbsp;</P></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BO=
DY></HTML>

------=_NextPart_000_0018_01C36D88.78BD5640--