Re: Point in Triangle

Desiree,

Your question is really one for Bill Hibbard, the developer of VisAD.
Unfortunately, he's travelling, so the rest of us will try to help.

Unfortunately again, I'm not familiar with triangulation algorithms
(though I am familiar with VisAD).  If I had to guess, I'd suggest
that you create the Irregular2DSet with a Delaunay triagulation that
you explicitly obtain from the Delaunay.factory(...) method.  You
should then be able to use the fields in the triagulation (Edges,
Tri, Vertices, etc.) to discover in which triangle a point resides
(assuming you're familiar with Delaunay triagulation).  For help on
this, you might want to look at the getNeighbors(...) method in class
IrregularSet.

Hope this helps.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>

>Date: Thu, 22 Feb 2001 16:16:54 +0100 (MET)
>From: Desiree Hilbring <hilbring@xxxxxxxxxxxxxxxxxxxx>
>Organization: UCAR/Unidata
>To: visad-list@xxxxxxxxxxxxx
>Subject: Point in Triangle
>Keywords: 200102221519.f1MFJML15618
>
> Hi,
> 
> I have a given set of 3D-point and the x,y-coordinates of one point
> somewhere in my set of points. I
> want to interpolate the height of the point. 
> I want to add this point in my set and use the Delaunay-Triangulation of
> VisAD. 
> Without this extra point the Delaunay Triangulation is working fine.
> 
> RealType x = RealType.getRealType("x");
>       RealType y = RealType.getRealType("y");
>       RealType height = RealType.getRealType("height");
>       try {
>           RealTupleType xy = new RealTupleType(x, y);
>           FunctionType terrain_type = new FunctionType(xy, height);
>           Irregular2DSet set = new Irregular2DSet(xy,new float[][]
> {eastValues,northValues});
>           FlatField terrain = new FlatField(terrain_type, set);
>           terrain.setSamples(new float[][] {heightValues});
>                   
>           display = new DisplayImplJ3D("display1");
>           ScalarMap hoxmap = new ScalarMap(x, Display.XAxis);
>           ScalarMap reymap = new ScalarMap(y, Display.YAxis);
>           ScalarMap heightmap = new ScalarMap(height, Display.ZAxis);
>                   
>           display.addMap(hoxmap);
>           display.addMap(reymap);
>           display.addMap(heightmap);
>               
>           hoxmap.setRange(-1.0, 1.0);
>           reymap.setRange(-1.0, 1.0);
>           heightmap.setRange(-1.0, 1.0);
>           
>           DataReferenceImpl data_ref = new
> DataReferenceImpl("data_ref"); 
>           data_ref.setData( terrain );
>           renderer = new DefaultRendererJ3D();
>           display.addReferences(renderer,data_ref);
>           display.addDisplayListener(listener);
>       }
>       catch (VisADException ve) {
>           System.out.println("VisAd TupleType Exception");
>       }       
>       catch (RemoteException re) {
>           System.out.println("RemoteExcpetion");
>       }
> 
> How can I find the triangle in which the point belongs to?
> Are there some standard geometric algorithms to achieve that?
> Where do I have to look at.
> 
> Thanks for your help in advance
> 
> Desiree
> 
> 
> 
> o------------------------------------------------------------------------o
> | Desiree Hilbring    Institut fuer Photogrammetrie und Fernerkundung  | 
> |                     Universitaet Karlsruhe, Germany                  |
> |                                                                        |
> |                     email: hilbring@xxxxxxxxxxxxxxxxxxxx             |
> |                             # 0721 6083676                                  
>  |
> o------------------------------------------------------------------------o


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: