[osg-users] Origin of computing maximum level in osgdem

Robert Osfield robert.osfield at gmail.com
Tue Jun 21 00:19:22 PDT 2016


Hi Maya,

There isn't any particular "literature" that I used when working out the
maths, I just used my own knowledge of maths and derived things myself.
It's not complicated.

Each successive level you double the resolution in each so you get a
formula in the sytle:

   resolution (L) = tileSize * 2 ^ (L)

So to work out the number of levels you require to hit a target resolution
you simply take the log of both side and restructure things a little to
account for in needing an integer Level.

Robert.

On 20 June 2016 at 23:02, maya leonard <mayaleonard at hotmail.com> wrote:

> Hello,
>
> Can someone point me to the literature for computing
>
> (1 ) AR = xRange/ yRange in
>
>       bool DataSet::computeOptimumTileSystemDimensions(int& C1, int& R1)
>       Lines 247- 270 DataSet.cpp
>
> and
>
> (2) int k_cols = int( ceil( 1.0 + ::log( destination_xRange / (_C1 *
> sourceResolutionX * tileSize ) ) / ::log(2.0) ) );
>       int k_rows = int( ceil( 1.0 + ::log( destination_yRange / (_R1 *
> sourceResolutionY * tileSize ) ) / ::log(2.0) ) );
>
>       bool DataSet::computeOptimumLevel(Source* source, int maxLevel, int&
> level)
>      Lines 201 - 210 DataSet.cpp
>
> Thank you
>
> Maya
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160621/e89e84c1/attachment-0003.htm>


More information about the osg-users mailing list