View Full Version : Cut a sphere??

05-31-2005, 06:44 AM
I want to use three clip plane(1,0,0,0)(0,1,0,0)(0,0,1,0) to cut a sphere,the results is leaving 1/8 sphere.
However, I need the others 7/8 sphere!
Who can give me some methods to implement it ??

05-31-2005, 09:36 AM
Well I don't see any way to do it with clipping planes and I don't know if this is the best method but one idea would be to use texturing.

You could unroll a sphere onto a 2D texture and then assign an alpha of 0 to the 1/8 section of the sphere that you do not want to draw. (The RGB channels would be all 1s and your TexEnv mode would be set to Modulate)

You can then use the alpha test to discard fragment with an alpha of 0 so your 1/8th section will not be drawn.