Re: [osg-users] PagedLOD range for 2D image tiles

2016-09-14 Thread Valerian Merkling
Maybe the [0.5, 2] range is wrong because I assumed the PIXEL_SIZE_ON_SCREEN 
used the texture pixel size. To be honest I only used PagedLOD with the 
DISTANCE_FROM_EYE_POINT so I don't know ...


You should debug the traverse function of your paged LOD and see what happens.

You may also need to dig into the PagedLOD doc and be sure your setup is ok.

To make it works, I needed to set the rangeMode, the centerMode and the center 
oh each pagedLOD.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68604#68604





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


Re: [osg-users] PagedLOD range for 2D image tiles

2016-09-14 Thread Bruno Oliveira
Sorry, my mistake. No FOV in Ortho2D projection, obviously!

I tried that setRange(id, 0.5, 2) and it did not work, no tile is ever
rendered..

Notice that my tiles are added to the scene graph as geodes, with size =
tileSize / scale,
hence, a tile is always 256 pixels, but the geode size is set to world
coordinates as the size that tile occupies in the whole image frame
coordinates.

2016-09-14 10:41 GMT+01:00 Valerian Merkling :

>
> > I am also using an Ortho2D projection (field of view 30 degrees)
>
>
> There is no such things as field of view for Ortho projection.
>
>
>
> >
> > So, Let me draw a specific scenario: an image pyramid, starting at scale
> 0.125, going all the way up to 0.25, 0.5, 1.0.I am also using an Ortho2D
> projection (field of view 30 degrees). The tiles are fixed size, and I know
> their size in pixels.
> > Can I use PIXEL_SIZE_ON_SCREEN for my purpose?
>
>
> I think you can try somethings like setRange(id, 0.5, 2); for every tiles.
>
> I mean you already have tile for each resolution level so you just need to
> show the one which is the closest to 1:1.
>
> You need ranges of [0..A], [A..B], [B..C] when using the DISTANCE_FROM_EYE.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68601#68601
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD range for 2D image tiles

2016-09-14 Thread Valerian Merkling

> I am also using an Ortho2D projection (field of view 30 degrees)


There is no such things as field of view for Ortho projection. 



> 
> So, Let me draw a specific scenario: an image pyramid, starting at scale 
> 0.125, going all the way up to 0.25, 0.5, 1.0.I am also using an Ortho2D 
> projection (field of view 30 degrees). The tiles are fixed size, and I know 
> their size in pixels.
> Can I use PIXEL_SIZE_ON_SCREEN for my purpose? 


I think you can try somethings like setRange(id, 0.5, 2); for every tiles.

I mean you already have tile for each resolution level so you just need to show 
the one which is the closest to 1:1.

You need ranges of [0..A], [A..B], [B..C] when using the DISTANCE_FROM_EYE.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68601#68601





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


Re: [osg-users] PagedLOD range for 2D image tiles

2016-09-14 Thread Bruno Oliveira
Thank you for the answers.

So, Let me draw a specific scenario: an image pyramid, starting at scale
0.125, going all the way up to 0.25, 0.5, 1.0.
I am also using an Ortho2D projection (field of view 30 degrees). The tiles
are fixed size, and I know their size in pixels.
Can I use PIXEL_SIZE_ON_SCREEN for my purpose?

The first level (scale = 0.125), I should setRange(id, 0, A);
Second level (scale = 0.25), setRange(id, A, B); and so on,
and on Last Level (scale = 1.0, hence original image size), setRange(id, X,
FLT_MAX);

For one texel being 1 pixel on screen, how do I calculate A, B, and so on?
Or am I thinking this the wrong way?


2016-09-14 8:38 GMT+01:00 Valerian Merkling :

> Hi Bruno,
>
> I recently had the same thing to do !
>
> To solve this, I first used a Ortho2D projection matrix for my camera.
>
> I also change the Z value of the camera when I move it, to make it work
> almost as a perspective camera
> - eyepoint Z = 100 for a 1:1 zoom ratio
> - eyepoint Z = 1000 for a 1:10 ratio
>
> With this you can use the DISTANCE_FROM_EYE point configuration of the
> pagedLOD.
>
> I also made my own LOD class, derivated from pagedLOD, and changed the
> traverse function a bit to only use the Z value of the eye point and not
> this position.
>
>
> I hope this can help you and give you ideas !
>
> Valerian
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68599#68599
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD range for 2D image tiles

2016-09-14 Thread Valerian Merkling
Hi Bruno, 

I recently had the same thing to do ! 

To solve this, I first used a Ortho2D projection matrix for my camera.

I also change the Z value of the camera when I move it, to make it work almost 
as a perspective camera 
- eyepoint Z = 100 for a 1:1 zoom ratio
- eyepoint Z = 1000 for a 1:10 ratio

With this you can use the DISTANCE_FROM_EYE point configuration of the pagedLOD.

I also made my own LOD class, derivated from pagedLOD, and changed the traverse 
function a bit to only use the Z value of the eye point and not this position.


I hope this can help you and give you ideas !

Valerian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68599#68599





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


Re: [osg-users] PagedLOD range for 2D image tiles

2016-09-14 Thread Robert Osfield
Hi Brunio,

You will need to decide what sizes are appropriate, my own rule of
thumb is to aim for one texel in a texture to one pixel on the screen,
the use the expected field of view to compute what distances this
relates to for each resolution level.

Robert.

On 13 September 2016 at 23:30, Bruno Oliveira
 wrote:
> Hello,
>
> I have a pagedLOD engine setup, for displaying big images (1x1
> pixels)
>
> I subdivided these images in an pyramid with several scales (starting, for
> instance, at 0.125 of the image size and going up to 1.0 of the image size)
>
> Everything is displaying correctly, except that I don't understand how to
> setup the PagedLod range for my pyramid, so that only a certain pyramid
> scale appears at a time.
>
> For now, I have this,
>
> lod->setRangeMode(osg::LOD::RangeMode::PIXEL_SIZE_ON_SCREEN);
> lod->setRange(0, 0, FLT_MAX);
>
> So obviously all tiles display at once. How can I setup this so that only a
> certain pyramid level is displayed at a time?
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PagedLOD range for 2D image tiles

2016-09-13 Thread Bruno Oliveira
Hello,

I have a pagedLOD engine setup, for displaying big images (1x1
pixels)

I subdivided these images in an pyramid with several scales (starting, for
instance, at 0.125 of the image size and going up to 1.0 of the image size)

Everything is displaying correctly, except that I don't understand how to
setup the PagedLod range for my pyramid, so that only a certain pyramid
scale appears at a time.

For now, I have this,

lod->setRangeMode(osg::LOD::RangeMode::PIXEL_SIZE_ON_SCREEN);
lod->setRange(0, 0, FLT_MAX);

So obviously all tiles display at once. How can I setup this so that only a
certain pyramid level is displayed at a time?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org