VPB will build the database using the CS of the source
elevation/imagery. If the source is UTM, the database will be in that
CS. If it uses lat/lon, it will be in that CS (both are flat earth
databases).

The placement of objects in the database will need to be in the CS the
database uses or was built with.

The "geocentric" flag will create a "round" earth type database where
the origin is the center of the earth. You're probably getting the error
because you need to re-project your data from UTM to WGS84
geodetic/georeferenced CS. 

Do a "gdalinfo" on your source data to see what it is...

-Shayne

-----Original Message-----
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ethan
Fahy
Sent: Monday, September 12, 2011 11:19 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] [vpb] Placing an object on a UTM file generated
withosgdem

I have looked through all of the forum posts related to this issue and
they have implicitly but not explicitly told me how to solve my problem,
but being such a newbie I think I need some explicit help  :-* 

I am starting with two geoTiff files, one dem and one terrain.  I
convert to ive using the following command line structure:

osgdem -t terrain.GEOTIFF -d dem.GEOTIFF -l 1 -o terrain.ive

I am able to load terrain.ive into my osg application and view it just
fine.  I then want to be able to add objects (e.g. tree osg files) onto
the terrain.  At this point I should mention that the geotiff files are
in UTM WGS84 format.  I have been trying to add a tree onto the terrain
with the following osg code:


Code:

/*
        Load Scene Components from Files
        */
        osg::ref_ptr<osg::Node> terrain =
osgDB::readNodeFile("data\\terrain\\terrain.ive");
        osg::ref_ptr<osg::Node> tree =
osgDB::readNodeFile("data\\tree\\Tree1.osg");


        /*
        Group Scene Components
        */

        /*Tree Transform*/
        osg::ref_ptr<osg::PositionAttitudeTransform> treeXform = new
osg::PositionAttitudeTransform;
        osg::Vec3 treePosit(?,?,?);
        treeXform->setPosition( treePosit ); 
        osg::Vec3 treeScale(1,1,1);
        treeXform->setScale(treeScale);
        /*Tree Rotation*/
        osg::ref_ptr<osg::MatrixTransform> treeRotation = new
osg::MatrixTransform;
        const double angle = osg::DegreesToRadians(0.0);
        const Vec3d axis(1, 0, 0);
        treeRotation->setMatrix(Matrix::rotate(angle, axis));

        osg::ref_ptr<osg::Group> root = new osg::Group();
        root->addChild(terrain);//add terrain to root
        root->addChild(treeXform);//add translation to root
        treeXform->addChild(treeRotation);//add rotation to translation
        treeRotation->addChild(tree);//add tree to rotation




My question is whether this osg command / osg code is on track and I
simply need to figure out appropriate values for my treePosit variable
or whether I need to take a fundamentally different approach.  I have
read about attaching objects to geotiffs that were converted using the
--geocentric flag, but if I add the --geocentric flag I get the
following error:
ERROR 1: No PROJ.4 translation for source SRS, coordinate transformation
initialization has failed.  I have also seen the --TERRAIN flag for
osgdem, but I definitely don't know if that's what I need.  

I have also looked into using osgEarth, which from what I've read might
take care of more of this stuff automatically, but I'd rather figure
this out using VPB/osgdem since I think I'm really close to a solution.
Thanks in advance for any help!

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





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

Reply via email to