Author Topic: Suggestions for interesting movement between two points?  (Read 5218 times)

0 Members and 1 Guest are viewing this topic.

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
I'm currently working on something that could do with a few touches to finish it off.

I have a logo made of cubes (3d pixels). The pixels are placed randomly in 3d space and fly to their final positions to form the logo. I'm currently using a lerp and staggering the start times of the cubes, which looks ok but is really missing something.

I was wondering if anyone had any suggestions to make the movement more interesting. I'm doing this in a vertex shader, so ideally whatever I do shouldn't be overly processing hungry as it's called for a lot of vertices.

I'm thinking of interpolating between the source position and destination via an intermediate position (with some kind of weighting for the intermediate position based on the current position between source and destination).  I'm sure I had some code from years ago to do something like this on the PS2, but can't for the life of me find it. Any ideas or suggestions would be great, thanks.
raizor

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Do you just want a simple curve or something fancier?
If you want a more natural looking motion you could add a bit of lowpass filtered noise to create a couple of key-frames in between.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
A curve would probably do it. As long as I could have a slightly different curve for each object being moved. Once I've got one curve, the others should come fairly easily I guess.
raizor

Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
I love springing to position, it's simple, short and probably cheesy but it works suprisingly well every time. By varying the strength in creative ways you can give a nice organic feel to it. I'm not familiar with lerp or staggering but it sounds a lot more awesome then simple springs...

Looking forward to whatever kind of awesome you're working on.  :kewl:
www.kirl.nl
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Kirl, what do you mean by springing? Moving straight from point A to point B, or in a spiral motion?
raizor

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
A curve would probably do it. As long as I could have a slightly different curve for each object being moved. Once I've got one curve, the others should come fairly easily I guess.
If you already have a source- and destination-point (and don't want more points) you just have to figure out useful tangents for the two.
Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
Springing like it's attached to an invisible spring, so that it overshoots it's target position a few times before settling into it. It generally moves in a straight line unless you give each cube some sort of start velocity over another direction. Collissions will occur when springing from random start positions though. You can place them into creative offscreen starting positions + velocity to get some interesting motion without collission.

But again, springs sound kind of n00b compared to l33t terms like lerp and stagger, haha...  ;D
(I'll have to read up on those)
« Last Edit: January 30, 2012 by Kirl »
www.kirl.nl
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
@Hellfire, thanks.

@Kirl, ah, I see. Yeah, that does normally look good. Lerp is nothing complicated, just a way to get a position between two numbers. You feed the lerp method number1, number2 and a value between 0 and 1 to represent time. A lerp of 0.5 would return the middle of number1 and number2.
raizor

Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
I see, thanks for the explanation. That's the kind of lingo I like to casually drop in trivial conversation! ;D
www.kirl.nl
Challenge Trophies Won:

Offline energy

  • Amiga 1200
  • ****
  • Posts: 280
  • Karma: 25
    • View Profile
its a very interresting subject for me.
Perhaps there also can be used some splines to do different ways from A to B
Is there an example we can see at its status?
coding: jwasm,masm
hobby: www.scd2003.de