How can I modify the vertex of a tilemesh.

classic Classic list List threaded Threaded
3 messages Options
leo leo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How can I modify the vertex of a tilemesh.

Hi everyone,
I wanna modify the vertex of a tilemesh.

So I tried to change the vertex in the function

void TerrainCuller::apply(osg::Node& node);
by modify
"surface->getDrawable()->_mesh"

but it doesn't work, why?

by the way the TerrainEngine is REX.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I modify the vertex of a tilemesh.

Leo,
Sorry, but the _mesh member is only an internal structure used for intersections and statistics gathering. There is no API to modify the tile vertices.
Glenn Waldron / Pelican Mapping
leo leo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I modify the vertex of a tilemesh.

Hi gwaldron,
Thank you for your reply. Nevertheless, I can modify the _geom of class TileDrawable and it works, but the _geom is shared with the tiles at the same latitude. So if I change the _geom of the specified tile, the other tiles at the same latitude will be changed too.

Now I have 2 choices.
1、Shutdown the share of the _geom by add a member "int tileX" in struct GeometryKey. It makes a _geom is one to one correspondence with a tile. It works, I have achieved.
2、Try to find the memory of the tile's surface geometry rendered in per frame,and change it.But I haven't found the memory.

I prefer choice 2 rather than 1.As the developer of the osgEarh, could you give me some suggestion about where is the memory of tile's geometry rendered in per frame?
Loading...