Quantcast

Place an object in given position

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

Place an object in given position

Hi;
I want to place an object for example "cow.osg" in my map so i use these lines of code :

osg::ref_ptr<osg::Node> object = osgDB::readNodeFile("./data/cow.osg().10000.scale", );
        const SpatialReference* srs = SpatialReference::create("WGS 84");


        GeoTransform* xform= new GeoTransform();

        xform->setTerrain( map->getTerrain());

        GeoPoint point(srs , 3.13 , 25.53);

        xform->setPosition(point);

        xform->addChild(object);

        root->addChild(xform);


is it correct and how can i verify the existence of the object

thanks in advance








is it correct a
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Place an object in given position

Ekkim,

Remove the "()" in your filename after .osg; also, use "wgs84" to create your SRS.
Glenn Waldron / Pelican Mapping / @glennwaldron
Ekkim Ekkim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Place an object in given position

hi
it is working
thanks gwaldon
now what do i need to make it light source
Loading...