what are lerp,qarp,and cubic?(for the nonmath)

This forum is currently in read-only mode.
  • ok, this is a continuation of the lerp tutorial.

    I actually recommend that first so you see the actual numbers changing, and understand it better.

    in this, as with most real world cases, you won't see each number, but will see things like objectname.x instead of the actual value, so you see an example application and how it will more likely look in your code.

    the red and purple dots are drag and droppable

    if you right click and drag any of those dots you can change the angle of that dot.

    ep stands for endpoint

    cp stands for controlpoint

    same as before, use the slider to change the value of t

    all cc interpolation tutorial

    EDIT:

    all the dots start with their angles at 0 degrees, with their red lines facing toward the right of the screen.

    you'll notice if you place ep1's angle slightly greater than 0

    and you place ep2's angle slightly less, it will go all the way around almost 360 degrees instead of crossing the short distance through 0|360 boundary. though this makes sense because lerp is just going between the numbers 10 and 350, let's say. this is usually not the desired result when working with angles

    now try rightclicking on the 'lerp' button at the top. it will change it to anglelerp

    the x and y are still lerped, but the angle will be anglelerped.

    anglelerp is a function in the math plugin that will assume you want to take the shortest route to a new angle when lerping, so you can safely ignore the 0|360 boundary

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Qarp is my new best friend. Nice example!

    Any chance you could share how you got the dots to be positioned between the start/end points? Are they constantly spawning and being set on a path, or is there a fixed amount and some magic event to position them properly?

  • I think I understand why it works but I don't really know how to apply it. I wanted to make a bullet curve out of the imagepoint to a spot ahead from a top down type perspective. I'm not really sure how to apply qarp to that. Frenchyann had said qarp was the best way :/ Though I think I could use bulletml to make it easy I didn't want to have to go that route :/. Anyone care to explain a lil more or give me an example of a gun firing with these methods without anything extra in it >_<

  • I wanted to make a bullet curve out of the imagepoint to a spot ahead from a top down type perspective.

    But from a top down perspective it wouldn't be a curve, but just a line.

    Or do you mean something like, you shoot to the north while the enemy stands in the east, and the bullet still reaches the enemy? Then just imagine a third invisible spot, that the bullet will head towards on its way to the enemy.

    Then its a=start position of the bullet, b=invisible imaginary point, c=enemy's position.

    green refers to a and is the start point. Blue is b, imagine it being the point in which direction the bullet is shot at start. red is c the enemy's position and the final point that needs to be reached.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)