|
![](/i/fill.gif) |
Please help !!!
I can't get this working:
the intersection between an isosurface (a sphere for testing purposes)
and a union of complex CSG. The only result I can get is the
intersection of the surfaces, not the solid objects...
I use this code:
camera {
location <-8,6, -10>
right x*4/3
up y
angle 40
look_at <0, 1, 1.5>
}
light_source { <40, 30, -10> color rgb .9 }
light_source { <-40, 20, 10> color rgb .2 }
#declare T_Text = texture {
pigment { color rgb <255, 0, 0>/255 }
finish { ambient .4 diffuse .6 }
}
#macro Rounded_Tower(MajRayon1, MajRayon2, MinRayon2, Taille)
union {
cylinder { <0,Taille - MajRayon2 -.1,0>, <0,Taille,0>, MajRayon2 }
torus { MajRayon2, MinRayon2 translate y*(Taille - MinRayon2) }
cone { <0,0,0>, MajRayon1, <0,Taille - MinRayon2,0>,
MajRayon2+MinRayon2 }
texture { T_Text }
}
#end
#macro Rounded_Wall(Longueur, Largeur, Angle, Rayon, Taille)
union {
box { <0, -Taille/cos(radians(Angle)), -Rayon>, <Longueur, 0,
Largeur*.5>
rotate Angle*x
translate <0, Taille-Rayon, -Largeur*.5+Rayon>
}
box { <0, -Taille/cos(radians(Angle)), -Largeur*.5>, <Longueur, 0,
Rayon>
rotate -Angle*x
translate <0, Taille-Rayon, Largeur*.5-Rayon>
}
cylinder { <0, 0, 0>, <Longueur, 0, 0>, Rayon
translate <0, Taille-Rayon, -Largeur*.5+Rayon>
}
cylinder { <0, 0, 0>, <Longueur, 0, 0>, Rayon
translate <0, Taille-Rayon, Largeur*.5-Rayon>
}
box { <0, 0, -(Largeur*.5-Rayon)>, <Longueur, Taille,
(Largeur*.5-Rayon)> }
texture { T_Text }
}
#end
intersection {
/* sphere { 0, 1
scale <6, 3, 3>
translate <-2,0,2>
texture { T_Text }
}*/
isosurface {
function { sqrt(x*x+y*y+z*z) -1 }
threshold 0
bounded_by { sphere { 0, 1.2 } }
max_trace 10
scale <6, 3, 3>
translate <-2,0,2>
texture { T_Text }
}
union {
object {
Rounded_Tower(1.2, .8, .1, 2)
translate -3*x
}
object {
Rounded_Tower(1.2, .8, .1, 2)
translate 3*x
}
object {
Rounded_Wall(6, 1.2, 15, .2, 1.5)
translate -3*x
}
}
}
If you replace the sphere isosurface by a sphere primitive, you obtain
the good results....
What I'm doing wrong ????
I can't get an explanation, help please ....
Bouf.
Post a reply to this message
|
![](/i/fill.gif) |