 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> But that's wrong, the inside_vector is defining the direction for making
> the insideness test. With well made meshes you can use *any* vector for
> this purpose.
Ah, I didn't know that. I guess that's another way to do it =)
To be honest, I didn't think POV-Ray 3.5 had implemented solid meshes.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> (How could POV-Ray determine if some point is inside
> the mesh or not using the information that another point is inside it?)
To determine if point A is inside the mesh, with the information that point
B *is*, shoot a ray from point A to point B, counting the number of times it
intersects the mesh. If it intersects an even number of times (counting 0 as
even), then A is inside the mesh.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> Christoph Hormann <chr### [at] gmx de> wrote:
> > With well made meshes you can use *any* vector for
> > this purpose.
>
> I think that the idea is that you should preferably choose a vector which
> is not parallel to any of the triangles because those triangles might cause
> some problems. AFAIK.
And how would you know that in the first place?
--
Ken Tyler
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 5 Sep 2002 15:48:39 -0400, Warp <war### [at] tag povray org> wrote:
> > IIRC You have to point any point inside mesh to specify which side of mesh is
> > defined as inside. inside_vector is not direction, it is a point.
>
> No, that's not it.
So what ?
> (How could POV-Ray determine if some point is inside
> the mesh or not using the information that another point is inside it?)
Counting walls between point and inside_vector ?
ABX
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Thu, 05 Sep 2002 21:45:11 +0200, Christoph Hormann <chr### [at] gmx de>
wrote:
> inside_vector is defining the direction
Hmm, I always understood this other way, hmm.
ABX
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Slime <slm### [at] slimeland com> wrote:
> To determine if point A is inside the mesh, with the information that point
> B *is*, shoot a ray from point A to point B, counting the number of times it
> intersects the mesh. If it intersects an even number of times (counting 0 as
> even), then A is inside the mesh.
Possibly, but AFAIK the intersection test of a ray and the mesh returns
all the intersections, so you would have to discard those which are farther
away than the segment AB. A much easier solution is just to shoot a ray
to some direction and if it returns an odd number of intersections, then
it's inside... :)
Besides, that avoids the problem that you accidentally give a wrong B
(ie. one which is actually outside the mesh).
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
> And how would you know that in the first place?
Often you can't. However, if you have a mesh created by a modeller, the
probability that a triangle is exactly parallel to a random vector you
give is really small. On the other hand, if you have made a mesh yourself,
eg. a polyhedron, with clearly oriented triangles, you will know how to
orient the inside_vector so that it's not parallel to any of them.
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Ernst Fritsch" <ern### [at] cityweb de> wrote in message
news:web.3d779780d2c57d2a751dcdca0@news.povray.org...
<snip>
Judging from the various responses, it would seem a minor clarification in the
docs might be a good idea ;)
Catch-22 (no. 600) Only a person who understands a concept can explain it. Only
a person who doesn't understand a concept can decide whether the explanation is
complete.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Slime <slm### [at] slimeland com> wrote:
>
>>To determine if point A is inside the mesh, with the information that point
>>B *is*, shoot a ray from point A to point B, counting the number of times it
>>intersects the mesh. If it intersects an even number of times (counting 0 as
>>even), then A is inside the mesh.
>>
>
> Possibly, but AFAIK the intersection test of a ray and the mesh returns
> all the intersections,
It should, but the mesh code is 'optimised' to return only the nearest.
At least it was so in 3.1 code. It was one of the two reason Mesh where
bad in CSG (there is a kludge in the mesh code testing if the
intersection is part of a CSG or not, if not only the first intersection
was computed).
And I still do not trust mesh now.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tom Melly wrote:
>
> [...]
>
> Catch-22 (no. 600) Only a person who understands a concept can explain it. Only
> a person who doesn't understand a concept can decide whether the explanation is
> complete.
No, a person not familiar with the details is qualified to decide whether
an explanation is generally understandable but not whether it is
complete.
The text about inside_vector is surely not the easiest to understand for
the beginner but it is correct and precisely and completely describes how
things work. Some hints how to choose the inside vector would be useful
probably but not mandatory IMO.
Christoph
--
POV-Ray tutorials, IsoWood include,
TransSkin and more: http://www.tu-bs.de/~y0013390/
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |