Jump to content
  • Advertisement
Sign in to follow this  
SelethD

OpenGL skysphere solved

This topic is 4727 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 www.nehe.gamedev.net 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!