1 registered members (AndrewAMD),
1,541
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
G-Forces
#181785
02/03/08 19:47
02/03/08 19:47
|
Joined: Aug 2006
Posts: 96 Netherlands
Polypfreak1987
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2006
Posts: 96
Netherlands
|
Hello everybody. I have 2 entities. One is rotating and one is attached to that rotating entity. The one that is attached need to spinning around his Z-axis by G-Forces. Untill now I have this code of the physics: Code:
phent_settype(my,PH_RIGID,PH_SPHERE); phent_setmass(my,100,PH_SPHERE); phent_setdamping(my,0,0); phent_setgroup(my,2); ph_setgravity(earthGravity); ph_selectgroup(2); //phent_addcentralforce(my,vector(kruis1.x,kruis1.y,kruis1.z)); phent_addvelcentral(my, vector(50,50,50));
The attached model doesn't spinning around. So how can I spin this model around by G-forces? Thanks in advance for the answer.
|
|
|
Re: G-Forces
[Re: Polypfreak1987]
#181786
02/06/08 19:47
02/06/08 19:47
|
Joined: Aug 2006
Posts: 96 Netherlands
Polypfreak1987
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2006
Posts: 96
Netherlands
|
Ok people, Now I am a very bit further. My model rotates, but very slowly and if I stop the entity where the model is attached to. The model still rotates. How can I fix this? Code:
action gondel01 { my.passable = on; phent_settype(my,PH_RIGID,PH_SPHERE); phent_setmass(my,100,PH_SPHERE); phent_setdamping(my,100,100); ph_setgravity(earthGravity); while(my) { vec_for_vertex(temp,kruis1,881); phent_addforcelocal(my,vector(0,0,kruis1.pan),vector(0,0,0)); phent_addtorquelocal(my,vector(0,0,kruis1.pan)); my.x = temp.x; my.y = temp.y; my.z = temp.z; wait(1); } }
Please help me.
|
|
|
Re: G-Forces
[Re: Polypfreak1987]
#181787
02/09/08 11:29
02/09/08 11:29
|
Joined: Aug 2006
Posts: 96 Netherlands
Polypfreak1987
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2006
Posts: 96
Netherlands
|
Bit by bit I came further. My model rotates quite good now. But don't stop. How can I stop it? Code:
action gondel01 { my.passable = on; //Physics on phent_settype(my,PH_RIGID,PH_BOX); //Set a weight phent_setmass(my,23,PH_BOX); //Set a friction phent_setfriction(my,25); //Set an elasticity phent_setelasticity(my,50,5); //Set a damping phent_setdamping(my,50,90); //Set a gravity ph_setgravity(earthGravity); while(my) { vec_for_vertex(temp,kruis1,881); phent_addtorquelocal(my,vector(0,0,kruis1.pan)); my.x = temp.x; my.y = temp.y; my.z = temp.z; wait(1); } phent_addforcelocal(my,vector(kruis1.pan,0,0),nullvector); }
As you can see I work with physics. So I hope you can help me out of it.
|
|
|
Re: G-Forces
[Re: Polypfreak1987]
#181788
02/09/08 19:28
02/09/08 19:28
|
Joined: Aug 2006
Posts: 96 Netherlands
Polypfreak1987
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2006
Posts: 96
Netherlands
|
Sorry for this post again. But I think I am almost there right now. I have the following code: Code:
action gondel01 { my.passable = on; //Physics on phent_settype(my,PH_RIGID,PH_SPHERE); //Set a weight phent_setmass(my,100,PH_SPHERE); //Set a friction phent_setfriction(my,20); //Set an elasticity phent_setelasticity(my,50,5); //Set a damping phent_setdamping(my,50,90); //Set a gravity ph_setgravity(earthGravity); gondel1 = phcon_add(PH_HINGE,my,kruis1); phcon_setparams1(gondel1,my.x,vector(0,0,0),nullvector); phcon_setparams2(gondel1,vector(-360,360,0),nullvector,nullvector); while(my) { vec_for_vertex(temp,kruis1,881); my.x = temp.x; my.y = temp.y; my.z = temp.z; wait(1); } }
But now, the model flips backward. But they need to rotate around a certain (world) point (0,0,0). How can I fix this?
|
|
|
Re: G-Forces
[Re: Polypfreak1987]
#202804
04/17/08 06:37
04/17/08 06:37
|
Joined: Aug 2006
Posts: 96 Netherlands
Polypfreak1987
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2006
Posts: 96
Netherlands
|
And I am back again with a new question. I am almost done. But the model that need to be rotating is like double. Here is a screenshot of the whole model. You see that the model at the cross is double. But I don't no why. Here is the code of the model.
action gondel01 {
gondel001 = my;
my.passable = on;
my.scale_x = 0.5;
my.scale_y = 0.5;
my.scale_z = 0.5;
//Physics on
phent_settype(my,PH_RIGID,PH_BOX);
//Set a weight
phent_setmass(my,23,PH_BOX);
//Set a friction
phent_setfriction(my,100);
//Set a damping
phent_setdamping(my,45,10);
//Set a gravity
ph_setgravity(earthGravity);
gondel1 = phcon_add(PH_HINGE,my,kruis01);
phcon_setparams1(gondel1,my.x,vector(0,0,1),nullvector);
phcon_setparams2(gondel1,vector(-360,360,0),nullvector,nullvector);
while(my) {
vec_for_vertex(temp,kruis01,875);
phent_addvelcentral(my,vector(temp.x*time_step,temp.y*time_step,temp.z*time_step));
my.x = temp.x;
my.y = temp.y;
my.z = temp.z;
wait(1);
}
} In another code the entity is made 1 time. Thanks in advance.
|
|
|
|