Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Sep 26, 2017 11:13 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Physic tutorial?
PostPosted: Sun Nov 23, 2008 2:27 am 
Offline

Joined: Sat Nov 22, 2008 6:33 am
Posts: 68
Is there any tutorial using physic engine on raydium? I want the tutorial are showing a box fall to a land and stop.


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Sun Nov 23, 2008 11:57 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
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


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Mon Nov 24, 2008 2:31 am 
Offline

Joined: Sat Nov 22, 2008 6:33 am
Posts: 68
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.


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Mon Nov 24, 2008 4:41 am 
Offline

Joined: Thu Oct 09, 2008 5:49 pm
Posts: 69
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.


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Mon Nov 24, 2008 8:39 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
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


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Tue Nov 25, 2008 1:22 am 
Offline

Joined: Sat Nov 22, 2008 6:33 am
Posts: 68
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.


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Tue Nov 25, 2008 11:42 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
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.


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Tue Nov 25, 2008 11:33 pm 
Offline

Joined: Sat Nov 22, 2008 6:33 am
Posts: 68
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.


Top
 Profile  
 
 Post subject: Re: Physic tutorial?
PostPosted: Wed Nov 26, 2008 10:26 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group