Papervision Programming Tutorial - SkyBox

Posted Feb 12, 2009 by mcasperson / comments 1 comments / Print / Font Size Decrease font size Increase font size

Learn how to implement a sky box in Papervision 3D.

In 3D games you quite often need to fill the sky with the distant view of the outside world, be it the sky, a city backdrop, a star field or a mountain range. The player in the 3D world is never expected to actually reach what is depicted in this view, but without it the player would never get a sense that they are moving inside a world bigger than the rooms or tunnels that make up an actual 3D level.

One of the easiest ways to generate the look of this outside world is with a sky box. As the name suggests it is essentially a box that contains the player (or more specifically the camera). If you move the box so its position is always centred on the camera, and make it large enough to encompass the 3D world that the player is looking at, the player gets the effect of a distant vista that surrounds their local 3D world.

This sample takes a standard Papervision cube primitive, textures it with 6 double sided skybox textures (double sided so we can see the textures from the inside), and updates the position of the cube so it is always centred on the camera. The last bit ends up being a little redundant as the camera never actually moves in the demo, but I have included the code anyway.

I think you’ll agree the effect it quite nice, while being extremely simple to achieve. Check out the demo here, and download the source here.

Go back to Papervision Tutorials

Check out these other Papervision examples:

Loading and Displaying a 3D Model

Particle Systems with Flint

Modify Textures At Runtime

WOW Physics

Shading

Effects

Animated Textures

Mouse Selection

Texture Smoothing

Transparency

Animations

SkyBox

Environment Mapping

3D Text

BitmapViewport

3D Spectrum Analyser

Depth of Field

Casting Shadows

Photo Cloud

Photo Slide

Rate this Article:

Be the first to rate me.


* You must be logged in order to leave comments, please login or join us.

Comments

Benny
Benny said... on May 25th, 2009 at 6:39 AM

Although I appreciate the effort of sharing this code, I found it confusing rather than inlightening. the code is all over the place and the post about it doesn’t mention anything about the implementation; it only covers the concept of skyboxes in general.

I you need a proper example of a skybox, try one of the following tutorial instead:
- http://blog.projectnibble.org/2009/05/22/easy-papervision3d-skybox-tutorial-and-source/
- http://professionalpapervision.wordpress.com/2008/10/20/putting-stars-and-more-into-a-skybox-source/



Bookmark and Share
Sign up for our email newsletter
Name:
Email: