6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Physics for level
#244072
01/02/09 13:40
01/02/09 13:40
|
Joined: Nov 2008
Posts: 354 saeculum II
MPQ
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2008
Posts: 354
saeculum II
|
Hello, At the moment I try to look through the Physic-Engine of 3DGS. If I include eg. gravity power I cant move my model any more. Does anybody know a tutorial how to use the Engine? Here my test-script (whats wrong? I cant move on key_i/key_l): function main() { level_load ("Physik.wmb"); wait(2); ph_setgravity (vector (0, 0, -386));//9.81m/s^2 camera.x = - 50; }
action model() { phent_settype (my, PH_RIGID, PH_BOX); phent_setmass (my, 3, PH_BOX); while(1) { if (key_i) my.x += 6 *time_step; if (key_l) my.x += -6 *time_step; wait(1); } }
new project in early stage...
Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
|
|
|
Re: Physics for level
[Re: MPQ]
#244073
01/02/09 13:44
01/02/09 13:44
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
you have to move your object using phent_ functions if you use the physics engine on that object.
Last edited by Quadraxas; 01/02/09 13:44. Reason: typo
3333333333
|
|
|
Re: Physics for level
[Re: Quad]
#244133
01/02/09 21:45
01/02/09 21:45
|
Joined: Nov 2008
Posts: 354 saeculum II
MPQ
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2008
Posts: 354
saeculum II
|
Ok now ive decided to use c_move, but the prob is that my model only move one step (1000*time_step) when I add the "settype" and then it stops in spite of the while-loop. Whats wrong? #include <acknex.h> #include <default.c> //////////////////////////// var speed1;
function main() { level_load ("Physik.wmb"); wait(2); ph_setgravity (vector (0, 0, -386)); camera.x = 50; }
action model() { phent_settype (my, PH_RIGID, PH_BOX);
while(1) { if (key_i) speed1 = 10 * time_step; c_move (my, nullvector, vector(0, speed1, 0), NULL); wait(1); } }
new project in early stage...
Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
|
|
|
Re: Physics for level
[Re: Spirit]
#244141
01/02/09 22:34
01/02/09 22:34
|
Joined: Nov 2008
Posts: 354 saeculum II
MPQ
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2008
Posts: 354
saeculum II
|
sorry, I thought c_move would work with the physic-engine?! I have tried the phent_function but I didn´t get how those work And why dont you read the physics tutorial before you start to script? oh yes. I have done it but the information you get from it is really a bit too little. Do you know some tut?
new project in early stage...
Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
|
|
|
Re: Physics for level
[Re: Spirit]
#244318
01/04/09 00:47
01/04/09 00:47
|
Joined: Oct 2008
Posts: 67
pewpew
Junior Member
|
Junior Member
Joined: Oct 2008
Posts: 67
|
duuuude im having the EXACT same problem!!! nobody told me that you cant use 'c_move' when you apply physics to something lol. ive been trying to drive a tank around a map for 2 months.
ok, so you CANT use c_move?
when i go into the physics section in the help menu, you click on "phent_" and it says- "Here is a list of phent_ commands..." and thats it. a blank page lol.
HURRR DERP DERP DEERRPP HURR
|
|
|
Re: Physics for level
[Re: pewpew]
#244374
01/04/09 11:05
01/04/09 11:05
|
Joined: Nov 2008
Posts: 354 saeculum II
MPQ
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2008
Posts: 354
saeculum II
|
ok you cant use c_move At the moment I try with phent_fuction like phent_centralforce and it works so far. The following is my test script for a movement with physics: #include <acknex.h> #include <default.c> //////////////////////////// VECTOR speed1;
function main() { level_load ("Physik.wmb"); wait(2); ph_setgravity (vector (0, 0, -386)); camera.x = 50; }
action model() { phent_settype (my, PH_RIGID, PH_BOX); phent_setdamping (my, 80, 80); while(1) { //speed up!// if (key_i && (speed1.x < 50 && (speed1.x >= 0)))//speed up forwards, if speed1 is 0 or higher speed1.x += 0.02; if (key_k && (speed1.x > -10 && (speed1.x <= 0)))//speed up backward, if speed1 is lower than 0 speed1.x -= 0.02; //break!// if (key_i && (speed1.x < 0))//break, if speed1 is lower 0 speed1.x += 0.04; if (key_k && (speed1.x > 0))//break, if speed1 is higher than 0 speed1.x -= 0.04; if (!key_i && !key_k) speed1.x = 0; phent_addcentralforce (my, speed1); //phcon_setmotor//ph_setautodisable//ph_autodisable//ii wait(1); } }
new project in early stage...
Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|