From: Angus Dorbie (dorbie++at++sgi.com)
Date: 02/18/2000 13:51:50
I don't think intersection results are intended to be in depth sorted
order.
CHeers,ANgus.
Dirk Lüsebrink wrote:
>
> "Braun, Tom (UNKNOWN)" wrote:
> >
> > Has anyone had a problem with the return vector values from a isector test?
>
> yes. and the bad news is i never could figure out the exact condition causing
> the
> problem. the good news is, there is a workaround. in my case, i happend that not
> always
> the returned intersections where correctly sorted from near to far. normally you
> are
> only interested in nearest hit. my solution was to get all intersections from
> the
> isector vector and sort this list by hand. with just seven hits and a 300 MHZ
> cpu that
> is not such a performance problem, even when there are some square roots
> involved.
>
> sigh.
>
> dirk.
>
> > I have set up a isector segment to look straight down in order to perform
> > terrain following. Over most all of my terrain the Terrain Height that is
> > returned to me is correct. However, over some parts of the terrain, the
> > height of the terrain that gets reported back to me is 10 to 50 feet below
> > the actual terrain height. This usually occurs in areas where many (more
> > than 7) polygon faces meet at a single vertex. Every polygon of my
> > database has been flagged at "terrain".
> >
> > Here is a snippet of how I perform my intersect:
> >
> > double PerformerDisplayWindow::GetTerrainHeight (double x, double y)
> > {
> > pfSegSet segset;
> > long isect;
> > pfHit **hits[10];
> > double z= 10000.0f;
> > double TerrainHeight = 0.0f;
> >
> > segset.activeMask = 0x1;
> > segset.isectMask = 0xFFFF;
> > segset.discFunc = NULL;
> > segset.bound = NULL;
> > segset.mode = PFTRAV_IS_PRIM|PFTRAV_IS_NORM|PFTRAV_IS_CULL_BACK;
> > segset.segs[0].dir.set(0.0f, 0.0f, -1.0f);
> > segset.segs[0].length = 50000.0f;
> > segset.segs[0].pos.set(x,y,z);
> > isect = Shared->model->isect(&segset,hits);
> > if(isect){
> > pfVec3 pnt;
> > (*hits[0])->query(PFQHIT_POINT, pnt.vec);
> > TerrainHeight = pnt[2];
> > }
> > else {
> > cout << "Warning: No terrain found at this location. TerrainHeight is
> > being set to zero."<<endl;
> > TerrainHeight = 0;
> > }
> > return(TerrainHeight);
> > }
> >
> >
> > -----------------------------------------------------------------------
> > List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
>
> --
> dirk lüsebrink fon +49 (30) 42 85 17 23 Cantaloupe|realtime
> dirk++at++cantaloupe.de fax +49 (30) 42 85 17 24 Charlottenburgerstrasse 22
> www.cantaloupe.de 13086 Berlin, Germany
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
-- For Performer+OpenGL tutorials http://www.dorbie.com/ My comment on the abuse of Jon Johanson's rights; After giving up raiding their neighboring countries the Norse men have taken to raiding 15 year old kids in their bedrooms. Very sad.
This archive was generated by hypermail 2b29 : Fri Feb 18 2000 - 13:52:21 PST