[osg-users] Question about OSG rasterisation relevant questions.
To who it may concern, Merry Christmas and a Happy New Year. I have the following two questions about the OSG library. In the context of two 3D objects in a lit 3D universe, with one camera pointing to view those two objects, -Is there default backface culling elimination that goes on by default before objects are sent to screen, in OSG? -Are there any default occluding calculations that go on with multiple relative 3D objects in an OSG 3D Universe before things are sent to screen? Is this calculating, at default, entirely ignored, or partly ignored? Happy New Year! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] openGL error 'stack overflow' at after RenderBin::draw(..)
Hi, I am trying to draw lines on the screen. And I am trying to use pure openGL to draw lines.The lines can be drawn on the screen. But I get openGL error 'stack overflow' at after RenderBin::draw(..) message. My code is below: Code: void draw::drawImplementation(osg::RenderInfo& renderInfo) const { Viewport* viewPort = renderInfo.getCurrentCamera()->getViewport(); double width = viewPort->width(); double height = viewPort->height(); double orgX = width / 2; double orgY = height / 2; osg::Quat matrix = renderInfo.getCurrentCamera()->getViewMatrix().getRotate(); glEnable(GL_LINE_SMOOTH); glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(0.0, width, 0.0, height, -1, 1); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glTranslated(orgX, orgY, 0); glRotated(rotate, 0, 0, 1); glTranslated(-orgX, -orgY, 0); glLineWidth(2.0f); glColor4d(0, 255, 0, 255); glBegin(GL_LINES); if (orgY < height && orgY > 0) { glVertex2d(orgX + 25, orgY); glVertex2d(orgX + 260, orgY); glVertex2d(orgX - 25, orgY); glVertex2d(orgX - 260, orgY); } glEnd(); glLineWidth(5.0f); glColor4d(0, 0, 0, 255); glBegin(GL_LINES); if (orgY < height && orgY > 0) { glVertex2d(orgX + 23, orgY); glVertex2d(orgX + 262, orgY); glVertex2d(orgX - 23, orgY); glVertex2d(orgX - 262, orgY); } glEnd(); glLineWidth(2.0f); glColor4d(0, 255, 0, 255); glBegin(GL_LINES); int yLoc = orgY + 250; for (int i = 0; i < 17; i++) { if (yLoc < height && yLoc > 0) { glVertex2d(orgX + 25, yLoc); glVertex2d(orgX + 165, yLoc); glVertex2d(orgX - 25, yLoc); glVertex2d(orgX - 165, yLoc); glVertex2d(orgX - 165, yLoc); glVertex2d(orgX - 165, yLoc - 20); glVertex2d(orgX + 165, yLoc); glVertex2d(orgX + 165, yLoc - 20); } yLoc = yLoc + 250; } glEnd(); glLineWidth(5.0f); glColor4d(0, 0, 0, 255); glBegin(GL_LINES); yLoc = (int)orgY + 250; for (int i = 0; i < 17; i++) { if (yLoc < height && yLoc > 0) { glVertex2d(orgX + 23, yLoc); glVertex2d(orgX + 165, yLoc); glVertex2d(orgX - 23, yLoc); glVertex2d(orgX - 165, yLoc); glVertex2d(orgX - 165, yLoc); glVertex2d(orgX - 165, yLoc - 22); glVertex2d(orgX + 165, yLoc); glVertex2d(orgX + 165, yLoc - 22); } yLoc = yLoc + 250; } glEnd(); } Thank you! Cheers, Nebi[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75339#75339 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem in loading VPB database from server by libcurl
Hi, I can successfully load a single model file from a server by calling osgDB::readNodeFile() with its URL as the input parameter in my application. However, for a VPB database with a topmost file, a crash is obtained in EasyCurl::StreamMemoryCallback() of ReaderWriterCURL.cpp where the pointer "sp" is NULL. And the error message listed in the console are something like " Error: libcurl read error, file=http ://localhost:8080/test1_root_L0_X0_Y0/../test1_subtile_L1_X0_Y0/test1_L2_X0_Y1_subtile.osgb error = Failed initialization Error: libcurl read error, file=http ://localhost:8080/test1_root_L0_X0_Y0/../test1_subtile_L1_X0_Y0/test1_L2_X0_Y1_subtile.osgb error = Failed initialization Error in reading file http ://localhost:8080/test1_root_L0_X0_Y0/../test1_subtile_L1_X0_Y0/test1_L2_X0_Y1_subtile.osgb : file not handled .. " So, I have made some test to track the problem and find that: 1. The topmost model can be loaded and viewed always, but not to some of its subtiles. 2. Any of the unhandled files in the error list can be downloaded in web browser with its URL(http ://localhost:8080/test1_root_L0_X0_Y0/../test1_subtile_L1_X0_Y0/test1_L2_X0_Y1_subtile.osgb, for example). 3. Any of the unhandled files in the error list can be requested only using libcurl with its URL. 4. The contents of the error list could be different with the application running each time, that's to say some one file can be handled in one run but not to another run. Any ideas on why is this happening? BTW, I'm using OSG 3.5.6 in Win7. Thank you, in advance! Cheers, peckham -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75340#75340 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Colors on GL_LINES
Lighting is enabled, which is why the line darkens based on camera position. Disable lighting on line_geometry. Search osg examples for GL_LIGHTING to see how. --- Ravi Sent from my phone, please excuse my brevity. On Sun, Dec 23, 2018, 4:46 PM Diego Mancilla Hello, > > I'm drawing some simple lines on osg. So far I have successfully draw the > lines and set a single color for each of them... but when I rotate the view > the color is shown only on one direction of the camera, for instance, if > rotate on 180 degrees the view, all lines are shown in black (looking from > "down")... how can I get that the color of the lines is correctly shown > regardless of the position/orientation of the camera on the viewer? > > > > Code: > osg::Geode * root = getRoot(); > osg::Vec4Array * color = new osg::Vec4Array; > double r, g, b, a; > r = 1.0; > g = 0.0; > b = 0.0; > a = 1.0; > color->push_back(osg::Vec4d(r, g, b, a)); //single color > osg::Vec3Array* osg_points = new osg::Vec3Array; > ... > Here I fill the vertex array > ... > osg::Geometry* line_geometry = new osg::Geometry; > line_geometry->setVertexArray(osg_points); //osg_points has the points of > the lines > line_geometry->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP, 0, > osg_points->size())); > line_geometry->setColorArray(color); > line_geometry->setColorBinding(osg::Geometry::BIND_OVERALL); > root->addDrawable(line_geometry); > > > > Thank you! > > Cheers, > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=75341#75341 > > > > > > ___ > 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] Colors on GL_LINES
Hello, I'm drawing some simple lines on osg. So far I have successfully draw the lines and set a single color for each of them... but when I rotate the view the color is shown only on one direction of the camera, for instance, if rotate on 180 degrees the view, all lines are shown in black (looking from "down")... how can I get that the color of the lines is correctly shown regardless of the position/orientation of the camera on the viewer? Code: osg::Geode * root = getRoot(); osg::Vec4Array * color = new osg::Vec4Array; double r, g, b, a; r = 1.0; g = 0.0; b = 0.0; a = 1.0; color->push_back(osg::Vec4d(r, g, b, a)); //single color osg::Vec3Array* osg_points = new osg::Vec3Array; ... Here I fill the vertex array ... osg::Geometry* line_geometry = new osg::Geometry; line_geometry->setVertexArray(osg_points); //osg_points has the points of the lines line_geometry->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP, 0, osg_points->size())); line_geometry->setColorArray(color); line_geometry->setColorBinding(osg::Geometry::BIND_OVERALL); root->addDrawable(line_geometry); Thank you! Cheers, -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75341#75341 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Questions concerning Performance issues using model with bones and animation
Hi, I'm having the same issue with bones and I can't use an hardware approach easily in my project. I've tested with a simple model that have different bones. Is there some way to find what the problem is? Cheers -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75319#75319 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org