Bemis, Suzie CEI-TACCSF (suzie++at++TACCSF.KIRTLAND.AF.MIL)
Tue, 21 Apr 1998 08:31:28 -0600
We're running a Line-of-Sight program which uses performer libraries and
isect to calculate the height of terrain given a certain lat/lon that
has been converted to x,y positions. There are some points on the
database which are not returning valid isect hits. I've run some tests
and have determined that there are some points within a certain polygon
which return a valid isect and within the same polygon there are other
points which don't have valid isect returns.
I don't know what else to try to figure this one out. I didn't write
the code. Of course the person who did has since left.
Example of code:
float TerrainServer::elevation(int x, int y)
{
pfCoord view;
pfHit **hits[32];
int isect;
//update location of intersection segment
segset.segs[0].pos.set(x,y,2500.0f);
view.xyz.set(x,y,2500.0f);
view.hpr.set(0.0f, -90.0f, 0.0f);
chan->setView(view.xyz,view.hpr);
// do an intersection test against the scene graph
isect = root->isect(&segset,hits);
// if successful, set our height to that of the point of contact
// plus a small offset
if (isect)
{
pfVec3 pnt, xpnt;
pfMatrix xmat, xmat2;
(*hits[0])->query(PFQHIT_POINT, &pnt);
// transform object point into scene coordinates
(*hits[0]->query(PFQHIT_XFORM, &xmat);
xpnt.xformPt(pnt, xmat);
return (xpnt[PF_Z] - altOffset_);
}
}
Thanks in advance for any assistance.
Suzie
Hi All,
We're running a Line-of-Sight program which uses performer libraries and isect to calculate the height of terrain given a certain lat/lon that has been converted to x,y positions. There are some points on the database which are not returning valid isect hits. I've run some tests and have determined that there are some points within a certain polygon which return a valid isect and within the same polygon there are other points which don't have valid isect returns.
I don't know what else to try to figure this one out. I didn't write the code. Of course the person who did has since left.
Example of code:
float TerrainServer::elevation(int x, int y)
{
pfCoord view;
pfHit**hits[32];
int isect;
//update location of intersection segment
segset.segs[0].pos.set(x,y,2500.0f);
view.xyz.set(x,y,2500.0f);
view.hpr.set(0.0f, -90.0f, 0.0f);
chan->setView(view.xyz,view.hpr);
// do an intersection test against the scene graph
isect = root->isect(&segset,hits);
// if successful, set our height to that of the point of contact
// plus a small offset
if (isect)
{
pfVec3 pnt, xpnt;
pfMatrix xmat, xmat2;
(*hits[0])->query(PFQHIT_POINT, &pnt);
// transform object point into scene coordinates
(*hits[0]->query(PFQHIT_XFORM, &xmat);
xpnt.xformPt(pnt, xmat);
return (xpnt[PF_Z] - altOffset_);
}
}
Thanks in advance for any assistance.
Suzie
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:16 PDT