Game Development for Xbox 360, PC + Windows Phone 7

Skybox

rated by 0 users
Answered (Verified) This post has 2 verified answers | 3 Replies | 3 Followers

Top 25 Contributor
2 Posts
earthling posted on 1 Mar 2010 4:00 AM

Hi Chad,

In your Microsoft XNA Game Studio 3.0 Unleashed book, you used an image, skybox.tga, as the skybox image. I am trying to create a new .tga image to replace it, but I am not sure of what are the requirements for it. I have created a new .tga image with the six sides in correct order but upon loading of the game itself, the skybox does not appear, and there are no errors upon compile time.

Any assistance rendered would be greatly appreciated. Thank you!

Answered (Verified) Verified Answer

Top 25 Contributor
3 Posts

1024x512 - where it says (in the code): width=1024 and height=512, the cellsize=256.

This allows for technically 8 possible squares that are 256x256. We only use 6 for a Cube.

for one square it goes (0,0) to (256,256). next square would be (256, 0) to (512, 256), third (512, 0) to (768, 256), fourth (768, 0) to (1024, 256)

fifth (0, 256) to (256, 512) - and finally the sixth is (256, 256), (512, 512).

Top 10 Contributor
Male
135 Posts

Check the Using the Skybox section in Chapter 8.  The skybox will be created at unit scale (1.0) and you can scale it up or down to fit your world needs.

world = Matrix.CreateScale(5000.0f);
skybox.Draw(camera.View, camera.Projection, world);

 

Hope this helps!

Chad

 

All Replies

Top 25 Contributor
3 Posts

1024x512 - where it says (in the code): width=1024 and height=512, the cellsize=256.

This allows for technically 8 possible squares that are 256x256. We only use 6 for a Cube.

for one square it goes (0,0) to (256,256). next square would be (256, 0) to (512, 256), third (512, 0) to (768, 256), fourth (768, 0) to (1024, 256)

fifth (0, 256) to (256, 512) - and finally the sixth is (256, 256), (512, 512).

Top 25 Contributor
2 Posts

Hi, another question: how do we define the size of the skybox that is generated?

Top 10 Contributor
Male
135 Posts

Check the Using the Skybox section in Chapter 8.  The skybox will be created at unit scale (1.0) and you can scale it up or down to fit your world needs.

world = Matrix.CreateScale(5000.0f);
skybox.Draw(camera.View, camera.Projection, world);

 

Hope this helps!

Chad

 

Page 1 of 1 (4 items) | RSS
© 2011 Chad Carter. All rights reserved.