I followed the example of osgkeyboardmouse to replace a picked node with a Scribe node and the picked object as a child.

The problem I'm having is that the picked object disappears for a frame after I pick it. In other other words after the scene is drawn once then the picked object appears as it should.

I'm using:

wxWidgets (2.6.) as a gui
OSG 1.2 (downloaded from web, but compiled by me)
Producer::RenderSurface as the drawing surface
Windows XP Pro
MS VS 8 Express Edition

Inside my "render" function I have something like this:

{
  sceneView->setViewport(0,0,renderSurface->getWindowWidth(),
                             renderSurface->getWindowHeight());
  // Update view and projection matrices
  sceneView->setProjectionMatrixAsOrtho(-ortho_zoom_factor*aspectRatio,
                                         ortho_zoom_factor*aspectRatio,
                                        -ortho_zoom_factor,
                                         ortho_zoom_factor,
                                         -200, 200);
  sceneView->setViewMatrix(viewMatrix);

  renderSurface->makeCurrent();
  // do the update traversal the scene graph - such as updating
  // animations
  sceneView->update();
  sceneView->cull();
  sceneView->draw();
  renderSurface->sync();
  // Swap Buffers
  renderSurface->swapBuffers();
}

My pick function does the picking, modifies the geometry shared by the sceneView's root node, and calls the wxWidgets function Refresh() which causes my "render" function to get called (which it is).

Again, after I render the scene once, the picked object disappears, and then subsequent frame renderings the object appears with the scribe look. If I unpick an object (remove the scribe node) the unpicked node appears right away (after only a single frame draw).

Thanks,
James
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to