Re: Problem with isector intersection test against the scene graph

New Message Reply Date view Thread view Subject view Author view

From: Dirk Lüsebrink (dirk++at++cantaloupe.de)
Date: 02/18/2000 06:42:49


"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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Feb 18 2000 - 06:43:25 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.