Hi everybody and thanks to those who answered my concerns about setting my
scene in greyscale.
I was wondering if I should use shaders as well to compute intersection
points...
Actually my problem is that I want to put a tank or land entity at altitude
zero (on the ground). There was a NPS Tutorial about this so I have inspired
myself a lot from it and it works fine when I use a ground database in a
local coordinate system.
However, as soon as I switch to Earth-Centered coordinates (using a 3D model
like bluemarble, or any earth-centered database), I have some real offset on
the computed intersection point and the visible ground altitude.
My tank's 3D model has no offset and here's my way of doing this :
I create a segment between the entity's earth-centered position and earth's
center (0,0,0). Then I use the Intersect Visitor to get the Hit list
containing the intersection points in world coordinates.
At first I only took the first intersection of the list (hitList.front()),
assuming there was only one, but I even checked if there were other
intersection and compared them to get the nearest to the earth center.
Depending on the database the tank is a couple of dozens of meters above
ground or deep underground.
I even thought it might be bound to earth's shape being ellipsoidal, so I
tested at the equator, but the very same thing happens.
Should I redefine the Intersect Visitor? Where does this offset comes from
anyway? If anyone had experienced similar issues in computing intersection
points I would be glad to have some advice.
Thanks in advance,
David
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/