Jump to content
  • Advertisement
Sign in to follow this  
Yoyoyoyo

Making a sphere XNA

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

Ok, so i've been searching but couldn't find a way. I want to generate a sphere with normals, and texture uv coords.

If perhaps someone can share their knowledge on the matter.

I don't want to use a model as i want control over the sphere(LOD etc).

Share this post


Link to post
Share on other sites
Advertisement

Ok, so i've been searching but couldn't find a way. I want to generate a sphere with normals, and texture uv coords.

If perhaps someone can share their knowledge on the matter.

I don't want to use a model as i want control over the sphere(LOD etc).


You can generate a sphere by imagining it as a set of quads determined by the lines of latitude and longitude, much like the surface of the earth. Each vertex of the sphere is intersection of latitude and longitude, the tex coordinates are determined by the angles of the component vectors, and the normals are formed by the vector that passes through that point on the surface of the sphere. You can create latitude and longitude by rotating an axis vector about the various axes. This should be enough information to get started, and I do have code handy that already does this, but I am assuming you would prefer to figure this out with a bit of help?

Share this post


Link to post
Share on other sites
I will absorb that! (Put's kettle on for a cup of coffee)..


..Rotating an axis vector about the various axes.

This bit i find hard to visualise.

Share this post


Link to post
Share on other sites

I will absorb that! (Put's kettle on for a cup of coffee)..


..Rotating an axis vector about the various axes.

This bit i find hard to visualise.


(If Z is the up vector) A Z unit vector rotated about the Y or X axes gives you the latitude and rotating an X or Y unit vector about the Z axis gives you longitude. This is essentially the basics behind spherical coordinates that Daaark has linked you to, and that website explains it well.

Share this post


Link to post
Share on other sites
Thanks a lot guys. Once i get a handle on it all id like to make a short tutorial for fellow noobs out there.


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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!