View Full Version : sphere
05-18-2004, 12:41 AM
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... :(
05-18-2004, 06:59 AM
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.
05-18-2004, 09:59 AM
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.
05-18-2004, 09:21 PM
Thanks for advices. The second method seems quite natural. I didn't 'discover' polyhedrons yet :)
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.