|
|
Wasn't it Jettero Heller who wrote:
>I hope I'm doing something stupid so I can get past this and move
>on with my project. I have included some sources so you can
>catch my drift...
>
>When c=1, you'll see a cute little scene with a pyramid cut
>across by a thick plane. Excellent. Almost what I want. Then,
>when c=2, you'll see me cutting a hole out of the plane. Pretty
>predictable stuff.
>
>And finally, when c=3, I'm intending to cut a rhomboid thingy out
>of the plane, but instead I'm getting the rhomboid as if I'd
>accidentally used intersection instead of difference.
>
>How can I cut out the rhomboid instead of ... whatever that was.
I think there's a bug in 3.5 concerning mesh differences. The workround
is to take the inverse of the intersection with the inverse. This isn't
a perfect fix, because the object is now inside out, but if you only
want the surface it's OK.
I've used the "hollow" keyword to suppress the "camera is inside a non-
hollow object" warning, so media and fog "outside" the object will work
as expected.
#version 3.5;
#declare c = 3;
camera {
location <-3, -1, 5>
look_at <5, 1, 5>
}
light_source { <-3, -1, 5> color rgb 1 }
light_source { <7, 7, 7> color rgb 1 }
object {
#if( c = 1 )
union {
#else
intersection {
#end
box { <2, 0.7, 2> <8, 0.65, 8> }
#if( c = 2 )
cylinder { <5, -6, 5> <5, 6, 5> 1 inverse}
#else
mesh {
triangle { <3, 0, 3> <3, 0, 7> <5, 1, 5> }
triangle { <3, 0, 7> <7, 0, 7> <5, 1, 5> }
triangle { <7, 0, 7> <7, 0, 3> <5, 1, 5> }
triangle { <7, 0, 3> <3, 0, 3> <5, 1, 5> }
triangle { <7, 0, 7> <3, 0, 3> <7, 0, 3> }
triangle { <7, 0, 7> <3, 0, 3> <3, 0, 7> }
inside_vector <1, 2, 3>
inverse
}
#end
}
texture {
finish { phong 0.55 crand 0.0
specular 0.55 reflection 0.51 ambient 0.5 }
pigment { color rgb 0.7 }
}
inverse
hollow
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|