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
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 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
What is vec_lerp? #11683
01/28/03 04:28
01/28/03 04:28
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
I see in the latest Beta doc that a new vector function is coming:

vec_lerp(vec v,vec v1,vec v2,var f)
interpolates the vector v between v1 and v2 according to the factor f.

Formula:
v = (1-f)*v1 + f*v2

Can someone explain to me what this is and in what context it can be used?

A *tiny* code example would be wonderful...

Thanks!

-WildCat


Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
Re: What is vec_lerp? #11684
01/30/03 23:43
01/30/03 23:43
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
Doug, Jcl?
Anyone?

I know this function wouldn't have made it into the engine if it did not add some value...

Where would this function be useful?

- WildCat


Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
Re: What is vec_lerp? #11685
01/31/03 04:49
01/31/03 04:49
Joined: Jul 2000
Posts: 8,973
Bay Area
Doug Offline
Senior Expert
Doug  Offline
Senior Expert

Joined: Jul 2000
Posts: 8,973
Bay Area
The best thing I can come up with is that you can use it to make an entity interpolate between two facings. Say your spaceship is pointed towards vec1 and you want to turn towards vec2.

I'm sure I'm missing a dozen other uses but that's the best I can up with. [Wink]


Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI
Re: What is vec_lerp? #11686
01/31/03 05:44
01/31/03 05:44
Joined: Jun 2002
Posts: 248
NZ
mudhole Offline
Member
mudhole  Offline
Member

Joined: Jun 2002
Posts: 248
NZ
How about generating a line of particles, between vectors v1 and v2?
eg
code:
counter = 0;
while(counter < num_of_particles_to_create)
{
// determine this particles position
temp = counter / (num_of_particles_to_create-1); // fraction of total distance
// interpolate between start and end vectors to get position
vec_lerp(temp,vecFrom,vecTo,temp);
// create the particle
effect(ParticleAction,1,temp,nullvector);
}

This code should create a line of num_of_particles_to_create particles equally spaced between vecFrom and vecTo. How useful! [Wink]

Re: What is vec_lerp? #11687
01/31/03 23:59
01/31/03 23:59
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
Hmmm...

Thanks guys. That got the wheels turning. If I come up with something interesting, I'll let you know!

- WildCat


Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!

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