Posted By: vasco
Placement of model - 10/24/09 16:36
I have a ball ( mdl model ) which i wish to keep it at a position (x1,y1,z1) and let it free fall until it reaches (x1,y1,z2) under gravity ( so only Z value changes).. I already have physics for gravity working in my code.
I want to know how to place the ball at a position ?
I tried my.x , my.y , my.z = (x1,y1,z1) in the action of the model; But not able to get it.
PLease help
Posted By: Walori
Re: Placement of model - 10/24/09 17:07
If I understood correctly you want to place a object to position? Don't think this has anything to do with physics but here is one way to do it:
VECTOR ball_pos;
function ball_func(){
vec_set(ball_pos,vector(x1,y1,z1);//x1-z1 are the numbers of pos
my.x = ball_pos.x;
my.y = ball_pos.y;
my.z = ball_pos.z;
...
}
Posted By: vasco
Re: Placement of model - 10/24/09 18:19
I have done the same thing essentially. But I have written inside the action of the model
action asd() {
// ball drops to floor;
my.x= x1; my.y =y1; my.z =z1;
// code for placement at x1,y1,z1
}
But I dont see it working.Is anything wrong ? Should I put this only inside a function ?
Posted By: Walori
Re: Placement of model - 10/24/09 19:01
There's really no difference between action and function, actions is just something you place from WED whereas you can't place function. But have you defined x1,y1,z1?
Personally I don't even understand what you're trying to achieve, could you be more specific please?
Posted By: darkinferno
Re: Placement of model - 10/24/09 22:11
actually you can place functions, they dont appear in the list but you can type it in