Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Placement of model #295348
10/24/09 16:36
10/24/09 16:36
Joined: Oct 2009
Posts: 20
V
vasco Offline OP
Newbie
vasco  Offline OP
Newbie
V

Joined: Oct 2009
Posts: 20
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

Re: Placement of model [Re: vasco] #295356
10/24/09 17:07
10/24/09 17:07
Joined: Mar 2009
Posts: 88
Walori Offline
Junior Member
Walori  Offline
Junior Member

Joined: Mar 2009
Posts: 88
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:
Code:
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;
...
}



Re: Placement of model [Re: Walori] #295359
10/24/09 18:19
10/24/09 18:19
Joined: Oct 2009
Posts: 20
V
vasco Offline OP
Newbie
vasco  Offline OP
Newbie
V

Joined: Oct 2009
Posts: 20
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 ?

Re: Placement of model [Re: vasco] #295363
10/24/09 19:01
10/24/09 19:01
Joined: Mar 2009
Posts: 88
Walori Offline
Junior Member
Walori  Offline
Junior Member

Joined: Mar 2009
Posts: 88
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?

Re: Placement of model [Re: Walori] #295385
10/24/09 22:11
10/24/09 22:11
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
actually you can place functions, they dont appear in the list but you can type it in


Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1