Rotating Skyboxes

By: NVerxion

nverxion@hotmail.com

This should be fairly easy to follow since I have the editor here and I can write the steps to what I'm doing as I go along. Instead of referring you to another skybox tutorial for the basics, I'm going to build a very small example level from scratch for those of you who are new to this topic so you can see how to get started. I'll try to be as clear as I can in explaining what I'm doing here. I will be describing the process…leaving the artistic aspect up to you. Just follow along and you'll end up with a reference you can expand on.
IN THE BEGINNING...skybox basics
I'm assuming you know the simple things, like adding and subtracting to and from the world, altering brush dimensions, adding lights, adding a PlayerStart, etc. As I said before, this will end up being a tiny example map showing off a rotating skybox. But first thing's first. Start a new map and carve out a room about 256x512x512. Place a light on the ceiling and add a PlayerStart.

Next make your cube 200x400x576, making sure it is still centered within the room in each view. Hit Ctrl-N to intersect, then hit Ctrl-S to subtract. By doing this, you have created the east and west window frames with one brush instead of two. Think of it as being economical.

Now, in the overhead view, hold the right mouse button and press and hold Ctrl. Move the mouse to the right to rotate the brush 90 degrees. It should still retain the shape of the two window frames, so when you have it in position all you have to do is hit Ctrl-S again to subtract and we have all four window frames in place, using only two brushes. This just makes less work for the CPU when playing the game.

Now select all four "window" surfaces (their dimensions will be 200x400) by holding Ctrl and selecting each of them in turn. Release Ctrl and right-click one of the highlighted surfaces and select Surface Properties from the menu that appears (it should say there are 4 selected). Under the Effects tab in the Surface Properties window, check the box that says Fake Backdrop, then close the window and de-select the walls.. What this does is it tells the game to show whatever is in the SkyZone (skybox) rather than the actual texture of the wall as seen in the editor. From this point, as far as the room is concerned, you can dress it up with different wall, ceiling, and floor textures if you want. Now the only thing left to do is create the SkyZone itself.

Make your cube about 512x512x512. An average size for a skybox would be about 1024x1024x1024 for an average size level. However, since our level here is so small, 512x512x512 will do fine. Keep in mind that a skybox can be any shape, but for simplicity's sake I'll use the cube here. Move the cube off to the right somewhere so that it doesn't touch the room we just made. Go over to the texture bar and load the ShaneSky.utx texture package. At the very bottom of this package you will find a texture called STARS. Select this texture and subtract the cube from the world. This will be our skybox. Technically, you could use whatever texture you want, but for a rotating skybox you will probably want to be in space, although you could get creative…. Anyway, move your viewpoint inside the cube so you can look around and select all six surfaces while holding Ctrl. Release Ctrl and right-click one of the surfaces and bring up the Surface Properties window again (it should say 6 selected). Under the Effects tab in this window, check the box that says Unlit. Now close the window and de-select the surfaces.

Almost done! Just a few more things to do
Move the cursor to the upper-right corner of the screen to the Browser. It should say textures now, if you've been following along. Click on the Browser and select classes from the drop-down menu. Scroll down the list that appears and click the minus sign next to the word *Info. From the new list that appears, click the minus sign next to the word *ZoneInfo. In this sub-menu, select SkyZoneInfo. Next, right-click one of the skybox surfaces and select Add SkyZoneInfo here. An icon should appear that looks like a picture of a cube with a question mark next to it. Now, using the overhead and side views, position the icon in the center of the skybox. That's it!! Now the only thing that remains is to REBUILD THE LEVEL and then save it

If you want to stop there, that's fine. I will now explain exactly how to make our skybox appear to rotate. If you are having any problems so far, please email me! I'll send you a copy of the map I made along with this tutorial so you can see exactly what I did. Keep in mind that my map will have a fully rotating skybox instead of a static one, but the only difference is in the SkyZoneInfo properties, not the actual construction. For those of you who want a rotating skybox, read on!!!
THE ROTATING SKYBOX....SkyZoneInfo Properties
Continuing from where we left off, there will be no further construction necessary. All that remains is a little adjustment in the SkyZoneInfo Properties.
Right-click on the SkyZoneInfo icon and select SkyZoneInfo Properties from the menu that appears. Click the plus next to the word Advanced. Scroll down the list that appears until you find bStatic, and change it to False. Next, close the advanced list, and click the plus next to the word Movement. In the new list that appears, change bFixedRotationDir to True, and change Physics to PHYS_Rotating. Next, Click the plus next to RotationRate, and change the Pitch, Yaw, and Roll settings to your liking. In this example map here I will use 150 for the Pitch, 40 for the Yaw, and 550 for the Roll.
Pitch- forward and backward rotation
Yaw- left and right rotation
Roll- banking rotation (left and right)
NOTE: Try using negative values to rotate in the opposite direction.
Well, that about does it. PLEASE email me if you have any questions concerning skyboxes. If you want a copy of the map I made for this tutorial I can send it to you. It isn't very big Just give me an address to send it to.
-Nverxion
nverxion@hotmail.com