[osg-users] osgearth terrain problem

211 views
Skip to first unread message

caijun

unread,
Dec 10, 2012, 11:51:01 PM12/10/12
to osg-users

Hello,everyone!

   I am studying the osgearth code now.I want to know  how the osgearth judges the terrain's tilekey info,which terrainNode it is going to load! Can you tell me how it works?

  thanks very much!



Glenn Waldron

unread,
Dec 11, 2012, 9:15:33 AM12/11/12
to OpenSceneGraph Users
cajun,

The terrain is a quadtree of tiles, with 2 tiles at the root level (for a round whole-earth terrain). Theses are tile keys (0/0/0) and (0/1/0). As you move the camera closer, a tile subdivides into 4 smaller tiles (its children), each with twice the resolution of the parent tile. Each tile has a range (i.e. distance from the camera) at which it will disappear and be replaced by its higher-resolution children. When you zoom out, similarly, the tile will revert back to its lower-resolution parent.

There is an osgEarth-specific forum you can peruse as well:

Hope this helps.

Glenn Waldron / @glennwaldron / osgEarth.org



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


caijun

unread,
Dec 11, 2012, 11:12:52 PM12/11/12
to osg-users

Thanks for glennwaldron's answer!

And I want to know in which file the osgearth calculate the current lod and which tiles to load and show? I've read all the files in osgearth and osgearth_engine_osgterrain,but I've not found the right file.Can you or anyone else tell me which file contains the infomation?

 Thanks very much!



Glenn Waldron

unread,
Dec 12, 2012, 9:09:02 AM12/12/12
to OpenSceneGraph Users
See my response on the osgearth list.

Glenn Waldron / @glennwaldron



caijun

unread,
Dec 22, 2012, 9:23:44 AM12/22/12
to osg-users

Hello,everyone,

      I am using osg to build a 3D software.I don't know how to change the znear,zfar and projection matrix values when I change the camera position. When I read the osg's cullstack class,the refmatrix of projection differs every time.how does it calculates?Can anyone tell me?

   Thanks very much!



Gordon Tomlinson

unread,
Dec 22, 2012, 9:33:45 AM12/22/12
to OpenSceneGraph Users

I would recommend the OpenSceneGraph Reference Manual at lulu.com or one of the other OSG books out there they will give you most of the basic information and understanding you need to fully use OSG

 

_________________________________________________________________________________________________________
Gordon Tomlinson


www.photographybyGordon.com
www.vis-sim.com
LinkedIn
www.linkedin.com/in/gordontomlinson

"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

Sergey Polischuk

unread,
Dec 22, 2012, 12:00:24 PM12/22/12
to OpenSceneGraph Users
Hi
 
You can set projection matrix directly with camera->setProjectionMatrix(...)
Also there are osg::Projection, which is a node modifying projection matrix for subgraph under it.
Also note, that osg by default calculates near and far projection values by itself using bounding volumes (check osg::CullSettings::ComputeNearFarMode enum for available modes), in order to set znear and zfar manually you should disable this behaviour by calling camera->setComputeNearFarMode (osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR)
 
Cheers.
 
22.12.2012, 18:23, "caijun" <caijun...@126.com>:

Hello,everyone,

      I am using osg to build a 3D software.I don't know how to change the znear,zfar and projection matrix values when I change the camera position. When I read the osg's cullstack class,the refmatrix of projection differs every time.how does it calculates?Can anyone tell me?

   Thanks very much!



,
Reply all
Reply to author
Forward
0 new messages