Advertisement Jump to content
Sign in to follow this  

OpenGL skysphere solved

This topic is 4814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I finally figured out how to make a skysphere for my space game. And even though I am probably the only person who has trouble with things like this, I still thought it would be nice to post what I did, just in case it might help anone else. 1. Load up Milkshape and create a GeoSphere centered on the origin. 2. Export this object to a Wavefront .obj file. 3. Load UV Mapper Classic, and open the .obj file from Milkshape. 4. Select Edit--> New UV Map--> Box (Box seems to keep most of the triangles their original size. 5. Scale and move the Vertices in UV mapper to fit nicely on the screen. 6. Save the object in UV Mapper and save the texture in UV Mapper. 7. Now you can load the texture up in a paint program and draw your stars or whatever. If your using OpenGL you can then resize the texture to something like 512x512. 8. Open Milkshape again, and import the .obj file saved from UV Mapper. 9. Create a new material with the texture you created, and apply it to the object. 10. Now you can save the object in the .ms3d format (milkshape format). 11. Go read up on the tutorial for loading milkshape models at 12. In your own program you can scale and position the sphere, also you can inverse the order of drawing so the sphere faces inward (sky sphere style) 13. Just remember to draw the sphere first, before other objects, and use glDepthMask() to keep the sphere from depth sorting, and most importat, keep the sphere positioned with its center at the camera location. Thats it Well I hope this might be of some help to someone.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!