Results 1 to 8 of 8

Thread: ODE, Basic start on Linux with Lazarus

  1. #1

    ODE, Basic start on Linux with Lazarus

    Hello everyone!

    I have problem to make simplest application using ODE on Linux.
    Do somebody have some working source code?

    If I wrote in OnFormCreate:
    [pascal]
    dMassSetBox (SomeMass,1,SIDE,SIDE,SIDE);
    [/pascal]
    I've got Acces Violation at rune time. Before it I creating World, and Body...

  2. #2

    ODE, Basic start on Linux with Lazarus

    Can you post some more code (i.e the form create).

    I seem to remember this problem when I started out with ODE. But I can't remember what fixed it....
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  3. #3

    ODE, Basic start on Linux with Lazarus

    [pascal]
    procedure TForm1.FormCreate(Sender: TObject);
    var
    _m: TdMass;
    begin
    BackBuff := TBitmap.Create;
    with BackBuff do
    begin
    Width := BackBuf_W;
    Height := BackBuf_H;
    Canvas.Pen.Width := 2;
    Canvas.Pen.Color := clYellow;
    Canvas.Brush.Color := clBlack;
    end;

    World := dWorldCreate();
    Space := dHashSpaceCreate(nil);
    ContactGroup := dJointGroupCreate (0);
    dWorldSetGravity (World,0,9.81,0);

    Body1 := dBodyCreate (World);
    dBodySetPosition (Body1,0.2,1,0);
    dMassSetBox (_m,1,SIDE,SIDE,SIDE); // Acces Violation
    dMassAdjust (_m,1); // Acces Violation

    dBodySetMass (Body1,@_m);

    Timer.Enabled := True;
    end;
    [/pascal]

  4. #4

    ODE, Basic start on Linux with Lazarus

    Can't see anything wrong with the code.

    Do you have the correct version of ODE compiled and installed?
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  5. #5

    ODE, Basic start on Linux with Lazarus

    You are great!

    I had 5.5-5 ODE version from Ubuntu repository. I've removed it and installed newest 0.8 and now it pretty works.

    Thanks a lot.

  6. #6

    ODE, Basic start on Linux with Lazarus

    Another basic problem.

    [pascal]Body2 := dBodyCreate (World);
    dBodySetPosition (Body2,1,2,0);
    dMassSetBox (_m2,1,SIDE,SIDE,SIDE);
    dMassAdjust (_m2,0.2);
    dBodySetMass(Body2, @_m2);

    Joint1 := dJointCreateBall (World, 0);
    dJointSetBallAnchor (Joint1, 1, 2, 0);
    dJointAttach (Joint1, Body2, nil); [/pascal]

    Joint1 should make Body2 unmovable in point x=1, y=2, z=0 but this body fly to the point 0,0,0. Function dJointSetBallAnchor isn't for this?

  7. #7

    ODE, Basic start on Linux with Lazarus

    I'm not totally sure how to use Joints, so I can't help there I'm afraid (I avoided joints totally when I was using ODE)

    Anyone else got any ideas?
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  8. #8

    ODE, Basic start on Linux with Lazarus

    I have an idea
    First I have to write dJointAttach, and after attaching dJointSetBallAnchor. It is not clear to me why but it works in this order.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •