POV-Ray : Newsgroups : povray.general : inside_vector ??? Server Time
5 Aug 2024 18:21:03 EDT (-0400)
  inside_vector ??? (Message 11 to 20 of 27)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>
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

From: Tom Melly
Subject: Re: inside_vector ???
Date: 6 Sep 2002 05:26:25
Message: <3d7874c1$1@news.povray.org>
"Ernst Fritsch" <ern### [at] citywebde> 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

From: Le Forgeron
Subject: Re: inside_vector ???
Date: 6 Sep 2002 05:37:11
Message: <3D787760.6040002@free.fr>
Warp wrote:

> 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,


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

From: Christoph Hormann
Subject: Re: inside_vector ???
Date: 6 Sep 2002 05:40:52
Message: <3D787825.B3AE949F@gmx.de>
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

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

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