![]() |
Hello;
I want to add a drawable shape just next to my 3d model. How can I add the shape next to 3d model with an offset without using lat lon values? Thanks. Nebi. |
![]() |
Hi Nebi,
In general, transformations are done by placing nodes under osg::Transform derived nodes. You can use osg::MatrixTransform and osg::PositionAttitudeTransform for what you want, which is offsets without lat/lon values. You should place the drawable under one of the transforms mentioned above, which itself should be placed as a brother to the 3d model under the transform node that transforms it. For example: osgEarth::GeoTransform (lat/lon values) | | 3d model MatrixTransform/PositionAttitudeTransform | drawable
Eran Cohen
|
![]() |
Thank you Eran. But since I am new to both OpenSceneGraph and Osg earth. I could not thoroughly understand transforms I think. Could you give me a more specific example. Thanks.
Nebi |
![]() |
Sure,
A model is typically loaded using osgDB in the following way: osg::Node* model = osgDB::readNodeFile("path_to_file")The model node contains the data telling OpenSceneGraph how to draw the model itself, but not where to draw it. To enable transformations of nodes, OpenSceneGraph uses Transformation nodes. These nodes affect all their children in the scene graph. For example:
|
Free forum by Nabble | Edit this page |