comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » point inside/outside of 3D object.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: point inside/outside of 3D object. [message #76637 is a reply to message #76567] Mon, 20 June 2011 12:57 Go to previous message
Karl[1] is currently offline  Karl[1]
Messages: 79
Registered: October 2005
Member
On Jun 20, 7:49 am, Wox <s...@nomail.com> wrote:
> On Fri, 17 Jun 2011 12:47:36 -0700 (PDT), Karl
>
> <karl.w.schu...@gmail.com> wrote:
>> I'm not sure you'd want to draw a tet with an ROI.  A tet can be drawn
>> with a grPolygon.  You would supply the 4 verts and then the
>> connectivity list which would be something like:
>
>> [3,0,1,2, 3,1,0,3, 3,2,1,3, 3,0,2,3]
>
>> The order is important to make all the faces facing "out".  If any of
>> these are wrong, reverse the order.  E.g., if the last tri is facing
>> the wrong way, change 3,0,2,3 to 3,3,2,0.
>
> Could you elaborate on that?
>
> I understand that the normal vector on each trianglular face of the
> polyhedron should point outwards. So if you take the three vertices of
> a triangle, they should be ordered so that when using the "right-hand
> rule", the normal points outwards.
>
> Lets mark the vertices of a tetrahedron Red, Green, Blue and Gray
> (http://tinypic.com/r/513fau/7). So the ordered vertices for each
> triangle should be
> back: Red-Green-Blue  (equivalents: Green-Blue-Red, Blue-Red-Green)
> front-right: Red-Gray-Green
> front-left: Red-Blue-Gray
> bottom: Green-Blue-Gray
>
> So how do the quadruples come into play?

The first "3" is the number of indices that follow that contribute to
the next face. I believe that is how the connectivity list is defined
in IDLgrPolygon. Please see the docs for IDLgrPolygon.

If you put your vertices into an array v in this order: Red, Green,
Blue, Gray

Then your connectivity list that you'd pass to IDLgrPolygon along with
the vertex array v would be:

3,0,1,2, 3,0,3,1, 3,0,2,3, 3,1,2,3

Although I think you want Green-Gray-Blue for the bottom. You want
the normal for the bottom to point down, giving:

3,0,1,2, 3,0,3,1, 3,0,2,3, 3,1,3,2

which is equivalent to the first list I gave:

>> [3,0,1,2, 3,1,0,3, 3,2,1,3, 3,0,2,3]

taking different starting positions into account.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: plotting a sub field image..
Next Topic: ENVI: Overlay in 3D SurfaceView

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:12:54 PDT 2025

Total time taken to generate the page: 0.00581 seconds