Re: [osg-users] Setting a monochrome 2d texture from byte array

2019-11-05 Thread Steve Hardy
Hi, Thanks for the responses. I tried Robert's initial suggestions, but they get Code: Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..) on my system. Glenn's suggestion basically worked, although the image was literally shades of red. So I looked at the DefaultFo

[osg-users] Setting a monochrome 2d texture from byte array

2019-11-04 Thread Steve Hardy
Hi, I am trying to render a monochrome camera image to a 2d texture, but without success unless I first convert it to BGR. After reading http://forum.openscenegraph.org/viewtopic.php?t=16236 I got closer, but still no cigar as the result is a boring uniform black. Here is some code: Code: v

Re: [osg-users] Intersection with 2d plane embedded in 3d

2019-05-21 Thread Steve Hardy
Hi Robert, Thanks for the reply. I take it that quad intersection is the right approach for this problem. So follow-up question: what would be a good way to improve efficiency? I know exactly which quad to intersect, but don't want intersection to test against all the other zillions of geodes

Re: [osg-users] Intersection with 2d plane embedded in 3d

2019-05-20 Thread Steve Hardy
Trying to answer my own question by using the form of View::computeIntersections() which takes a node path parameter. The following code (as a member of my View subclass) doesn't seem to work (even though the simpler deprecated form works)... Code: osg::Geode* geode = ...; osgUtil::LineS

[osg-users] Intersection with 2d plane embedded in 3d

2019-05-20 Thread Steve Hardy
Hi, Is there any way to create a "virtual infinite" quad (i.e. plane) that satisfies the intersection test, but without being rendered itself? Or is there a good way of converting screen coordinates to "local" embedded 2d model coordinates? Motivation: My application has line strips and other

Re: [osg-users] OSG in Gtk3 GLArea

2018-06-06 Thread Steve Hardy
Hi Robert, OK I will check out the resize policy settings. Excellent point about inverting the projection matrix. Since the last post, I managed to eliminate most of the copying, with the single remaining copy reversing the pixel row order on-the-fly. Since that copy is unavoidable, in the e

Re: [osg-users] OSG in Gtk3 GLArea

2018-06-05 Thread Steve Hardy
So far, the kludge solution is almost working. I needed to add glPixelStorei(GL_PACK_ALIGNMENT, 1); before glReadPixels() otherwise it broke if the window width wasn't a multiple of 8. Problems remaining: 1. the aspect ratio does not adjust properly on window size changes, so that the sc

Re: [osg-users] OSG in Gtk3 GLArea

2018-06-05 Thread Steve Hardy
Hi Robert, The full application uses the following: - read .wrl files using osgDB::readNodeFile() - create geometry nodes dynamically with quads, lines, line strip. - billboards with text - osgSim::DOFTransform, osg::MatrixTransform - osg::Camera (additional cameras for HUD or inset display) - os

Re: [osg-users] OSG in Gtk3 GLArea

2018-06-05 Thread Steve Hardy
Hi kornerr, Thanks for the heads up. I'll give it a try when I get back to core profile work, which I will feel better about once I have a kludge that works well enough to keep the boss happy. We basically use only geodes, switches and model transforms, along with some state settings like ble