Hello everyone,

I’ve got a question. I want to make my own functions to drawing primitives - I want to have access to particular points. Does anybody know formula to create sphere? I searched many pages but result is none…

Hello everyone,

I’ve got a question. I want to make my own functions to drawing primitives - I want to have access to particular points. Does anybody know formula to create sphere? I searched many pages but result is none…

Take some aequi-surfaced polyhedron (is that the english word?) (there was this 12 sided thingy, that is well triangulizable?) and subdivide it until some expected face-size is achieved and then project the vertices to a perfect sphere. This will yield into a sphere without much distortion and without poles.

Another approach is to specify the sphere vertices in spherical coordinates.

For any azimuth in [0,2 PI], any elevation in [-PI/2,PI/2], and a sphere radius of R

x = R * cos(azimuth) * cos(elevation)

y = R * sin(azimuth) * cos(elevation)

z = R * sin(elevation)

where the z axis goes through the poles.

You could specify an angular grid and iterate over the angles to build triangle strips, for example. Depending on the grid, this would give you so many slices and stacks in your sphere.

Thanks for advices. The second method seems quite natural. I didn’t ‘discover’ polyhedrons yet

Greets,

Ray