Hi. In computer games, "skyboxes" are basically inverted textured cubes that give the illusion of being the backdrop landscape/sky for the game world. When the player moves, the skybox moves with him, giving the illusion that the player never reaches the cube.
Celestia seems like an ideal program to generate a realistic star skybox for the game I am creating. I think that I need to set the FOV to 90, which is easily accomplished by:
set { name "FOV" value 90.0 }
But I am a bit confused by the scripting for movement/rotating the camera.
I need to set the camera by the sun or another location in space. Then I need to precisely rotate the camera 90 degrees in different directions. I can then manually take screenshots. These screenshots will become the 6 textured sides of the cube. Executing the following code seems to keep changing the position of the camera each time it is executing (with the simulation paused), but I'm not sure I understand why:
#goto { [0.0 0.0 0.0] }
setposition {
base [ 0.0 0.0 0.0 ]
offset [ 0.0 0.0 0.0 ] }
setorientation {
angle 0.00
axis [ 0.00 0.0 0.0 ] }
Does anybody have any suggestions? Like I said, I just need to know how to set the camera at a certain coordinate, and then rotate the camera from that reference point precisely in 90 degree increments.
generating a game skybox with Celestia
The axis values must not all be set to zero.
One description of the Axis,Angle orientation specification is at
http://www.euclideanspace.com/maths/geo ... /index.htm
One description of the Axis,Angle orientation specification is at
http://www.euclideanspace.com/maths/geo ... /index.htm
Selden
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
Re: generating a game skybox with Celestia
Cigaboo wrote:Hi. In computer games, "skyboxes" are basically inverted textured cubes that give the illusion of being the backdrop landscape/sky for the game world. When the player moves, the skybox moves with him, giving the illusion that the player never reaches the cube.
Celestia seems like an ideal program to generate a realistic star skybox for the game I am creating. I think that I need to set the FOV to 90, which is easily accomplished by:
set { name "FOV" value 90.0 }
But I am a bit confused by the scripting for movement/rotating the camera.
I need to set the camera by the sun or another location in space. Then I need to precisely rotate the camera 90 degrees in different directions. I can then manually take screenshots. These screenshots will become the 6 textured sides of the cube. Executing the following code seems to keep changing the position of the camera each time it is executing (with the simulation paused), but I'm not sure I understand why:
#goto { [0.0 0.0 0.0] }
setposition {
base [ 0.0 0.0 0.0 ]
offset [ 0.0 0.0 0.0 ] }
setorientation {
angle 0.00
axis [ 0.00 0.0 0.0 ] }
Does anybody have any suggestions? Like I said, I just need to know how to set the camera at a certain coordinate, and then rotate the camera from that reference point precisely in 90 degree increments.
You probably want the following:
Code: Select all
setorientation { angle 0 axis [ 0 1 0 ] }
setorientation { angle 90 axis [ 0 1 0 ] }
setorientation { angle 180 axis [ 0 1 0 ] }
setorientation { angle -90 axis [ 0 1 0 ] }
setorientation { angle 90 axis [ 1 0 0 ] }
setorientation { angle -90 axis [ 1 0 0 ] }
You'll still have to do some combination of rotating and flipping the screenshots in your image editing program.
--Chris
Thanks, guys. Much appreciated. If I am successful, should be much cooler than some randomly generated starfield. BTW, are Celestia's star color values somewhat exaggerated? I will probably want to desaturate the colors a bit in Photoshop. And is Celestia's representation of the Milky Way galaxy (the cloudy greyish band) an accurate depiction of what you would see with the unaided eye from space, or should I disable it from within Celestia?
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
Cigaboo wrote:Thanks, guys. Much appreciated. If I am successful, should be much cooler than some randomly generated starfield. BTW, are Celestia's star color values somewhat exaggerated? I will probably want to desaturate the colors a bit in Photoshop. And is Celestia's representation of the Milky Way galaxy (the cloudy greyish band) an accurate depiction of what you would see with the unaided eye from space, or should I disable it from within Celestia?
DISABLE...
The more you disable from Celestia for your game, the happier I am
Bye Fridger