POV-Ray : Newsgroups : povray.general : inside_vector ??? Server Time
5 Aug 2024 20:22:01 EDT (-0400)
  inside_vector ??? (Message 8 to 17 of 27)  
<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Christoph Hormann
Subject: Re: inside_vector ???
Date: 5 Sep 2002 15:45:15
Message: <3D77B447.92E7D923@gmx.de>
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

From: Warp
Subject: Re: inside_vector ???
Date: 5 Sep 2002 15:48:39
Message: <3d77b517@news.povray.org>
ABX <abx### [at] abxartpl> 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

From: Warp
Subject: Re: inside_vector ???
Date: 5 Sep 2002 16:35:09
Message: <3d77bffd@news.povray.org>
Christoph Hormann <chr### [at] gmxde> 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

From: Slime
Subject: Re: inside_vector ???
Date: 5 Sep 2002 16:44:21
Message: <3d77c225$1@news.povray.org>
> 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

From: Slime
Subject: Re: inside_vector ???
Date: 5 Sep 2002 16:46:04
Message: <3d77c28c$1@news.povray.org>
> (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

From: Ken
Subject: Re: inside_vector ???
Date: 5 Sep 2002 21:06:43
Message: <3D780084.E7906F43@pacbell.net>
Warp wrote:
> 
> Christoph Hormann <chr### [at] gmxde> 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

From: ABX
Subject: Re: inside_vector ???
Date: 6 Sep 2002 02:11:08
Message: <dihgnu41hunef7ut95opb0l0g777vg07gm@4ax.com>
On 5 Sep 2002 15:48:39 -0400, Warp <war### [at] tagpovrayorg> 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

From: ABX
Subject: Re: inside_vector ???
Date: 6 Sep 2002 02:13:51
Message: <5phgnu8iah5t252v64u1iqql8fs2j8m0p9@4ax.com>
On Thu, 05 Sep 2002 21:45:11 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:
> inside_vector is defining the direction 

Hmm, I always understood this other way, hmm.

ABX


Post a reply to this message

From: Warp
Subject: Re: inside_vector ???
Date: 6 Sep 2002 05:17:07
Message: <3d787292@news.povray.org>
Slime <slm### [at] slimelandcom> 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

From: Warp
Subject: Re: inside_vector ???
Date: 6 Sep 2002 05:19:59
Message: <3d78733f@news.povray.org>
Ken <tyl### [at] pacbellnet> 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

<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.