Re: [osg-users] Erratic intersections with long line segments

2009-04-20 Thread David Karlsson
Hi,
We also created a version with doubles for the project that I'm working on. 
(The reason for this was that we needed to calculate the derivative of a 
geocentric terrain given a lat/long coordinate.) It would be convenient for us 
if this option was given as a cmake flag. I'm pretty new to osg so my question 
is basically what it never got into the trunk means - was it not a good idea? 
Why has it been rejected?

Regards,
David Karlsson


Från: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] För Tomlinson, Gordon
Skickat: den 15 april 2009 15:51
Till: OpenSceneGraph Users
Ämne: Re: [osg-users] Erratic intersections with long line segments

Thanks Marcin

That's sort of what I was thinking that it had to be rounding, our tiles are 
localized so YX are relatively small but the Z could be any value range on the 
earth and seabed,
1million,-1million was over kill  for the segment length.

Be we will look to go the double route .

Thanks again for you reply,


Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Marcin Prus
Sent: Wednesday, April 15, 2009 4:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Erratic intersections with long line segments

Hi Gordon,
we had similar problem here. We were standing exactly at the edge of 2 adjacent 
triangles in large terrain database and osgUtil::LineSegmentIntersector failed 
because of internal floating precision. Using doubles instead of floats inside 
osgUtil::LineSegmentIntersector solved our problems.

I've made submission on 18.02.2009 with modified LineSegmentIntersector using 
cmake flag to set float or double precision internally but it never got into 
the trunk. You can look at it and create your own LineSegmentIntersectorDbl : 
public LineSegmentIntersector with double maths inside. Perhaps this will help 
- it did in our case

Best,
Marcin Prus

Tomlinson, Gordon pisze:
HI All

I posting this for one of my folks who's is having some erratic results when 
using a long vertical line segment and the standard 
osgUtil::LineSegmentIntersector

Basically when he sets a line segment up with  end X,Y, 100 and start X,Y, 
-100 , occasionally we fail to get a hit even though we are in the middle 
of the terrain skin, although moving the X,Y several meters in any direction 
and we get a hit.

If we reduce the Z of the line segment to 500k and -500k this happens less 
errant fails,

if we reduce the Z's to 1k, -1k then we never get a fail,

further when we are failing with the intersections if the camera is further 
away from the intersection the less fails we get, the more we move closer to  
the intersection point the more fails we get.

Our Near and Far clip are fixed, 1 to 10-20k , the terrain skin is stanard OSG 
geometry, nothing fancy, some lods, but the level and which  lod is showing 
does not seem to be the issue

I'm at at a loss to why this may be happening, we are not doing anything out 
the oridnary in this case that I can think that would cause this erratic 
behaviour ,

 any one seen anything like this  before ?


thanks


Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651
Self defence is not a function of learning tricks
but is a function of how quickly and intensely one
can arouse one's instinct for survival
- Master Tambo Tetsura




___
osg-users mailing list
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
Marcin Prus
Kierownik Projektu


ETC-PZL Aerospace Industries Sp. z o.o.
Al. Krakowska 110/114,  P.O. Box 22
02-256 Warszawa
http://www.ai.com.pl

tel: (48-22) 846-54-17 wew. 135
fax (48-22) 846-54-18
e-mail: p...@ai.com.pl

NIP 522-01-01-817KRS 010025
Sąd Rejonowy dla m. st. Warszawy w Warszawie
XIII Wydział Gospodarczy Krajowego Rejestru Sądowego.
Wniesiony kapitał zakładowy Spółki wynosi 1 000 000 złotych.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Erratic intersections with long line segments

2009-04-20 Thread Robert Osfield
2009/4/20 David Karlsson david.karls...@foi.se

  Hi,
 We also created a version with doubles for the project that I'm working on.
 (The reason for this was that we needed to calculate the derivative of a
 geocentric terrain given a lat/long coordinate.) It would be convenient for
 us if this option was given as a cmake flag. I'm pretty new to osg so my
 question is basically what it never got into the trunk means - was it not
 a good idea? Why has it been rejected?



The submission wasn't merged as is I don't feel it's appropriate to manage
the internal double support as an optional compile, rather we should have
two LineSegment compute methods - one using doubles, and one using floats
and have a setting to switch between the two at runtime.  You needn't even
need a separate class for it.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Erratic intersections with long line segments

2009-04-15 Thread Marcin Prus

Hi Gordon,
we had similar problem here. We were standing exactly at the edge of 2 
adjacent triangles in large terrain database and 
osgUtil::LineSegmentIntersector failed because of internal floating 
precision. Using doubles instead of floats inside 
osgUtil::LineSegmentIntersector solved our problems.


I've made submission on 18.02.2009 with modified LineSegmentIntersector 
using cmake flag to set float or double precision internally but it 
never got into the trunk. You can look at it and create your own 
LineSegmentIntersectorDbl : public LineSegmentIntersector with double 
maths inside. Perhaps this will help - it did in our case


Best,
Marcin Prus

Tomlinson, Gordon pisze:

HI All
 
I posting this for one of my folks who's is having some erratic 
results when using a long vertical line segment and the standard 
osgUtil::LineSegmentIntersector
 
Basically when he sets a line segment up with  end X,Y, 100 and 
start X,Y, -100 , occasionally we fail to get a hit even though we 
are in the middle of the terrain skin, although moving the X,Y several 
meters in any direction and we get a hit.
 
If we reduce the Z of the line segment to 500k and -500k this happens 
less errant fails,
 
if we reduce the Z's to 1k, -1k then we never get a fail,
 
further when we are failing with the intersections if the camera is 
further away from the intersection the less fails we get, the more we 
move closer to  the intersection point the more fails we get.
 
Our Near and Far clip are fixed, 1 to 10-20k , the terrain skin is 
stanard OSG geometry, nothing fancy, some lods, but the level and 
which  lod is showing does not seem to be the issue
 
I'm at at a loss to why this may be happening, we are not doing 
anything out the oridnary in this case that I can think that would 
cause this erratic behaviour ,
 
 any one seen anything like this  before ?
 
 
thanks
 
 


/Gordon
Product Manager 3d
/__
/Gordon Tomlinson
//Email / : gtomlinson @ overwatch.textron.com
__
//(C)//:/ (+1) 571-265-2612*
*(W)//:/ //(+1) 703-437-7651//

Self defence is not a function of learning tricks
but is a function of how quickly and intensely one
can arouse one's instinct for survival
- */Master Tambo Tetsura/*

 



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  


--
Marcin Prus
Kierownik Projektu


ETC-PZL Aerospace Industries Sp. z o.o.
Al. Krakowska 110/114,  P.O. Box 22
02-256 Warszawa
http://www.ai.com.pl

tel: (48-22) 846-54-17 wew. 135
fax (48-22) 846-54-18
e-mail: p...@ai.com.pl

NIP 522-01-01-817KRS 010025
Sa;d Rejonowy dla m. st. Warszawy w Warszawie
XIII Wydzia? Gospodarczy Krajowego Rejestru Sa;dowego.
Wniesiony kapita? zak?adowy Spó?ki wynosi 1 000 000 z?otych.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Erratic intersections with long line segments

2009-04-15 Thread Tomlinson, Gordon
Thanks Marcin
 
That's sort of what I was thinking that it had to be rounding, our tiles are 
localized so YX are relatively small but the Z could be any value range on the 
earth and seabed, 
1million,-1million was over kill  for the segment length.
 
Be we will look to go the double route .
 
Thanks again for you reply, 
 
 

Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__

 



From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Marcin Prus
Sent: Wednesday, April 15, 2009 4:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Erratic intersections with long line segments


Hi Gordon,
we had similar problem here. We were standing exactly at the edge of 2 adjacent 
triangles in large terrain database and osgUtil::LineSegmentIntersector failed 
because of internal floating precision. Using doubles instead of floats inside 
osgUtil::LineSegmentIntersector solved our problems.

I've made submission on 18.02.2009 with modified LineSegmentIntersector using 
cmake flag to set float or double precision internally but it never got into 
the trunk. You can look at it and create your own LineSegmentIntersectorDbl : 
public LineSegmentIntersector with double maths inside. Perhaps this will help 
- it did in our case

Best,
Marcin Prus

Tomlinson, Gordon pisze: 

HI All
 
I posting this for one of my folks who's is having some erratic results 
when using a long vertical line segment and the standard 
osgUtil::LineSegmentIntersector
 
Basically when he sets a line segment up with  end X,Y, 100 and 
start X,Y, -100 , occasionally we fail to get a hit even though we are in 
the middle of the terrain skin, although moving the X,Y several meters in any 
direction and we get a hit.
 
If we reduce the Z of the line segment to 500k and -500k this happens 
less errant fails, 
 
if we reduce the Z's to 1k, -1k then we never get a fail, 
 
further when we are failing with the intersections if the camera is 
further away from the intersection the less fails we get, the more we move 
closer to  the intersection point the more fails we get.
 
Our Near and Far clip are fixed, 1 to 10-20k , the terrain skin is 
stanard OSG geometry, nothing fancy, some lods, but the level and which  lod is 
showing does not seem to be the issue
 
I'm at at a loss to why this may be happening, we are not doing 
anything out the oridnary in this case that I can think that would cause this 
erratic behaviour ,
 
 any one seen anything like this  before ? 
 
 
thanks
 
 

Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival 
- Master Tambo Tetsura

 




___
osg-users mailing list
osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  


-- 
Marcin Prus

Kierownik Projektu




ETC-PZL Aerospace Industries Sp. z o.o.
Al. Krakowska 110/114,  P.O. Box 22
02-256 Warszawa
http://www.ai.com.pl

tel: (48-22) 846-54-17 wew. 135
fax (48-22) 846-54-18
e-mail: p...@ai.com.pl

NIP 522-01-01-817KRS 010025
Sąd Rejonowy dla m. st. Warszawy w Warszawie 
XIII Wydział Gospodarczy Krajowego Rejestru Sądowego. 
Wniesiony kapitał zakładowy Spółki wynosi 1 000 000 złotych.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Erratic intersections with long line segments

2009-04-14 Thread Tomlinson, Gordon
HI All
 
I posting this for one of my folks who's is having some erratic results
when using a long vertical line segment and the standard
osgUtil::LineSegmentIntersector
 
Basically when he sets a line segment up with  end X,Y, 100 and
start X,Y, -100 , occasionally we fail to get a hit even though we
are in the middle of the terrain skin, although moving the X,Y several
meters in any direction and we get a hit.
 
If we reduce the Z of the line segment to 500k and -500k this happens
less errant fails, 
 
if we reduce the Z's to 1k, -1k then we never get a fail, 
 
further when we are failing with the intersections if the camera is
further away from the intersection the less fails we get, the more we
move closer to  the intersection point the more fails we get.
 
Our Near and Far clip are fixed, 1 to 10-20k , the terrain skin is
stanard OSG geometry, nothing fancy, some lods, but the level and which
lod is showing does not seem to be the issue
 
I'm at at a loss to why this may be happening, we are not doing anything
out the oridnary in this case that I can think that would cause this
erratic behaviour ,
 
 any one seen anything like this  before ? 
 
 
thanks
 
 

Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival 
- Master Tambo Tetsura

 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org