vrijdag 20 januari 2012

Scroll down please


Developing browser based games has the drawback that we generally can't use too much animations or effects. The reason for this is that they take too long to create or simply cost too much processing power which slows down a game.

But we do want our games too look good and not too static. You can imagine it's kind of dull looking when there is nothing animated or moving in a game environment.
Luckily for us there is a simple animation trick which can be used an a variety of ways to add "life" to a scene! It's actually one of the oldest tricks of the trade.......scrolling!

Scrolling a texture/image over an 3D object or plane can be simply done by animating the objects UVW coordinates.

Momentarily I'm working on an update of Go Kart Go which will have new characters, tracks and some updates of the old tracks. One of the new tracks has a spooky ghostship theme. For this track I wanted the souls of dead pirates to come out of the ground and move up into the sky. I used the scrolling technique to achieve this effect.

First I created a vertically tiling souls texture (with transparency) and mapped it onto a 3D plane object. Scrolling the texture (UVW coordinates) vertically up accross the plane will move the souls.



I placed a few of these objects in the scene and modified the mesh to get a cool "wave" effect on the souls. This looks especially good when a few of these soul planes are placed behind each other.






There are countless ways a scrolling texture can be used. For Go Kart Go it's used for flowing water and lava, turbo pads, dust particles, rain, moving clouds, smoke and (of course) the souls!

Cheers,
Matt

Geen opmerkingen:

Een reactie posten