Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 847 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
help with path functions :/ #402476
06/06/12 05:53
06/06/12 05:53
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hi there laugh

For my titelmenü, i worked with WED during the last weeks - the first time i use WED since i own an Acknex Engine ^_^"

Now i got a problem...
i created a few paths with different counts of nodes. All paths are just a line, not a closed circle. When i want to move my camera smoothly with speed reduction to the last node of a path, i looked into path_spline. This works so far - but with just a small Problem: The camera turns around at the Paths last node/start node, and flys back to the beginning ._.

Someone told me that i need to do the path movement by my own when using paths that are no closed circles. But i've not really a clue how to move the camera along a path with the same speed and smooth effect as path_spline did ._.

can someone help me out here?

Last edited by Espér; 06/06/12 06:54.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: help with path functions :/ [Re: Espér] #402489
06/06/12 10:53
06/06/12 10:53
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: help with path functions :/ [Re: Puppeteer] #402492
06/06/12 11:21
06/06/12 11:21
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
not really, cause my paths have more than 8 waypoints ^_^"


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: help with path functions :/ [Re: Espér] #402494
06/06/12 11:36
06/06/12 11:36
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline
User
exile  Offline
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
o-----o-----o

See what I typed up top? Thats the basis for the idea I am having. Essentially, you would calculate the distance between 3 positions, Previous node, Current node, and Next node. what you would do is move the camera via lerp between the distance of the current node and the next node (Or the previous node if the camera is going backwards). After you get past the halfway point between the current node and the next node, the next node then becomes the current node and the next node becomes the literal next node. You could get the distance between nodes using vec_dist and smoothly move the camera between points using vec_lerp.

Hope this helps as it was the only thing I could think of.

Re: help with path functions :/ [Re: exile] #402495
06/06/12 11:40
06/06/12 11:40
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
smirk
how is vec_lerp working? It behaves strange, especially with rotations.. ._.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: help with path functions :/ [Re: Espér] #402501
06/06/12 12:19
06/06/12 12:19
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
there is the algorithm given at vec_lerp() page, which is the vector equivalent of smooth(). maybe you need to use different smooth() functions for coordinates and speed...
some weeks ago I created a smoothing function for my tile based unit movements, I mean the best to customize the parameters by smooth(), or a similar own function to your actual needs.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: help with path functions :/ [Re: Espér] #402581
06/07/12 11:02
06/07/12 11:02
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Originally Posted By: Espér
not really, cause my paths have more than 8 waypoints ^_^"

Dude Oo
You should really be capable of changing this code to work with any amount of nodes for it is as hard to do as lifting a feather =P

If you do not like this code you should look into splines. They are easy to implement and work really well. -> Wikipedia.

You can calc it pretty much like that:
Code:
fs[0]=2.0*time_*time_*time_-3.0*time_*time_+1.0;
	fs[1]=time_*time_*time_-2.0*time_*time_+time_;
	fs[2]=-2.0*time_*time_*time_+3.0*time_*time_;
	fs[3]=time_*time_*time_-time_*time_;
	temp_v.x=(fs[0]*spline.start.x+fs[1]*spline.start_tangent.x+fs[2]*spline.end.x+fs[3]*spline.end_tangent.x);
	temp_v.y=(fs[0]*spline.start.y+fs[1]*spline.start_tangent.y+fs[2]*spline.end.y+fs[3]*spline.end_tangent.y);




Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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