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
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 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
Sample code for how to use models as waypoints? #239193
12/03/08 06:01
12/03/08 06:01
Joined: Sep 2006
Posts: 36
Tempe, AZ
B
bpc31 Offline OP
Newbie
bpc31  Offline OP
Newbie
B

Joined: Sep 2006
Posts: 36
Tempe, AZ
For example if I wanted cars to race around an oval track using cones as the waypoints but each car would stay a different distance (generated randomly) to the right of each cone assuming they are racing counter-clockwise.

Thanks!

Re: Sample code for how to use models as waypoints? [Re: bpc31] #240133
12/09/08 16:32
12/09/08 16:32
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Code:
vec_add(car.x, temp); //set car position to cone position

temp.x = random(100)-50; //create random dist from -50 to 50
temp.y = 0; temp.z = 0;

vec_rotate(temp, cone.pan); //rotate vector
vec_set(car.x, cone.x); //add the random side dist to the car


Re: Sample code for how to use models as waypoints? [Re: oliver2s] #241919
12/20/08 01:00
12/20/08 01:00
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline
Expert
Rondidon  Offline
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Have a look at this (very good) open source pathfinding engine: Intense Pathfinding 2 from the creators of Intense X: www.intense-i.com
They also use models as waypoints.


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