Re: [osg-users] Curves/splines
Hi Paavo, i hope that this link could help you: http://code.google.com/p/osgmodeling/ Cheers, Jagovic Hi I'd like to use curves, particularly simple 2d control point based splines to drive variables of scene graph objects over time. I'd also like to use both linear and cubic interpolated curves. So for example the curve could be sharp sawtooth, a cubic curve with smooth knee/shoulder, etc. A smooth curve could be used to control the fade-in or fade-out of a text object for example. Is there a (fast) library for doing this? Or is there another approach for doing this? ... Thank you! Cheers, Paavo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Preparing for OpenSceneGraph-2.9.9 developer release, please test :-)
Hi, it compiles without any problem (with examples enabled), when I start any examples that use full-screen display the screen goes black. My configuration: Windows Vista Business,64 bit (SP2) Quadro FX 3600M ( v. 258.96 ) osg - Revision 11792 Cheers, Jagovic ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Preparing for OpenSceneGraph-2.9.9 developer release, please test :-)
Hi Dženan , All seem to work well, My configuration: Windows Vista Business,64 bit (SP2) Quadro FX 3600M ( v. 260.63 ) http://www.nvidia.com/object/notebook-win7-winvista-64bit-260.63-beta-driver.html osg - Revision 11792 Thank you! Cheers, Jagovic ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Point, edge and face access for catmull clark algorithm
Hi Martin, there are some information in osgModeling::PolyMesh, ... /** Create segments used by the edge map */ inline static Segment getSegment( osg::Vec3 p1, osg::Vec3 p2 ); /** Get the edge object in specified edge map from two points. */ static Edge* getEdge( osg::Vec3 p1, osg::Vec3 p2, EdgeMap emap ); /** Find all edges attached to a face. */ void findEdgeList( Face* f, EdgeList elist ); ... Best regards, Jagovic Hello, I found the osgModeling library and it contains a polygon mesh structure for geometries (Vertices-Edges-Faces). Have anyone experience with osgModeling? It is a helpful extension? Cheers Martin Am 10.02.2010 13:50, schrieb Martin Großer: Hello, i would like implement the catmull clark algorithm in my osg application. Therefore I need to detect the faces and the edges of the arbitrary mesh. Have everyone a tip for me for a smart face and edge access or detection? The two first steps of the algorithm are: 1. Add to every face a point. 2. Add to every edge a point. I have no idea for a smart implementation. My main goal is to convert a arbitrary mesh into a quad mesh. Cheers Martin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgKeyboard
Hi alls, i would like to show a keybord 3d as the text in osgHud example. I am working on the osgkeyboard's project: ... osg::Group* getHUDScene() { return _HUDscene.get(); } void KeyboardModel::CreateHUDKeyboard() { _HUDscene = new osg::Group; osg::Projection* HUDProjectionMatrix = new osg::Projection; HUDProjectionMatrix-setMatrix(osg::Matrix::ortho2D(0,1280,0,1024)); osg::MatrixTransform* HUDModelViewMatrix = new osg::MatrixTransform; HUDModelViewMatrix-setMatrix(osg::Matrix::identity()); HUDModelViewMatrix-setReferenceFrame(osg::Transform::ABSOLUTE_RF); _HUDscene-addChild(HUDProjectionMatrix); HUDProjectionMatrix-addChild(HUDModelViewMatrix); HUDModelViewMatrix-addChild(_scene); \\scene is a osgroup* to the keyboard } ... int main(int , char **) { viewer.setSceneData( keyboardModel-getHUDScene() ); return viewer.run(); } When i run the program i don't see the keyboard in the scene. Any helps or pointer will be appreciate. Best regards, Jagovic ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgKeyboard
Hi Nick, this is the whole code : #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include osg/io_utils #include osg/MatrixTransform #include osg/Geode #include osg/Group #include osg/Switch #include osg/Notify #include osg/Geometry #include osg/ShapeDrawable #include osgText/Text #include osgDB/Registry #include osgDB/ReadFile #include osgDB/WriteFile class KeyboardModel : public osg::Referenced { public: KeyboardModel() { createKeyboard(); } osg::Group* getScene() { return _scene.get(); } osg::Group* getHUDScene() { return _HUDscene.get(); } void keyChange(int key,int value); void CreateHUDKeyboard(); protected: ~KeyboardModel() {} osg::Switch* addKey(osg::Vec3 pos, int key,const std::string text,float width, float height); osg::Switch* addKey(int key,osg::Switch* sw); void createKeyboard(); typedef std::mapint, osg::ref_ptrosg::Switch KeyModelMap; osg::ref_ptrosg::Group_scene; KeyModelMap _keyModelMap; osg::ref_ptrosgText::Text _inputText; osg::ref_ptrosg::Group_HUDscene; }; void KeyboardModel::keyChange(int key,int value) { osg::notify(osg::INFO) key value change, code=std::hex key \t value= value std::dec std::endl; // toggle the keys graphical representation on or off via osg::Swithc KeyModelMap::iterator itr = _keyModelMap.find(key); if (itr!=_keyModelMap.end()) { itr-second-setSingleChildOn(value); } if (value) { // when a key is pressed add the new data to the text field if (key0 key256) { // just add ascii characters right now... _inputText-getText().push_back(key); _inputText-update(); } else if (key==osgGA::GUIEventAdapter::KEY_Return) { _inputText-getText().push_back('\n'); _inputText-update(); } else if (key==osgGA::GUIEventAdapter::KEY_BackSpace || key==osgGA::GUIEventAdapter::KEY_Delete) { if (!_inputText-getText().empty()) { _inputText-getText().pop_back(); _inputText-update(); } } } } osg::Switch* KeyboardModel::addKey(osg::Vec3 pos, int key,const std::string text,float width, float height) { osg::Geode* geodeUp = new osg::Geode; { osgText::Text* textUp = new osgText::Text; textUp-setFont(fonts/arial.ttf); textUp-setColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); textUp-setCharacterSize(height); textUp-setPosition(pos); textUp-setDrawMode(osgText::Text::TEXT/*|osgText::Text::BOUNDINGBOX*/); textUp-setAlignment(osgText::Text::LEFT_CENTER); textUp-setAxisAlignment(osgText::Text::XZ_PLANE); textUp-setText(text); geodeUp-addDrawable(textUp); } osg::Geode* geodeDown = new osg::Geode; { osgText::Text* textDown = new osgText::Text; textDown-setFont(fonts/arial.ttf); textDown-setColor(osg::Vec4(1.0f,0.0f,1.0f,1.0f)); textDown-setCharacterSize(height); textDown-setPosition(pos); textDown-setDrawMode(osgText::Text::TEXT/*||osgText::Text::BOUNDINGBOX*/); textDown-setAlignment(osgText::Text::LEFT_CENTER); textDown-setAxisAlignment(osgText::Text::XZ_PLANE); textDown-setText(text); geodeDown-addDrawable(textDown); } osg::Switch* model = new osg::Switch; model-addChild(geodeUp,true); model-addChild(geodeDown,false); _scene-addChild(model); _keyModelMap[key] = model; pos.x() += width; return model; } osg::Switch* KeyboardModel::addKey(int key,osg::Switch* sw) { _keyModelMap[key] = sw; return sw; } void KeyboardModel::createKeyboard() { _scene = new osg::Group; osg::Vec3 origin(0.0f,0.0f,0.0f); osg::Vec3 pos=origin; addKey(pos,osgGA::GUIEventAdapter::KEY_Control_L,Ctrl,2.0f,0.5f); addKey(pos,osgGA::GUIEventAdapter::KEY_Super_L,Super,2.0f,0.5f); addKey(pos,osgGA::GUIEventAdapter::KEY_Alt_L,Alt,2.0f,0.5f); addKey(pos,osgGA::GUIEventAdapter::KEY_Space,Space,3.0f,1.0f); addKey(pos,osgGA::GUIEventAdapter::KEY_Mode_switch,Switch,2.0f,0.5f); addKey(pos,osgGA::GUIEventAdapter::KEY_Super_R,Super,2.0f,0.5f); addKey(pos,osgGA::GUIEventAdapter::KEY_Menu,Menu,2.0f,0.5f); addKey(pos,osgGA::GUIEventAdapter::KEY_Control_R,Ctrl,2.0f,0.5f); osg::Vec3 middle(pos.x()+1.0f,0.0f,0.0f); pos.x() = 0.0f; pos.z() += 1.0f; addKey(pos,osgGA::GUIEventAdapter::KEY_Shift_L,Shift,2.0f,0.5f); addKey(pos,'\\',\\,1.0f,1.0f); addKey('Z',addKey(pos,'z',Z,1.0f,1.0f)); addKey('X',addKey(pos,'x',X,1.0f,1.0f)); addKey('C',addKey(pos,'c',C,1.0f,1.0f)); addKey('V',addKey(pos,'v',V,1.0f,1.0f)); addKey('B',addKey(pos,'b',B,1.0f,1.0f));
Re: [osg-users] Distributed Rendering
Hi Raul, have you tried osgcluster's example,for example: for the master: osgcluster.exe -m cow.osg for the slaves: osgclusterd.exe -s -o 15 cow.osg osgclusterd.exe -s -o 0 cow.osg osgclusterd.exe -s -o -15 cow.osg Best regards, Jagovic Dear all, I'm thinking in using OSG (via Delta3D) for a flight simulator but I have one little problem. How to set up OSG to perform Distributed Rendering? Usually we use a commercial tool that provides Distributed Rendering functionality, but we would like to move to OSG (because it's better) but I'm afraid we won't be able to have multiple channels using several pc. An example would be 3 Image Generator to render 180º horizontal FOV, 60º each, synchronized. Could I just have 3 OSG applications in 3 different machines having a camera attitude offset? Can someone provide me some insight on this issue, and possible solutions? I would really love to use OSG in this project. Thank you for your kind attention. Regards, Raul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Some questions about VPB and cloud of points
Hi Andrea, you can create a .dem by 3dem software, download it at http://freegeographytools.com/3dem_setup.exe When you start the software you have to selet File-load terrain model-XYZ PointCloud and after File-Save Ugs asci dem. Hope this helps, /Jagovic Andrea, I'm afraid I don't know the answer to that one. All the OSG terrain options take a regular grid of height postings as input, so you would probably need to preprocess an arbitrary could if you want to go that route. osgdem, osgEarth, etc. all use GDAL under the hood to read data formats; you might explore the GDAL utilities (http://remotesensing.org/gdal) and see it there's a pathway there. Once you have regular gridded data in a known format, you can use either osgdem/VPB or osgEarth to create your terrain (you don't need both in this case). Wish I could be of more assistance. Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791 On Wed, Aug 26, 2009 at 2:19 AM, Andrea Martinimartini.and...@gmail.com wrote: Hi Glenn, thank you for your answer. What do you think about the first question? Can i create a dem file starting from a cloud of points using osgdem? This cloud of points is an ascii file with n rows each one with x,y,z values. These values are referred to a coordinate system (i know this one). If i do that, i can create earth and seaground with osgdem then i will assembly them with osgearth. Is it right? Thank you! Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16732#16732 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Point Cloud
Dear Robert, Your suggestion has been very useful to me, i have now 60 fps with the same point cloud. For the hole i am trying to test the driver above. Thank you. Best regards, Jagovic Hi Jago? Jagoc? Could you please sign with your first name so we know how to address you correctly, thanks, On Tue, May 19, 2009 at 9:43 AM, jago jagoc jago...@gmail.com wrote: Dear All, i am trying to visualize a point cloud with Openscenegraph,there are about 1 707 708 points but it should be more,there are some problem when i zoom in or out, some hole appear on the cloud. You can see the effect in the picture ZoomIn.jpg in the other the normal view. I load the points from file and put toghether in a Geode The way I've done large point clouds (10 million points +) is to use VBO's and segmentation of the geometry so the points are stored in a series of osg::Geometry each of which have a 10,000 vertices in them. The 3dc plugin does this so have a look at how it's implemented. The need to chunking up the geometry like this is that graphics cards/OpenGL drivers work when you give them data is blocks that they get easily download asynchronously and store locally on the graphics card when required. I can't explain the holes, sounds like a driver bug. Try the above it might well just solve the problem. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org