Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 1 invisible), 708 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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