POV-Ray : Newsgroups : povray.newusers : Faceted sphere? : Re: Faceted sphere? Server Time
29 Jul 2024 20:27:00 EDT (-0400)
  Re: Faceted sphere?  
From: X-Caliber
Date: 7 Mar 2005 23:15:01
Message: <web.422d260f1e707c60e6ef12d50@news.povray.org>
Shay <ema### [at] yourhostcom> wrote:
> Planes are three dimensional. You are looking at the surface, but
> everything "below" the surface is considered inside the plane. Look at
> this object, for instance:
>
> intersection {
>    plane { x, 1 }
>    plane { -x, 1 }
>    plane { y, 1 }
>    plane { -y, 1 }
>    plane { z, 1 }
>    plane { -z, 1 }
>    pigment { rgb y }
> }
> camera {
>    location <5,5,5>
>    look_at <0,0,0>
> }
> light_source {
>    <25,250,500>
>    color rgb 1
> }
>
> This makes a cube. Intersecting planes can also be rotated to make a
> faceted sphere, although a mesh would be tons easier. Rotate points
> around an axis and then connect the points with triangles.

Cool demo.

I dunno how to do it meshwise, so I ended up with an object intersection
define of 56 planes which gets intersected with itsself later on. Heres the
short version...


camera {
 location <1, 2.5, 4>
 look_at <0, 0, 0>
}

light_source { <5, 5, 3> color <1, 1, .8> }
light_source { <-5, 0, 3> color <1, .8, 1> }
light_source { <5, 0, -3> color <.8, 1, 1> }

background {}

#declare CircCount = 7;
#declare VertCount = 8;
#declare CircFreq = 360 / CircCount;
#declare VertFreq = 180 / VertCount;

#declare HalfBoingSlice =
 intersection {
  plane { z, 2 rotate <-VertFreq*3.5, 0, 0> }
  plane { z, 2 rotate <-VertFreq*2.5, CircFreq*0.5, 0> }
  plane { z, 2 rotate <-VertFreq*1.5, 0, 0> }
  plane { z, 2 rotate <-VertFreq*0.5, CircFreq*0.5, 0> }
  plane { z, 2 rotate <VertFreq*0.5, 0, 0> }
  plane { z, 2 rotate <VertFreq*1.5, CircFreq*0.5, 0> }
  plane { z, 2 rotate <VertFreq*2.5, 0, 0> }
  plane { z, 2 rotate <VertFreq*3.5, CircFreq*0.5, 0> }
 }

#declare HalfBoing =
 intersection {
  object { HalfBoingSlice }
  object { HalfBoingSlice rotate CircFreq*y }
  object { HalfBoingSlice rotate CircFreq*2*y }
  object { HalfBoingSlice rotate CircFreq*3*y }
  object { HalfBoingSlice rotate CircFreq*4*y }
  object { HalfBoingSlice rotate CircFreq*5*y }
  object { HalfBoingSlice rotate CircFreq*6*y }
  object { HalfBoingSlice rotate CircFreq*7*y }
 }


object {
 intersection {
 object { HalfBoing pigment { color <1, .2, .2> } }
 object { HalfBoing pigment { color <1, 1, 1> } rotate <0, CircFreq*0.5, 0>
}
 }
 bounded_by {sphere {0, 2.2}}
}


Post a reply to this message

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