Raydium 3D Game Engine
http://memak.raydium.org/

Physic tutorial?
http://memak.raydium.org/viewtopic.php?f=8&t=911
Page 1 of 1

Author:  Farabi [ Sun Nov 23, 2008 2:27 am ]
Post subject:  Physic tutorial?

Is there any tutorial using physic engine on raydium? I want the tutorial are showing a box fall to a land and stop.

Author:  ouille [ Sun Nov 23, 2008 11:57 am ]
Post subject:  Re: Physic tutorial?

Hello,

you can use skel.c file and add this:

Code:
if (raydium_key_last==1000+' '){
    int a;
    char name[RAYDIUM_MAX_NAME_LEN];

    a=raydium_ode_object_find("GLOBAL");
    raydium_ode_name_auto("box",name);
    raydium_ode_object_box_add(name,a,0.1,RAYDIUM_ODE_AUTODETECT,0,0,RAYDIUM_ODE_STANDARD,0,"crate.tri");
    raydium_ode_element_move_name_3f(name,raydium_random_neg_pos_1(),raydium_random_neg_pos_1(),2);
}


Line 21 in display() just after escape test and exit(0).

Have a nice day.
Ouille

Author:  Farabi [ Mon Nov 24, 2008 2:31 am ]
Post subject:  Re: Physic tutorial?

Hi, sorry for the newbie question, can you tell me how to set the include folder on codeblock? I got this error when compiling the skel.c.

Quote:
D:\ProgrammersTool\raydium_win32_sdk_748\raydium\raydium\common.h|67|GL/glew.h: No such file or directory|


After a few hours googling and found nothing, I think I need a step by step instruction on how to set up the code blocks and an instruction on how to compile.
Sorry for the trouble, this is my first time using code blocks.

Author:  powerpup118 [ Mon Nov 24, 2008 4:41 am ]
Post subject:  Re: Physic tutorial?

Farabi wrote:
Hi, sorry for the newbie question, can you tell me how to set the include folder on codeblock? I got this error when compiling the skel.c.

Quote:
D:\ProgrammersTool\raydium_win32_sdk_748\raydium\raydium\common.h|67|GL/glew.h: No such file or directory|


After a few hours googling and found nothing, I think I need a step by step instruction on how to set up the code blocks and an instruction on how to compile.
Sorry for the trouble, this is my first time using code blocks.


Hello, after adding your code to skel.c in Code Blocks:

Code:
if (raydium_key_last==1000+' '){
    int a;
    char name[RAYDIUM_MAX_NAME_LEN];

    a=raydium_ode_object_find("GLOBAL");
    raydium_ode_name_auto("box",name);
    raydium_ode_object_box_add(name,a,0.1,RAYDIUM_ODE_AUTODETECT,0,0,RAYDIUM_ODE_STANDARD,0,"crate.tri");
    raydium_ode_element_move_name_3f(name,raydium_random_neg_pos_1(),raydium_random_neg_pos_1(),2);
}


You can run compile_all.bat, which is found in the windows SDK directory. (D:\ProgrammersTool\raydium_win32_sdk_748\ for you.)
That will compile everything in SDK raydium directory.

Have a nice day.

Author:  ouille [ Mon Nov 24, 2008 8:39 am ]
Post subject:  Re: Physic tutorial?

Hello,

Farabi using the great win32 sdk :D you normaly don't have nothing to change.

Open workspace in tests directory.
  • First step: Add skel.c to raydium_application project.
  • Second Step: Remove other .c file

Click build or build and run.

If you still have problem:
Validate this in codeblocks:
settings->compiler and debugger ->Others settigns (Tab)
Compiler logging -> Full command line.

And the post here Build log content.

Have a nice day.
Ouille

Author:  Farabi [ Tue Nov 25, 2008 1:22 am ]
Post subject:  Re: Physic tutorial?

I still dont know how to make it working, but my translated MASM version code is work(Should I upload the code?). Its pretty cool example of physic engine, raydium rules.

Ahem, and now is another question, sorry :mrgreen:
1. It fall by decreasing the Z value, why not by Y value? Doesnot the height is the Y value? Or I making a mistake?
2. How to scale the ground object? And if I rescale it will the physic engine know it?

Thank you for your patiences.

Author:  ouille [ Tue Nov 25, 2008 11:42 am ]
Post subject:  Re: Physic tutorial?

Hello,

Masm ouch !!! You love when it's hard :D
Take five minutes to test with code blocks it's simplier ;)

Raydium and thus ode gravity is along Z axis. So objects fall on this axis.

You can change gravity using raydium_ode_gravity_3f(gx,gy,gz)

raydium_ode_gravity_3f(0,-10,0)
will put gravity along y axis.

About rescaling ground object:
Raydium don't propose rescale function. You need to import .tri with blender, resize in edit mode and export to .tri.

Physics will run without problem with risezed ground, just avoid too small or too big triangle.

Have a nice day.
Ouille.

Author:  Farabi [ Tue Nov 25, 2008 11:33 pm ]
Post subject:  Re: Physic tutorial?

Well, I used to MASM. 5 Years ago there is no cheap compiler on the net. And I never knew GCC. Thank God GCC and Code::Blocks is included on Raydium.

Anyway thanks, Its working.

Author:  ouille [ Wed Nov 26, 2008 10:26 am ]
Post subject:  Re: Physic tutorial?

Hello,

Gcc is free and easy to use with mingw, devc++, codeblocks for example.


Even Visual Studio is free of charge for basic version.

Everything is in the sdk just run codeblocks.bat, open tests/raydium_dll.workspace.

Build and Run (F9) that's all.

If you prefer MASM it's not a problem for me :wink:

Have a nice day.
Ouille

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/