Hi Robert,

> I haven't personally tried this but an educated guess is that you'll
> need to do is keep polling the DatabasePager::getFileRequestListSize()
> till it returns 0.    Something like:
>
> while(!viewer.done() &&
> viewer.getDatabasePager()->getFileRequestListSize()>0) frame();

I was hoping this would work too, but getDatabasePager()->getFileRequestListSize() _always_ returns 0 (zero).

So I am hoping that this is either a bug that can be fixed or that there is another method for checking whether the DatabasePager is done / idle (!?)

Best regards,
John

Robert Osfield wrote:
Hi John,

I haven't personally tried this but an educated guess is that you'll
need to do is keep polling the DatabasePager::getFileRequestListSize()
till it returns 0.    Something like:

while(!viewer.done() &&
viewer.getDatabasePager()->getFileRequestListSize()>0) frame();

Robert.

On Tue, Oct 28, 2008 at 2:34 PM, John Vidar Larring
<[EMAIL PROTECTED]> wrote:
Hi all,

_Goal_: I'd like to make a command-line tool where I can open paged
database, set the camera at a particular position and supply a filename, and
the program will dump an image and exit.

% ./osgautocapture
Usage: ./osgautocapture [options] filename ...
Options:
 --active    Use active rendering instead of passive / lazy rendering
 --camera <lat> <lon> <alt> <heading> <incline> <roll>  Specify camera
position for image capture. Angles are specified in degrees and altitude in
meters above sealevel (e.g. --camera 55 10 300000 0 30 0)
 --filename  Filename for the captured image

Example below yields the attached image called autocapture.jpg:
./osgautocapture --camera 55 10 300000 0 30 0 --filename autocapture.jpg
http://www.openscenegraph.org/data/earth_bayarea/earth.ive

(Robert: thanks for making that database available;)

_Problem_: The image is blurred because the the necessary level of detail
has not been loaded when the image is captured (Ref: autocapture.jpg)

If I force to program to render the 180 frames before capturing, I'll get at
descent image (ref: autocapture_180_frames.jpg). However, this approach will
either not give a good result or take more time and resources than
necessary.

What I would like to do is to query the DatabasePager to find out whether or
not it needs load more tiles for the image to be rendered with the correct
level of detail. However, I can't seem to find the correct method (or
correct context for calling the method) for finding out when the
DatabasePager is done loading all necessary tiles.

Please, help. I'm quite stuck. The complete source code is attached to this
email.

Best regards,
John






--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Best regards,
John
WeatherOne


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to