|
![](/i/fill.gif) |
'inside_vector', just like 'hollow', seems to be kind of magical to a lot of
users... AFAIK there is NO NEED to specify inside_vector if you want to use
a properly closed mesh in CSG, since the default will do just fine. If
there are holes, or other abnormalities, it might work, but in some cases
only if you carefully specify an inside_vector. This should not be done
randomly. The idea of the inside_vector, AFAIK, is as follows:
to check if a specific point is inside the triangle-mesh, POV-Ray traces a
ray in the direction of inside_vector and counts the intersections with the
mesh. If there's an odd number of intersections, the point is inside the
mesh, an even number indicates that the point is outside the mesh. The
problem arises if inside_vector points towards an abnormality (a hole in the
mesh for instance), I suppose it's obvious what can go wrong in such cases.
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Warp" <war### [at] tag povray org> wrote in message
news:48f7b570@news.povray.org...
> Zeger Knaepen <zeg### [at] povplace com> wrote:
>> 'inside_vector', just like 'hollow', seems to be kind of magical to a lot
>> of
>> users... AFAIK there is NO NEED to specify inside_vector if you want to
>> use
>> a properly closed mesh in CSG, since the default will do just fine.
>
> I think you are confusing meshes+CSG with meshes+media.
no, I wasn't
> The inside_vector indeed has nothing to do with media or other 'interior'
> features, and would be completely needless with them. As long as the mesh
> forms a closed surface, media inside it will render just fine.
I know, or at least I never saw any reason why it shouldn't
> However, inside_vector *is* needed for intersection, difference and merge
> CSG to work properly with meshes. This is because these operations require
> to know if a given point is inside the mesh or not. If you don't use it,
> POV-Ray won't be able to calculate CSG properly in all situations.
you're saying there's no default-value for inside_vector? I've never
actually tried it, I just assumed so...
let's try something...
-- START CODE --
camera {location <2,3,-10> look_at 0}
light_source {<750,250,-500> rgb 1}
light_source {<500,500,-500> rgb <.5,.4,.3> shadowless}
#local Cube=mesh {
triangle {<-1,-1,-1>,<-1,1,-1>,<1,1,-1>}triangle
{<-1,-1,-1>,<1,1,-1>,<1,-1,-1>}
triangle {<-1,-1,1>,<-1,1,1>,<1,1,1>}triangle {<-1,-1,1>,<1,1,1>,<1,-1,1>}
triangle {<-1,-1,-1>,<-1,-1,1>,<1,-1,1>}triangle
{<-1,-1,-1>,<1,-1,1>,<1,-1,-1>}
triangle {<-1,1,-1>,<-1,1,1>,<1,1,1>}triangle {<-1,1,-1>,<1,1,1>,<1,1,-1>}
triangle {<-1,-1,-1>,<-1,-1,1>,<-1,1,1>}triangle
{<-1,-1,-1>,<-1,1,1>,<-1,1,-1>}
triangle {<1,-1,-1>,<1,-1,1>,<1,1,1>}triangle {<1,-1,-1>,<1,1,1>,<1,1,-1>}
//inside_vector x
}
intersection {
object {Cube}
sphere {0,1.5}
pigment {rgbt .5}
}
-- END CODE --
hmm, indeed, without inside_vector, POV-Ray doesn't seem to even try to
check if a point is inside the mesh... why not? a default inside_vector
seems trivial to me (if a mesh is well formed and closed, any vector will
do, if it isn't, any vector still has a reasonable amount of chance it will
work, so any vector should work in most cases) and result in the behaviour
most users would expect (I actually had troubles figuring out why the
background showed through the CSG).
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
![](/i/fill.gif) |