Road trip animation in Papervision3D
I have been thinking about doing something like this for some time now, but I had no idea where to start. However, recently, after I experimented with animating vertices in Papervision3D, things started to look brighter, so a couple of days ago I sat down and started coding…
Basic concept here is that there is one Plane and two BitmapData objects - a texture and a terrain. The Plane never moves, but instead the texture and the terrain are scrolled on it.
The texture is assigned as material to the plane. At each frame the texture BitmapData is scrolled by an offset and the material is updated.
The terrain is a grey scale bitmap. It is scrolled in the same way as the texture. Each pixel of the terrain is mapped to a single vertex of the plane - the lighter the pixel color is, the higher the z position of the vertex will be. It is done the the same way as in my previous example. Only this time it is not a generated noise, but rather a map drawn manually, so that is works good with the texture.
Hills and turns. Additionally, each vertex on the plane has its x and z positions rearranged continuously using Math.sin() and Math.cos() functions with different phases - that creates the illusion of uphills, downhills and turns…
Lighting. Finally there is one more bitmap - a light map, that is blended with the texture using MULTIPLY mode to create the effect of light and darkness.

Source. I think it is a pretty nice effect and a good starting point for maybe a car racing game or something. Check the demo, try it in full screen by pressing SPACE and grab the source to see it in detail (also available in a zip bundle containing all the graphical assets I used).
Credits. In this demo I used textures from OpenFootage.net. They have some great stuff in there!

May 16th, 2008 at 8:32 am
Thanks for the share looks really nice well done.
May 16th, 2008 at 11:10 am
[…] Bartek Drozdz posted a cool Papervision 3D animation. Basic concept in this animation is that there is one Plane and two BitmapData objects - a texture and a terrain […]
May 16th, 2008 at 2:19 pm
very nice demo!
love it
May 16th, 2008 at 3:31 pm
Just awesome
May 16th, 2008 at 9:17 pm
[…] trip animation Really nice road animation by Bartek Drozdz from Everyday […]
May 16th, 2008 at 9:23 pm
Well done. I can totally see this as a starting point for a game.
May 18th, 2008 at 1:35 am
nice
May 18th, 2008 at 10:38 pm
Awesome man, great work!
May 18th, 2008 at 10:53 pm
Very nice. Thanks for sharing.
May 19th, 2008 at 2:22 pm
That’s pretty impressive. I can think of a lot of possibilities for something like this.
May 20th, 2008 at 8:24 pm
Awesome, this would make a great demo-effect!
May 21st, 2008 at 12:30 am
That is just excellent! You are sure good at this. Congratulations!
May 21st, 2008 at 2:55 pm
Great stuff!, I love it.
Funny thing is that i wanted do the same thing :)
May 21st, 2008 at 4:54 pm
Nice use of the available resources! :D
May 22nd, 2008 at 1:35 am
well, there is nothing to add. ;-)
June 16th, 2008 at 9:19 pm
Wow. Just wow :D Could be a good base for driving game :)
June 18th, 2008 at 6:03 pm
[…] Cómo hacer para que nuestro usuario experimente el estar siguiente un camino en una carretera?… Este tutorial es la respuesta. Incluye código fuente! […]
June 29th, 2008 at 7:45 pm
Hi
I am new to AS3 I just downloaded the source & made roadtrip.as the document class (Of course everything is in correct class path ). But when I try to run it is throwing some init error on runtime but not at compile time. Can u explain why this is happening ?
Many thanks in advance.
July 1st, 2008 at 8:37 pm
@Harshal. using the Flash IDE it is possible that is does not work correctly - because of the way I embed assets. I just posted a note on this, and it is here. If you still have problems let me know.