Jump to content
  • Advertisement
Sign in to follow this  
Matt_Aufderheide

Making a planet using marching cubes/voxels

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

[sharedmedia=gallery:albums:1109]
pic showing current results
 

HI, I'm working on a planet renderer using voxel chunks and marching cubes.

 

The problem I'm having seems pretty simple. The function I'm using to define a sphere in the voxel data isn't working....I'll explain...

 

Basically I represent the planet as a number of cubical chunks of voxel data arranged in a big sphere.  Although I intend to use 3d noise to make terrain shapes later, right now I'm just trying to make a smooth sphere of a certain radius. Obviously, this sphere will be be made up of multiple chunks.

 

I should have enough chunks layered so that I can extract an isosurface for each at a given radius ..this should give me my basic planet.

 

each voxel chunk is currently an 8x8x8 block of float values.

 

to define a sphere in the voxel data I am currently using this function: radius-vector_length(voxelpos);

 

This assumes that the voxel position is the worldspace position (x,y,z) of each voxel. Each voxel should have a unique position..  The length of that vector is used because I assume the center of the planet is at 0,0,0

 

The position of a voxel is calculated this way...

voxelpos.x = ?position_in_chunk + chunk_position

 

 

Anyway... I hope this is enough information to make some sense of what IM asking. The result is not what I want, with the geometry in each chunk seeming offset somehow, and the angle of the surfaces off... I'm pretty sure the marching cubes method I'm using is working OK

Edited by Matt_Aufderheide

Share this post


Link to post
Share on other sites
Advertisement

Is this just a bug, or do you see a conceptual issue that you'd like us to resolve?

your basic idea seems fine, it just looks like a bug.

- try using one big chunk first instead of the chunked method to verify.

- try using simple voxel boxes first instead of marching cubes

Share this post


Link to post
Share on other sites
[sharedmedia=gallery:images:7685]
 
Well it works fine when using only a single chunk.. so the problem is how I'm using multiple chunks.. at least I know the basic method is working OK..
 

 

Share this post


Link to post
Share on other sites

Ok got it working.. basically it was just a matter of flipping some of the corrdinates around, there was nothing really wrong with the system. I just had to flip z/y in one place that I had missed earlier.. it funny how these simple bugs can drive you absolutely crazy, and you start questioning your basic concept...

 

Thanks

Share this post


Link to post
Share on other sites

Funny. I just posted a topic on "how do you make one"..... didn't look at the posts to see if anyone had posted similar.

 

Can you point me in the right direction to learn how to do that? Do you know of any limitations on size of the planet? Is your method using some kind of LOD like quadtree?

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.

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!