 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Slime wrote:
>
> [...]
> Now, if you can understand the explanation of how it's used, then it's clear
> how to choose it. But I agree that a statement such as "choose a point
> inside the mesh for inside_vector" would be appropriate for less
> mathematically inclined users, if such a statement isn't already in there.
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.
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
ABX <abx### [at] abx art pl> 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. (How could POV-Ray determine if some point is inside
the mesh or not using the information that another point is inside it?)
--
#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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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.
--
#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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |