|
|
Mike Metheny wrote:
>
> Will someone please tell me why the following code renders as it does?
> (place a camera at <0,0,-12>)
>
> sphere{<0,0,0>,5 pigment{rgbf<0,0,1,.5>}}
> sphere{<0,0,0>,2.5 translate -2.5*x pigment{rgbt<1,1,0,.5>}}
> sphere{<0,0,0>,2.5 translate 2.5*x pigment{rgbt<1,1,0,.5>}}
>
> gives me the image attached. now; is it me, or, shouldn't the edges of the
> small spheres meet perfectly with the edge of the big sphere? I say this is
> a stupidity problem simply because, well, it's obviously something simple
> i'm not getting.
>
> --
>
> Mike Metheny
You are correct in assuming the misconception on your part was the key
player in this little drama. A sphere represented as:
sphere { <0,0,0>, 1 = a sphere "2" units across !!!
A sphere with a radius of 1 is 2 units across. The sphere object
is defined by it's radius and not it's diameter. With this in mind
you can see where your large sphere is 10 units wide ( 5*-x and 5*x)
and each of the two 2.5 unit spheres are suffering the same fate.
To have them kiss surfaces at the outside edge of the larger sphere
your translate values should be 7.5 and not 2.5 as used above.
Beware of the same trap with the box object. If you specify it
as box { <-1,-1,-1>,<1,1,1> } you will have a box that is 2 units
wide and not one unit like it might appear at a glance. Where the
comma is between the two fields can be though of as your origin line.
The illustrated example shows you are designating the objects walls
at -1, +1 from that origin point. 1 + 1 = 3 : )
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
|