Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How can i group car elements (tires,body) #411403
11/16/12 11:15
11/16/12 11:15
Joined: Nov 2009
Posts: 13
Turkey Ankara
kadir Offline OP
Newbie
kadir  Offline OP
Newbie

Joined: Nov 2009
Posts: 13
Turkey Ankara
Hi everyone,
I don't have any information about that. I want to group car elements. I have car body and 4 tires in word. I designed car position and put the tires in the car body. The front tires was going when i was press the w key but the car don't going beacause tires don't merged the car body.
How can i do this please help me?


### From Turquie ###
Re: How can i group car elements (tires,body) [Re: kadir] #411406
11/16/12 11:32
11/16/12 11:32
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
try

This example connects a tire model / more tire models to your car body. Play around in _add_tire. Its up to you. With this source you should be able to connect tire(s) to car with fixed pos, vertex or bone pos.

Code:
void _add_tire()
{
 while(you)
 {
   VECTOR _p, _a;
 // simple connection without bones or vertex (fixed pos)
   vec_set(my.x,   you.x);
   vec_set(my.pan, you.pan);
 // or add bones at your car body, where the tire(s) should
 // be placed and use this
    vec_for_bone(_p, you, "TirePos1");
    ang_for_bone(_a, you, "TirePos1");
   // or place a vertex at the pos where the tire(s) should be placed
   vec_for_vertex(_p, you, 123); // Vertex 123

   vec_set(my.x, _p);
 //vec_set(my.pan, _a);
  wait(1);
 }
 // car body lost ?
 ptr_remove(me);
}
action MyCar()
{
 ent_create("tire.mdl", vector(my.x, my.y, my.z), _add_tire);
// ent_create("tire.mdl", vector(my.x, my.y, my.z), _add_tire2);
// ent....
// ent...

 while(1)
 {
   // your car code
  wait(1);
 } 
}

When using one model 4 one tire, i would use different functions like _add_tire_front_left etc.
greets

Edit a day later grin
Just seen this thread is under physics...then i guess my post wont help u much grin

Last edited by rayp; 11/19/12 21:14.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;

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