Wednesday, 22 April 2009

Papervision Skybox

Tonight I set about getting the COLLADA model rendered in Blender. No sooner had I created my model and tried to export it, Blender popped up a message saying that I needed Python installed in order to export. I find this a bit strange since COLLADA is a simple XML file so I'm not sure why this is a drama. I downloaded and installed Python and played around with the settings in an attempt to export my model. Anyway, to cut a long story short, I wasn't having any luck. Rather than not make a blog post today I continued on with a little bit of code that I wrote in my lunch break at work earlier.

I had created a cube example with and I decided I would progress it into a skybox demo. The purpose of a skybox it to give a 3D panoramic view of an environment by attaching images onto the inside of a very large cube or sphere primitive. The games 3D environment sits inside this skybox and moves relative to the player camera and never rotates. This means you can never arrive at the face of the actual cube itself and will give the illusion that there are constant objects or scenery that appears to be very far into the distance.

I started with my cube and created a materials list consisting of six panoramic images. I then mapped each image to it's relevant face on the cube. This is very simple but it is important to note that the cube must not draw the faces that might obscure your view since then you must always be looking at the inside of the box. You must also map the images to the inside faces of the cube.

This was a really fun thing to do and I think it creates a great effect. It would be possible to improve this demo by changing the viewport render modes and increasing the tri count on the cubes polygons but I will wait till I make the real thing.

Until then you can check out the demo here.

Gary Paluk

0 comments:

Post a Comment