Mesh & Geometry question

0 favourites
  • 3 posts
From the Asset Store
Addition, subtraction and multiplication are supported. Endless replayability.
  • How I can make level like this:

    I tried to use mesh deformation

    https://www.dropbox.com/scl/fi/o156htkng7vacwkjs1b0y/Mesh.c3p

    The main difficulty is in making smooth transitions. O know about "lerp" expression, but I don't know how to apply this. Does anyone have any ideas how to create a level like on the first picture?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How I can make level like this:

    I tried to use mesh deformation

    https://www.dropbox.com/scl/fi/o156htkng7vacwkjs1b0y/Mesh.c3p

    The main difficulty is in making smooth transitions. O know about "lerp" expression, but I don't know how to apply this. Does anyone have any ideas how to create a level like on the first picture?

    Instead of lerp, use quarp or cubic. For quarp you need 3 points p1xy = loop-1 ,p2xy = loop ,p3xy = loop+1 , and for cubic 4 p1xy = loop-1 ,p2xy = loop ,p3xy = loop+1, p4xy = loop+2

    Also, could try this howtoconstructdemos.com/bend-a-sprite

  • You can think of it as an xy graph. For each x position you have a formula for y.

    What you have now is basically y=random() which will be jagged no matter what. You can smooth the random by storing random values in a lower resolution array and interpolating with more mesh points.

    So roughly you could have an array with 10 random(-100,100) values and with 100 mesh points you could read from that.

    t = loopindex/100*10

    Y = cosp(array.at(int(t)), array.at(int(t)+1), t-int(t))

    Another is to just jam a bunch of sines together with different frequencies, amplitudes and offsets.

    Y=50*sin(x/50)+ 25*sin(x/13+33)+10*sin(x*5+100)

    Just fiddle with all the values and/or add more sin() till you get a shape you like.

    Another option is to use the advanced random function. With it it has a perlin noise function which is a smoother noise.

    Y= noise(x*k)*100

    Where k is a value to tune the frequency.

    The last step would be convert that to distort mesh units.

    X = loopindex/N*sprite.width+sprite.x

    Y = whatever function you decide to use

    Set mesh point (loopindex,0) absolute (loopindex/N, (Y-sprite.y)/sprite.height

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