Hello everybody,

I am trying to make a pendelumn with physics. I am almost ready. But the problem is that the axis is very weird. The axis is not at the top, but at the bottom. How do I set the axis at the top? Now it swings not to the top, but to the ground.

This is the code of the pendelumn:

Code:

var earthGravity[3] = 0,0,190;
var klepel1;

action klepel {
klepel01 = my;
my.passable = on;
my.z = 190;
my.x = 0;
my.y = -10;
my.scale_x = 0.560;
my.scale_y = 0.560;
my.scale_z = 0.560;

//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 a damping
phent_setdamping(my,0,0);
//Set a gravity
ph_setgravity(earthGravity);

klepel1 = phcon_add(PH_HINGE,my,steun1);
phcon_setparams1(klepel1,my.y,vector(0,190,0),nullvector);
phcon_setparams2(klepel1,vector(-120,120,0),nullvector,nullvector);

while(my) {
vec_for_vertex(temp,steun1,588);
phcon_setmotor(klepel1,vector(0,190,0),nullvector,nullvector);
//phent_addvelcentral(my,vector(my.x,my.y,my.z));

if(key_cur == 1)//right key is pressed
{
phent_addtorquelocal (my,vector(0,100,0));
}
if(key_cul == 1)//left key is pressed
{
phent_addtorquelocal (my,vector(0,-100,0));
}
/*my.tilt += swing;
if(key_cur == 1) {
if(swing < 120) {
swing += 1*time_step;
}
}
if(key_cul == 1) {
if(swing > -120) {
swing -= 1*time_step;
}
}*/

wait(1);
}
}



Thanks in advance.