POV-Ray : Newsgroups : povray.general : How to fraction a sphere in slices Server Time
6 Nov 2024 04:18:27 EST (-0500)
  How to fraction a sphere in slices (Message 1 to 3 of 3)  
From: miro
Subject: How to fraction a sphere in slices
Date: 28 Apr 1998 15:57:59
Message: <6i5ceh$7vt$1@oz.aussie.org>
How can I fraction a sphere in slices as those of the oranges or lemons and
that, furthermore, they have different widths? For example, one a 40
percent, other a 10 percent, other a 30 percent  and other a 20 percent?

Thanks!


Post a reply to this message

From: Twyst
Subject: Re: How to fraction a sphere in slices
Date: 28 Apr 1998 17:44:47
Message: <6i5fbo$83j$1@oz.aussie.org>
miro wrote in message <6i5ceh$7vt$1@oz.aussie.org>...
>How can I fraction a sphere in slices as those of the oranges or lemons and
>that, furthermore, they have different widths? For example, one a 40
>percent, other a 10 percent, other a 30 percent  and other a 20 percent?
>
>Thanks!
>

Here's a quick example I just whipped up. I only did one slice, tho.


#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions


camera
{
  location  <3.0 , 0.0 ,-3.0>
  look_at   <0.0 , 0.0 , 0.0>
}


light_source
{
  0*x
  color red 1.0  green 1.0  blue 1.0
  translate <-20, 40, -20>
}
#declare Spheroid =
sphere { <0,1,0> 1 texture { Chrome_Metal } }

plane { z,2 texture { pigment { checker color White color Black } } }

union

   difference

     intersection

        object { Spheroid }
        plane { x,0 texture { Chrome_Metal } rotate <0,20,0> }
        plane { x,0 inverse texture { Chrome_Metal  } rotate <0,-20,0> }
     }
     object { Spheroid scale .9 translate <0,.1,0>}
   }
   intersection

       object { Spheroid pigment{ Blue} scale .9 translate <0,0.1,0>}
       plane { x,0 texture { Chrome_Metal pigment { Blue }  } rotate
<0,20,0> }
       plane { x,0 inverse texture { Chrome_Metal pigment { Blue }} rotate
<0,-20,0> }
   }
rotate <45,-120,0>
}

--end--
The rotation on the planes, is what makes the slice wide. Make each rotation
HALF of what you want the final width.

Hope it helps.

Twyst================================
EFnet and NewNet #povray Channel Operator
Website: http://www.geocities.com/~twystedmynd
E-Mail: twy### [at] v-wavecom
=====================================


Post a reply to this message

From: Pierre Abbat
Subject: Re: How to fraction a sphere in slices
Date: 5 Oct 1999 21:47:32
Message: <939174452.1488716342@news.povray.org>
On Tue, 28 Apr 1998, miro wrote:
>How can I fraction a sphere in slices as those of the oranges or lemons and
>that, furthermore, they have different widths? For example, one a 40
>percent, other a 10 percent, other a 30 percent  and other a 20 percent?

intersection {
  sphere{ <0,0,0>,1}
  plane {<0,0,1>,0}
  plane{ <0.618034,0,0.7861514>,0}
  }

If the sector is more than 90 degrees, do a difference, or take the
intersection of the sphere with the union of two planes.

phma


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.