[osg-users] Increasing line width

2012-10-17 Thread Filip Arlet
Hi,

I want to highlight part of CAD model. I have big symbol with lines, that have 
different line width. Now I want to render that lines with +4.0f linewidth 
according to original width of every line.

What is the best approach?

Thank you!

Cheers,
Filip

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50642#50642





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] LineSegmentIntersector gives incorrect results (intersections missing)

2012-10-17 Thread Peter Bako
Hi,

I've got a problem with line segment intersector. Sometimes I get only one 
intersection (on the bootom side of the table), while I should get two. 
Please check the screenshot.

Do you have any idea why this happens? What should I do?
STLFILE.stl (ZIPPED) is attached
Thank you!

Cheers,
Peter

Hold CTRL key to activate intersection output.
This is the code I use:

Code:
#include stdafx.h
#include osgViewer/Viewer
#include osgDB/ReadFile
#include osgUtil/LineSegmentIntersector


class PickHandler : public osgGA::GUIEventHandler
{
public:
  
virtual bool handle( const osgGA::GUIEventAdapter ea, 
osgGA::GUIActionAdapter aa )
{
if ( ea.getEventType()!=osgGA::GUIEventAdapter::RELEASE ||
 ea.getButton()!=osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON ||
 !(ea.getModKeyMask()osgGA::GUIEventAdapter::MODKEY_CTRL) )
return false;

osgViewer::Viewer* viewer = dynamic_castosgViewer::Viewer*(aa);
if ( viewer ){
osg::ref_ptrosgUtil::LineSegmentIntersector intersector =
new 
osgUtil::LineSegmentIntersector(osgUtil::Intersector::WINDOW, ea.getX(), 
ea.getY());
osgUtil::IntersectionVisitor iv( intersector.get() );
iv.setTraversalMask( ~0x1 );
viewer-getCamera()-accept( iv );

if ( intersector-containsIntersections() ){
const 
osgUtil::LineSegmentIntersector::Intersection result =
*(intersector-getIntersections().begin());
printf(Intersection count:%d. Coordinates: %.2f, %.2f, 
%.2f\n, 
intersector-getIntersections().size(), 
result.getWorldIntersectPoint().x(),result.getWorldIntersectPoint().y(),result.getWorldIntersectPoint().z());

}
}
return false;
}

};

int main( int argc, char** argv )
{
osg::ref_ptrosg::Node model1 = osgDB::readNodeFile( STLFILE.stl );
osg::ref_ptrosg::Group root = new osg::Group;
root-addChild( model1.get() );
osg::ref_ptrPickHandler picker = new PickHandler;
osgViewer::Viewer viewer;
viewer.setSceneData( root.get() );
viewer.addEventHandler( picker.get() );
return viewer.run();
}




--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50644#50644




Attachments: 
http://forum.openscenegraph.org//files/intersection_errors_639.png
http://forum.openscenegraph.org//files/stlfile_974.zip


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Increasing line width

2012-10-17 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Take a look at the createAxis() in the osgbillboard.cpp file for the
osgbillboard example. There's code in there to set linewidth...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Filip
Arlet
Sent: Wednesday, October 17, 2012 3:55 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Increasing line width

Hi,

I want to highlight part of CAD model. I have big symbol with lines,
that have different line width. Now I want to render that lines with
+4.0f linewidth according to original width of every line.

What is the best approach?

Thank you!

Cheers,
Filip

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50642#50642





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Increasing line width

2012-10-17 Thread Chris Hanson
On Wed, Oct 17, 2012 at 9:18 AM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC shayne.tuel...@hill.af.mil wrote:

 Take a look at the createAxis() in the osgbillboard.cpp file for the
 osgbillboard example. There's code in there to set linewidth...


  Rather than altering the model (which break displaylists or other
compiled geometry representations and requires DYNAMIC datavariance) I
recommend re-drawing the highlighted part one more time, after the rest of
the model has drawn itself. You can usually use a nodemask to perform this
trick. You may wish to clone the original entity, set the line width wider,
and draw that clone, so you don't disrupt the state of the original.

  Set your Z-buffer depth test to GL_LEQUAL so that re-drawing the same
part actually draws it again, over top of the copy already represented in
the Z-buffer.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] X11 Trouble, Building OSG with OpenGL ES 2.0

2012-10-17 Thread James Athey
Chris,

I've also done some work toward pure EGL support, intending to improve support 
for Android in OSG.  How far along is your EGL work?  I've got most of the EGL 
context and surface management done in implementations of 
osg::GraphicsContext::WindowingSystemInterface and osgViewer::GraphicsWindow.

I could separate the pure EGL calls from my Android-specific code to create a 
osgViewer::GraphicsWindowEGL that implements

closeImplementation()
makeCurrentImplementation()
realizeImplementation()
releaseContextImplementation()
swapBuffersImplementation()

Then, it would be straightforward to subclass GraphicsWindowEGL to make a 
GraphicsWindowAndroid or a GraphicsWindowLinuxEGL that would implement the 
remaining virtuals like GraphicsWindow::checkEvents().

Thoughts?

James Athey
APX Labs

From: Chris Hanson xe...@alphapixel.commailto:xe...@alphapixel.com
Reply-To: OpenSceneGraph Users 
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
Date: Monday, October 15, 2012 10:14 AM
To: 
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org 
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] X11 Trouble, Building OSG with OpenGL ES 2.0

my current system is running with a X11, but it would be nice just to kick it?
Did you get it running without x11?

Yes. However, there was a lot of OSG Windows and Linux support code that needed 
writing and updating in order to support pure EGL calls (instead of EGL calls 
that also rely on X11), so we ended up creating the EGL context outside of OSG 
and using osgViewerEmbedded, which worked ok.

If you're interested in having full and proper EGL support, we could possibly 
pick up the work I began, and finish it in a reasonable amount of budget.

--
Chris 'Xenon' Hanson, omo sanza lettere. 
xe...@alphapixel.commailto:xe...@alphapixel.com http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • 
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR 
• Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] X11 Trouble, Building OSG with OpenGL ES 2.0

2012-10-17 Thread Chris Hanson
I've also done some work toward pure EGL support, intending to improve
support for Android in OSG.  How far along is your EGL work?  I've got most
of the EGL context and surface management done in implementations of
osg::GraphicsContext::WindowingSystemInterface and
osgViewer::GraphicsWindow.

  Mine never got that far. I think started with GraphicsWindowX11 (which if
I recall, has some EGL support) and tried removing all the X11 code,
substituting it with the proper EGL replacements. I didn't get all that
far, because the PowerVR emulator wouldn't run properly on the Linux box we
were using for testing. At that point, we discussed the clients ACTUAL
needs as opposed to the requirements and realized that using
GraphicsWindowEmbedded was really what they needed anyway, so the work was
abandoned.


  I could separate the pure EGL calls from my Android-specific code to
 create a osgViewer::GraphicsWindowEGL that implements
 closeImplementation()
 makeCurrentImplementation()
 realizeImplementation()
 releaseContextImplementation()
 swapBuffersImplementation()
 Then, it would be straightforward to subclass GraphicsWindowEGL to make a
 GraphicsWindowAndroid or a GraphicsWindowLinuxEGL that would implement the
 remaining virtuals like GraphicsWindow::checkEvents().


Thoughts?


  That seems pretty logical to me, but I think you'd want to discuss it
with some of the other Android and iOS guys and see how it would fit with
that. It would seem that GraphicsWindowLinuxEGL, GraphicsWindowWin32EGL and
GraphicsWindowPureEGL would make sense. Our target was an embedded Linux
with EGL/GLES but no X11, so we needed a solution that didn't care about
events and such that could never arrive anyway. PureEGL should work on
Linux or Windows or Mac, if your EGL implementation is able to open a
context without specifying a default display or existing window to attach
it to.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] nVidia bug with multiple windows

2012-10-17 Thread Bradley Baker Searles
Hi J-S,

That's a good idea, and I just submitted the example to them. I'll go ahead and 
post the zip file here too just for posterity, as it's self-contained other 
than the Visual Studio 2010 runtimes.

Actually, I posted it via their website and not directly to that e-mail 
address, perhaps I'll do that as well. My initial plan was to put it on their 
dev forums, but apparently they're still down from the big security breach a 
few months ago!

Thanks-
Baker

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50650#50650




Attachments: 
http://forum.openscenegraph.org//files/20121017_nvidia_osg_multiplewindowissue_180.zip


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [vpb] On adding GL_FLOAT / GL_LUMINANCE32F Texture Support

2012-10-17 Thread Paul Leopard
I need to retain my texture information in a full 32 bit float format as my 
textures store temperature values in high precision celsius units. I added a 
parser to GDAL to load my terrain and texture datasets from their respective 
file formats and that part is working just fine.

Looking over the osgDem options I see --RGBA32F and --RGB32F options but what I 
need is a --LUMINANCE32F option. So, I am digging through the code to figure 
out how to do this.

I have found the point in Destination.cpp where the image sets are being 
retrieved and I checked the GL pixel format and data type of the image 
instances at that point. They show GL_FLOAT as the pixel data type and GL_RGBA 
as the pixel data format.

Can you direct me to the point that the incoming texture data is being 
converted from GL_LUMINANCE32F to GL_RGBA? I would like to modify it so that my 
textures were not chopped and quantized so that I can retain the incoming 
precision and units.

Thanks,
Paul

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50651#50651





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg::Sequence boundingsphere

2012-10-17 Thread Marc-André Labrie
Hi,

Is there a reason why an osg::Sequence does not calculates its
boundingsphere based only on its active child (rather than using all of
them)?

I can define my own Sequence and override the getBounds() method; but I
want to know why it is not the default behavior.

Thanks

Marc-Andre
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [forum] Wiki editing contact

2012-10-17 Thread Philip Lamb
Hi all,

Who is responsible for assigning permissions to edit the OSG wiki? I followed 
the instructions here: 
http://www.openscenegraph.org/projects/osg/wiki/About/WikiEditing

but have had no response.

Some of the information on the wiki is woefully out of date and it would make 
sense to get community help to fix it.

Regards,
Phil

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50653#50653





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Sequence boundingsphere

2012-10-17 Thread Ulrich Hertlein
Hi Marc-Andre,

On 18/10/12 11:30, Marc-André Labrie wrote:
 Is there a reason why an osg::Sequence does not calculates its boundingsphere 
 based only
 on its active child (rather than using all of them)?
 
 I can define my own Sequence and override the getBounds() method; but I want 
 to know why
 it is not the default behavior.

From the source it looks like manually setting the traversal mode to
TRAVERSE_ACTIVE_CHILDREN would do the trick.

But it does feel like a better default IMO.

Cheers,
/ulrich

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Memory usage

2012-10-17 Thread Ulrich Hertlein
Hi Nikos,

On 13/10/12 1:29, Nikos Babasakalis wrote:
 Using test data from the external application and saving the graph to osg 
 files,
 I observed that their size is very big (88 MB in one case and 115 MB in 
 another).
 Moreover the memory consumption is very high (about 130 MB in one case and 
 350 MB in another)
 and it will be a serious problem when trying to depict more than one sets of 
 data 
 (in different child windows of the MDI application)
 
 Are there any guidelines for reducing the memory usage? 

You're not really telling us much about your data, like how many vertices, 
textures, etc.

Sharing image data might be a good candidate, but it you have millions of 
triangles then
that that gives you a minimum memory footprint.

Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Sequence boundingsphere

2012-10-17 Thread Marc-Andre Labrie
Hi ulrich

I guess you are referring to a node visitor when you wrote about 
TRAVERSE_ACTIVE_CHILDREN. I have inspected the code but could not find this 
mechanism for computing the bounding sphere: I thought computebound was called 
sequentially on every children after getbound is called on a node.

Thanks

Marc-Andre


Le 2012-10-17 à 22:20, Ulrich Hertlein u.hertl...@sandbox.de a écrit :

 Hi Marc-Andre,
 
 On 18/10/12 11:30, Marc-André Labrie wrote:
 Is there a reason why an osg::Sequence does not calculates its 
 boundingsphere based only
 on its active child (rather than using all of them)?
 
 I can define my own Sequence and override the getBounds() method; but I want 
 to know why
 it is not the default behavior.
 
 From the source it looks like manually setting the traversal mode to
 TRAVERSE_ACTIVE_CHILDREN would do the trick.
 
 But it does feel like a better default IMO.
 
 Cheers,
 /ulrich
 
 ___
 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