Jump to content
  • Advertisement
Sign in to follow this  
helix

Procedurally Generated Spheres

This topic is 4878 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

Wow, I thought finding some source for this online would be like shooting fish in a barrel. Yet every single search I've tried has turned up nothing. I've found some much more complex stuff than I'm looking for however (I'd like to try that in the future once I get some simple spheres going). All I want is something like the implementation to D3DXCreateSphere. I want to specify a radius, and model complexity and have a vertex (and an index) buffer filled as a result. I'd be happy just with some code that makes a static sphere but handles the UV's and normals. I know I've seen code in the past for this but I can't believe it's so hard to find now. Can some one point me in the direction of a tutorial or some code? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Here's a link to an old thread where I posted (C++) source code for a couple of types of procedural spheres. They don't include normals or texture coordinates, but normals are dead easy anyway and texture coordinates depend on what sort of texture you're mapping.

Share this post


Link to post
Share on other sites
Once, i sent a procedural sphere to the Nehe site , it was done with a new kind of tessellation, using triangles, not squares to avoid the pole problem when textures merge , but he didn't upload them on the site.Anyway i still have the code on some hd of mine

Share this post


Link to post
Share on other sites
"it was done with a new kind of tessellation, using triangles"

How was it different from a standard GeoSphere?

Share this post


Link to post
Share on other sites
Thanks for the suggestions. I've printed out that tutorial and have looked through the other code snippets posted. They're not exactly what I was looking for but unless someone has any other suggestions I guess I'll try to make it work.

What I really was after was filling a vertex/index buffer with data to make a texture mapped planet. Part of my problem is making it textured seamlessly with no seams or tears and it didn't look like any of these examples really covered that. I think I have some textures that should work all right but then again, I think they are probably better for cylinders...

What irritates me is that I had code to do this at one time but thanks to a hard drive failure, I no longer have it.

Share this post


Link to post
Share on other sites
THAT is the way to texture a geosphere :)

Or that's the way I'd use anyway.

Problem is, to generate the texture in the first place.

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net 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!