[osg-users] heightfield height
Hi, i cannot find anything in the wiki about it, i got a heightfield set to a heightieldlayer and this one i set as elevationlayer to a terraintile. now i cannot find any doc about allocate, setXInterval and setYInterval. If i setup e.g. allocate(100,100) and set[X,Y]Interval(1.0), then i set all points of the heightfiled to zero, but one point i set to e.g. 100. Now i think, i got a heightfield of 100*100points, and each point OR the whole heightfiled have a distance to each other of 1.0. So i think, the point i setup with a height of 100 should be as high as the heightfield is in its x or y axis, or? the point in my window is so high that you cannot see the top of it, the only way i can see the top of the point is when i choose e.g. a value of 0.05. what must i do to setup my heightfield correctly? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20953#20953 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] heightfield height
Hi, also when i use negative values in the setHeight() call, the heightfield draws seemed to got its origin in the x=0, y=0 coordinate of the viewer window? is it not allowed to use negative values as heightfield heights? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20954#20954 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] display terrainTile
Hi, i got this little piece of code, with which i wanna display a heightfield. I read that for performance reasons one should use terrainTile and add the heightfield to it, but i dont get it to display in the viewer? i know the osgTerrain example, but i find it is too big for starting. i hope someone could help me? Here is the small code: int main() { osg::ref_ptrosgTerrain::TerrainTile terrainTile; osg::ref_ptrosg::HeightField hf; osg::ref_ptrosgTerrain::HeightFieldLayer hfl; osg::ref_ptrosg::Group group; osg::ref_ptrosgViewer::Viewer viewer; group = new osg::Group(); terrainTile = new osgTerrain::TerrainTile(); hf = new osg::HeightField(); hfl = new osgTerrain::HeightFieldLayer(); viewer = new osgViewer::Viewer(); hf.get()-allocate(100, 100); hf.get()-setXInterval(10.0); hf.get()-setYInterval(10.0); for(unsigned int r=0;r100;++r) { for(unsigned int c=0;c100;++c) { hf.get()-setHeight(c,r,400); } } hfl.get()-setHeightField(hf.get()); terrainTile.get()-setElevationLayer(hfl.get()); group.get()-addChild(terrainTile.get()); viewer.get()-setSceneData(group.get()); viewer.get()-realize(); viewer.get()-run(); } Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20758#20758 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] display terrainTile
Hi, thanks alot, after inserting the technique it complained about a missing locator, now it works. thanks alot Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20764#20764 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] heightfield change height crashes
Hi, i inserted the dirtyDisplayList() into an update callback which i set with setUpdateCallback() and it works, but only if i click into the viewer window and move the heightField ? thanks for the help, i will try also the other variants, to see if they work better. Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20380#20380 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] heightfield change height crashes
Hi, i only have set -setDataVariance(osg::Object::DYNAMIC); to the geode, now i also have set it to the shapeDrawable. Should i apply it only to the shapeDrawable or to both? After this change it draws the first point of my setHeight() changes, any following setHeight() call doesnt paint anything? If i use -dirtyDisplayList(); on the shapeDrawable directly after calling setHeight() crashes the application. what should i do, that it paints also the following setHeight() calls? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20187#20187 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] heightfield change height crashes
Hi, i use SingleThreaded, i got no multithreading enum property only these SingleThreaded, CullDrawThreadPerContext, ThreadPerContext = CullDrawThreadPerContext, DrawThreadPerContext, CullThreadPerCameraDrawThreadPerContext, ThreadPerCamera = CullThreadPerCameraDrawThreadPerContext, AutomaticSelection i got osg 2.4.0, not the newest, but for this test-app it should work. What enum property should i use, AutomaticSelection ? i dont get it to paint the following setHeight() calls, even if i use automaticSelection? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20189#20189 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] rotating a geometry?
Hi, it seemed that all translations/transformations are done with a PAT, but when i rotate the PAT object which does not sit at position 0,0,0 of the world-coordinates, but it rotates around the world-coordinate-axis, but i want to rotate around a axis of the object itself? I tried code like the following, but it always turns around world-coordinate-axis. pos-set(rectangleTwoXForm-getPosition().x(), rectangleTwoXForm-getPosition().y()+1, rectangleTwoXForm-getPosition().z()); //rectangleTwoXForm-getPosition().set(rectangleTwoXForm-getPosition().x(), rectangleTwoXForm-getPosition().y(), rectangleTwoXForm-getPosition().z() ); rectangleTwoXForm-setAttitude(osg::Quat(osg::DegreesToRadians(i), *pos ) ); could someone help me? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18987#18987 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] rotating a geometry?
Hi, i build an L-shape-plate with a geode and a geometry, but it could also consist out of two plane-boxes, one box 90 degress folded up to the other. I get it to move around in the scene with setPosition() member function, but i wanna control the geometry, so that it e.g. rotates? How can i do that? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18954#18954 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] rotating a geometry?
Hi, i can rotate an geometry when i use osg::PositionAttitudeTransform* rectangleTwoXForm = new osg::PositionAttitudeTransform(); and add the geometry with rectangleTwoXForm-addChild(rectangleGeode); then i can rotate the rectangleTwoXForm with e.g. rectangleTwoXForm-setAttitude(osg::Quat(osg::DegreesToRadians(-90.0), osg::Vec3(0,1,0) ) ); But i cannot do this (rotation) with the original geometry? theres no setAttitude() member func? i saw Quat class member func makeRotate, but i use Vec3 not e.g. Vec3d. i must check the difference of both. perhaps someone got a good example? Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18956#18956 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] how to build basicGeometry example?
Hi, thanks for the help. I am on debian there it seemed i must use lower-case find_package(osg), not OSG. the line target_link_libraries(testProjectMain ${OSG_LIBRARY} ${OPENTHREADS_LIBRARY}) works with OpenThreads , but ${OPENTHREADS_LIBRARY} it cannot find Thank you! Cheers, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18884#18884 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org