Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by jcl. 07/22/26 06:42
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, madpower2000), 1,532 guests, and 18 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
interpolating a vector(cubic) #331045
07/01/10 18:02
07/01/10 18:02
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
HI,
I have a problem.
I would like to learn how to interpolate a vector(cubic).
Big problem:

Most things/documentations on the web are just like a dschungle and its not easy for me to understand them. I have never been that bad in math, but cubic interpolation is eating my brain.

Maybe someone can help me?(tips, help, advice, explanation)

Greets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: interpolating a vector(cubic) [Re: Rackscha] #331053
07/01/10 18:35
07/01/10 18:35
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"how to interpolate a vector(cubic)"

What are you trying to do? I don't get it.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: interpolating a vector(cubic) [Re: Superku] #331054
07/01/10 18:40
07/01/10 18:40
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
i think its.. getting the half on the distance of 2 axis vector i mean cubic-> xyz i think..

Re: interpolating a vector(cubic) [Re: MMike] #331056
07/01/10 18:43
07/01/10 18:43
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
no,
Cubi is a interpolation method

CUBIC, QUADRATIC,LINEAR

i have 2 positions, and want to interpolate a vector between them(cubic)

§dgs only has a linear interpolation function


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: interpolating a vector(cubic) [Re: Rackscha] #331061
07/01/10 19:12
07/01/10 19:12
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)
may i ask the differencec?

Re: interpolating a vector(cubic) [Re: darkinferno] #331064
07/01/10 19:29
07/01/10 19:29
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Doesn't a cubic interpolation require four nodes/vectors to interpolate, or the tangent vectors at the positions of the two nodes? Just two nodes isn't enough information for a cubic interpolation.

Re: interpolating a vector(cubic) [Re: Lukas] #331065
07/01/10 19:33
07/01/10 19:33
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@Lukas:
Thats right, but in one example someone just placed 2 vectors between them.
(depending on the start and end velocity)

But maybe thats not a clean way.

What iam trying to do is to interpolate positions between multiplayer entities as smooth as possible(objectets speeding up and down).

For example:
i wnat to scale a vector between the old and the new position. But i dont want it to be done linear. Scaling has to be done slow at the beginning and fast at the end.(within a given number of frames)

So lets say i want to interpolate between 5frames, i wnat the scaling to be at 100% on the 5th frame but not linear between 1-5th frame.

Last edited by Rackscha; 07/01/10 19:35.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: interpolating a vector(cubic) [Re: Rackscha] #331069
07/01/10 19:47
07/01/10 19:47
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
vec_lerp(v,v1,v2,smooth(f))

var smooth(x)
{
return x*x*(3-2*x);
}

Re: interpolating a vector(cubic) [Re: Hummel] #331078
07/01/10 20:09
07/01/10 20:09
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i sometimes use cos() for easing in/easing out the interpolation. could work for you too.

and i had big problems with vec_lerp() because of the insufficient var precision so i did my own version that uses floats. it's much smoother.

Re: interpolating a vector(cubic) [Re: ventilator] #331096
07/01/10 21:16
07/01/10 21:16
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
If it's just about having a certain start and end velocity, how about just using vec_lerp and raising the interpolation factor quadraticly?

Page 1 of 2 1 2

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

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