Public Group

# 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.

## 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 on other sites

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 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 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 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.

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 11
• 27
• 12
• 12
• 11
• ### Forum Statistics

• Total Topics
631407
• Total Posts
2999914
×