[osg-users] Bug in osgGA::GUIEventHandler in OSG 3.0.1 release (fixed in current trunk).

2013-01-22 Thread Jesper D. Thomsen
Hi guys,

Our software uses OSG for displaying a modelview for our muscular-skeletal 
simulation software. In our latest beta-version we have switched to OSG 3.0.1, 
but we just yesterday found a bug related to osgGA::GUIEventHandler, which we 
use for handling mouse events in our modelview. If we create a new OSG graph 
but keep the drawing context, the osgGA::GUIEventHandler for the view would 
sometimes not receive the usual (MOVE, MOVE, ...,  MOVE, MOVE, PUSH, RELEASE, 
FRAME) sequence of osgGA::GUIEventAdapter's when pressing a mousebutton in the 
view. If the modelview was left open for a period of time (tens of seconds to 
minutes), the next mousebutton push would trigger and send any saved up event 
to the GUIEventHandler. We previously used OSG 2.9.11, where this issue doesn't 
seem to occur, and I have just tested our software with a fresh OSG 3.1.4 built 
from svn trunk, and it also seems to work correctly.

My question is if this is a known bug from the OSG release version which has 
been fixed, and if there's any plan for either a new official release version 
of OSG or at least a developer release in the short term future (1-2 months)?

Best regards, and thanks

Jesper D. Thomsen
AnyBody Technology
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Windows 8 x64

2012-11-19 Thread Jesper D. Thomsen
Hi,

Just wanted to let you know that I have tried compiling both x86 and x64 
versions of OpenSceneGraph 3.0.1 with VS2012. I did a rebuild of the various 
basic dependencies myself, but I haven't posted them here as they're not well 
tested yet. I built with Freetype 2.4.10, GDAL, jpeg, libpng 1.5, libtiff and 
zlib 1.2.7.

Best regards

Jesper D. Thomsen

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben 
Dannhauer
Sent: 19. november 2012 09:42
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Windows 8 x64

Hi,
Currently I'm migration (non-voluntary) to Windows 8 X64. so I decided also to 
upgrade my Build Env from VS2008 to VS2012.

I'll build my 3rdParty Package for VS2012 but this will take some days/weeks. I 
plan to provide it as a minimum and a full package this time.

I'll drop a notice if it is available.



Cheers,
Torben

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





___
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] Is it possible to get OpenGL calls as output from OSG?

2012-01-30 Thread Jesper D. Thomsen
Hi guys,

I have what may be a little bit of an unusual question regarding usage of 
OpenSceneGraph.
In our application we use OSG for drawing views of a dynamically created and 
animated model, which has so far worked out very well for us.
We are now in the situation where we would like to be able to interface with 
various CAD packages and be able to show our model inside them. A number of CAD 
packages support this by allowing plugins to render OpenGL calls within the 
host CAD programs viewports (so that the viewport can contain the combined 
contents of the plugin drawing and elements from the host CAD program).
I am wondering if I can somehow use our existing setup for generating these 
OpenGL calls directly from OSG. Would it somehow be possible to draw to a 
kind of OpenGL call buffer rather than directly to a drawing context from 
OpenSceneGraph. I guess that there's no code in OSG which can do this directly, 
but I was thinking that it might be possible to create a substitution for 
GraphicsWindow32 where I could catch the OpenGL calls being generated, and then 
transfer them to a plugin in the CAD program from there.
I do however see some possible issues where OSG is aware of the exact stage of 
the OpenGL setup, and I would somehow have to flush this when generating the 
OpenGL call stack.

Regards, and thanks in advance.

Jesper D. Thomsen
AnyBody Technology
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Exporting to SVG from OpenSceneGraph.

2011-12-16 Thread Jesper D. Thomsen
Hi again,

Yeah, the original question was rendering to Vector SVG (or EMF directly), but 
osgNVPR definitely looks interesting for other tasks.
Thanks for the suggestions regarding GL2PS, but I'm a little bit worried about 
its dependence on the deprecated OpenGL feedback buffer. I also tried getting 
an OpenGL-SVG test output from it, and converting that one to EMF, and I had a 
number of graphical artifact with visible triangle edges and such.

I'm currently thinking that the best solution for my specific case will be to 
recreate the graphs by outputting to Python MatPlotLib and using it for SVG/EMF 
export, but this is clearly outside the scope of the OSG mailing list.

Thanks for the suggestions, and I might still try to integrate the GL2PS 
solution at some point.

Jesper D. Thomsen
AnyBody Technology

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason Daly
Sent: 15. december 2011 18:03
To: OpenSceneGraph Users
Subject: Re: [osg-users] Exporting to SVG from OpenSceneGraph.

On 12/15/2011 11:37 AM, Chris 'Xenon' Hanson wrote:
 On 12/14/2011 9:31 AM, Jason Daly wrote:
 Actually, Jeremy Moles is working on a nodekit that uses nVidia's 
 path rendering extension to OpenGL to render 2d vector graphics in 3d 
 space.  I believe the extension can read SVG files natively, so Jeremy's 
 osgNVPR kit should be able to as well.
But, I think that's the reverse of what he wanted to do, right?


Probably.  The OP asked whether one could render to vector SVG from 
OpenSceneGraph.  I guess I read it too quickly and missed the to   :-)

--J

___
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] Exporting to SVG from OpenSceneGraph.

2011-12-14 Thread Jesper D. Thomsen
Hi guys,

I have a question regarding exporting to SVG from OpenSceneGraph.
In our software product we use OpenSceneGraph for both a model view window and 
for a charting component. So far we have exported images from the charting 
component as bitmap images (by just rendering them to an offscreen pixelbuffer 
in the required resolution). We have however had some requests for exports from 
our charting component in a vector format compatible with the Microsoft Office 
software package (which pretty much means EMF files).

Since EMF is very Microsoft-specific, I was thinking of using SVG as an 
intermediate format, and then using some converter package to create the EMF 
output.
I saw SVG mentioned on the OSG mailing list earlier, but my question is whether 
there is any way to render to vector SVG from OpenSceneGraph (I kind of expect 
a hard no here)?

The graph contents can be both 2D and 3D graphs and the 3D graphs can contain 
shaded, but non-textured, 3D-surfaces.

Thanks in advance.

Jesper D. Thomsen
AnyBody Technology
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Forward declarations and ref_ptr members

2011-02-09 Thread Jesper D. Thomsen
Thank you very much.
 I also came up with your second solution during testing, and I might just 
stick with that, but I'll have a look at the pimpl pattern before surrendering 
completely. At least it might go into the to-do list for future refactoring.

Thank you for your help.

Jesper D. Thomsen
AnyBody Technology A/S

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jean-Sébastien 
Guay
Sent: 8. februar 2011 15:22
To: OpenSceneGraph Users
Subject: Re: [osg-users] Forward declarations and ref_ptr members

Hi Jesper,

 error C2079: 'asg::ASGContainer::m_osgroot' uses undefined class 
 'osg::ref_ptrT'

Template classes/methods need to be completely defined when they are used, so 
what you're trying won't work.

In addition to using the pimpl idiom which would completely solve your problem 
but might take some time to implement everywhere it would be needed, you could 
get by just including osg/ref_ptr and forward declaring the classes that will 
be contained in a ref_ptr. So instead of:

namespace osg
{
 class Node;
 class Material;
 template typename T class ref_ptr; };

you could do:

#include osg/ref_ptr

namespace osg
{
 class Node;
 class Material;
};

The ref_ptr header is small and if that is the only one included in most places 
then you've got 98% of what you wanted for much less effort than using pimpl 
everywhere. That said, if I were designing an OSG-based API today I would 
probably use pimpl from the start and keep my public interface independent of 
OSG as much as I can. But that's just a design preference, and when refactoring 
existing code the decisions are different...

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
 http://whitestar02.webhop.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


[osg-users] Forward declarations and ref_ptr members

2011-02-08 Thread Jesper D. Thomsen
Hi all, I'm trying to prune out the number of includes in my headers, in order 
to keep from including OSG in all parts of my application.
I have a couple of places where I would like to forward declare osg::ref_ptr, 
but so far I have had no success with that.
Specifically, I would like to forward declare:

osg::ref_ptrosg::Material
And
osg::ref_ptrosg::Node

I tried adding:

namespace osg
{
class Node;
class Material;
template typename T class ref_ptr;
};

To the header file as suggested in the thread titled Forward declared classes 
and ref_ptrs, but I'm still getting the following error:
error C2079: 'asg::ASGContainer::m_osgroot' uses undefined class 
'osg::ref_ptrT'

I searched a bit on the internet and saw that in Boost they had made some 
special additions to their reference counted pointer in order to enable forward 
declarations.
If osg::ref_ptr doesn't support forward declarations, I can of course refactor 
my classes a bit in order to control which ones include OSG, but I would prefer 
using the forward declaration.

Regards, and some forward declared thanks :)

Jesper D. Thomsen
AnyBody Technology A/S

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


[osg-users] OpenSceneGraph website appears to be down, again :)

2011-01-06 Thread Jesper D. Thomsen
Hi all, I was looking for the current VS2010 3rdparty dependencies, but the OSG 
website seems to be down again.

Cheers,

Jesper D. Thomsen
AnyBody Technology A/S

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


Re: [osg-users] Window content stretching when resized after updating from 2.6.1 to 2.8.3

2010-12-02 Thread Jesper D. Thomsen
Hi Robert, thank you very much for your answer. It led me to implement at 
rather hacky (in my mind at least solution).

Instead of :
double r = (double)m_OSGView.aspect_ratio*t;

I now use:

double r = (double)m_OSGView.aspect_ratio*(double)m_OSGView.aspect_ratio*t / 
mOSG-getOriginalAspect(); //where mOSG-getOriginalAspect() is the aspect 
ratio from the creation time of the graphicscontext.

This gives me exactly the same view as in my 2.6.1 version when resizing the 
window, even though it feels very hacky.

Thank you very much for your help.

Jesper D. Thomsen
AnyBody Technology A/S



-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: 2. december 2010 14:40
To: OpenSceneGraph Users
Subject: Re: [osg-users] Window content stretching when resized after updating 
from 2.6.1 to 2.8.3

Hi Jasper,

There is chance that the issue comes from a fix to a bug rather than 
introduction of a bug, with your original code working around the bug.
 Removing the workaround could well just fix things.  The reason why I suggest 
that is that I recall merging fixes to the way the projection matrices are 
updated, I don't recall the dates though, but I'm sure it's since 2.6.x.

Try just removing your code that attempts to update the projection matrix when 
you the window is resized.

Robert.

On Thu, Dec 2, 2010 at 12:46 PM, Jesper D. Thomsen j...@anybodytech.com wrote:
 Hi all, I had hoped I would figure this out myself, but no luck so far.



 I just upgraded my OSG usage from 2.6.1 to 2.8.3, and without changing 
 anything about how my windows are set up, I'm now getting a behavior 
 where the viewed contents of a window stays the same when the window 
 is rescaled, whereas in 2.6.1 I would have a constant pixel-size for 
 the contents of the window when resized. Please see the attached 
 images if I'm not making myself clear enough (please note that the 
 HUD-text is supposed to be stretched to the window size in both versions).



 I'm using a release OSG 2.8.3, compiled on Visual Studio 2005 sp1, on 
 Vista
 64 (Nvidia Quadro graphics card).



 The camera and graphics context are created like this (done once):



 RECT rect;

 mViewer = new osgViewer::Viewer();

 mViewer-setThreadingModel(osgViewer::Viewer::SingleThreaded);

 ::GetWindowRect(m_hWnd, rect);

 osg::ref_ptrosg::GraphicsContext::Traits traits = new 
 osg::GraphicsContext::Traits;

 osg::ref_ptrosg::Referenced windata = new 
 osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

 traits-x = 0;

 traits-y = 0;

 traits-width = rect.right - rect.left;

 traits-height = rect.bottom - rect.top;

 traits-windowDecoration = false;

 traits-doubleBuffer = true;

 traits-sharedContext = 0;

 traits-setInheritedWindowPixelFormat = true;

 traits-supportsResize = true;

 traits-inheritedWindowData = windata;

 m_gc = osg::GraphicsContext::createGraphicsContext(traits.get());

 camera = mViewer-getCamera();

 camera-setGraphicsContext(m_gc.get());

 camera-setViewport(new osg::Viewport(traits-x, traits-y, 
 camera-traits-width,
 traits-height));

 mViewer-addSlave(camera.get());



 And for each frame I'm drawing I'm setting the camera like this:



 mOSG-getViewer()-getCamera()-getGraphicsContext()-resized(x, y, w, 
 mOSG-h);

 mOSG-getViewer()-getCamera()-setViewport(x,y,w,h);

 double n = (double)m_OSGView.near_dist;

 double f = (double)(m_OSGView.far_dist + 
 m_OSGView.eye_dist_add_ortho);

 double t = (double)(m_OSGView.focal_height/2.0f);

 double r = (double)m_OSGView.aspect_ratio*t;

 mOSG-getViewer()-getCamera()-setProjectionMatrixAsOrtho(-r,r,-t,t,n
 mOSG-,f*50);




 The eyepoint is set via setViewMatrix elsewhere.



 This worked just fine in OSG 2.6.1, but the behavior has changed in 
 2.8.3, and I know that's it's probably something I'm either doing 
 wrong or forgetting to do, but I would like to keep the pixel-aspect 
 the same when resize the view, and any help/hints would be most 
 welcome. I'm just about to create a new graphicscontext with new 
 traits for each window resize, but I just know that that can't be the proper 
 way to solve this.



 Regards, and thanks in advance.





 Jesper D. Thomsen

 AnyBody Technology A/S



 ___
 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] Window content stretching when resized after updating from 2.6.1 to 2.8.3

2010-12-02 Thread Jesper D. Thomsen
Hi again, you are naturally quite right. I did a search for osg camera aspect 
ratio, and it turned out that there was a change in 2.8.0 regarding ABSOLUTE_RF 
for slave cameras. Setting this for my slave camera which is displaying the 
view fixed the problem completely (as far as I can tell). It might be 
absolutely correct that I'm still jumping through a couple of hoops regarding 
how the projectionmatrix is being set when resizing.

Thanks for your patience :)

Jesper D. Thomsen
AnyBody Technology A/S


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: 2. december 2010 16:05
To: OpenSceneGraph Users
Subject: Re: [osg-users] Window content stretching when resized after updating 
from 2.6.1 to 2.8.3

Hi Jasper,

I don't understand the details of what you are attempting to do, but the OSG 
directly supports resizing the projection matrix to keep the aspect ratio of 
the scene the same even when you resize the window.
There are also controls in osg::Camera for controlling this.  You shouldn't 
need to do anything special to handle window resize and projection matrix 
setting, instead you should be able to just set it at setup time and then not 
have to do anything there after.  To me it feels like you are trying to do 
something overly complicated and likely unnecessary.

Robert.

On Thu, Dec 2, 2010 at 2:35 PM, Jesper D. Thomsen j...@anybodytech.com wrote:
 Hi Robert, thank you very much for your answer. It led me to implement at 
 rather hacky (in my mind at least solution).

 Instead of :
 double r = (double)m_OSGView.aspect_ratio*t;

 I now use:

 double r = (double)m_OSGView.aspect_ratio*(double)m_OSGView.aspect_ratio*t / 
 mOSG-getOriginalAspect(); //where mOSG-getOriginalAspect() is the aspect 
 ratio from the creation time of the graphicscontext.

 This gives me exactly the same view as in my 2.6.1 version when resizing the 
 window, even though it feels very hacky.

 Thank you very much for your help.

 Jesper D. Thomsen
 AnyBody Technology A/S



 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
 Robert Osfield
 Sent: 2. december 2010 14:40
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Window content stretching when resized after 
 updating from 2.6.1 to 2.8.3

 Hi Jasper,

 There is chance that the issue comes from a fix to a bug rather than 
 introduction of a bug, with your original code working around the bug.
  Removing the workaround could well just fix things.  The reason why I 
 suggest that is that I recall merging fixes to the way the projection 
 matrices are updated, I don't recall the dates though, but I'm sure it's 
 since 2.6.x.

 Try just removing your code that attempts to update the projection matrix 
 when you the window is resized.

 Robert.

 On Thu, Dec 2, 2010 at 12:46 PM, Jesper D. Thomsen j...@anybodytech.com 
 wrote:
 Hi all, I had hoped I would figure this out myself, but no luck so far.



 I just upgraded my OSG usage from 2.6.1 to 2.8.3, and without 
 changing anything about how my windows are set up, I'm now getting a 
 behavior where the viewed contents of a window stays the same when 
 the window is rescaled, whereas in 2.6.1 I would have a constant 
 pixel-size for the contents of the window when resized. Please see 
 the attached images if I'm not making myself clear enough (please 
 note that the HUD-text is supposed to be stretched to the window size in 
 both versions).



 I'm using a release OSG 2.8.3, compiled on Visual Studio 2005 sp1, on 
 Vista
 64 (Nvidia Quadro graphics card).



 The camera and graphics context are created like this (done once):



 RECT rect;

 mViewer = new osgViewer::Viewer();

 mViewer-setThreadingModel(osgViewer::Viewer::SingleThreaded);

 ::GetWindowRect(m_hWnd, rect);

 osg::ref_ptrosg::GraphicsContext::Traits traits = new 
 osg::GraphicsContext::Traits;

 osg::ref_ptrosg::Referenced windata = new 
 osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

 traits-x = 0;

 traits-y = 0;

 traits-width = rect.right - rect.left;

 traits-height = rect.bottom - rect.top;

 traits-windowDecoration = false;

 traits-doubleBuffer = true;

 traits-sharedContext = 0;

 traits-setInheritedWindowPixelFormat = true;

 traits-supportsResize = true;

 traits-inheritedWindowData = windata;

 m_gc = osg::GraphicsContext::createGraphicsContext(traits.get());

 camera = mViewer-getCamera();

 camera-setGraphicsContext(m_gc.get());

 camera-setViewport(new osg::Viewport(traits-x, traits-y,
 camera-traits-width,
 traits-height));

 mViewer-addSlave(camera.get());



 And for each frame I'm drawing I'm setting the camera like this:



 mOSG-getViewer()-getCamera()-getGraphicsContext()-resized(x, y, 
 mOSG-w, h);

 mOSG-getViewer()-getCamera()-setViewport(x,y,w,h);

 double n = (double)m_OSGView.near_dist;

 double f = (double

Re: [osg-users] Application Verifier failure (on Windows) with getSampleOpenGLContext(...)

2010-09-23 Thread Jesper D. Thomsen
I did a further bit of testing, and it seems to be a driver-related problem.
On the single ATI machine (winXP) I have available osgviewer runs fine under 
application verifier. On my main development machine (Vista64, FX2700M) I am 
able to get osgviewerd.exe to pass Application Verifier if I drop the Nvidia 
driver down to 179.76 (Dell ISV certified), but any driver after that (tested 
with 186.03 and up) seems to give the error in AppVerifier. As far as I can 
tell, there's no way to use OSG without calling ::ChoosePixelFormat and 
::SetPixelFormat, which are the two specific calls in getSampleOpenGLContext 
which are failing. If anyone has tried running AppVerifier successfully with a 
later nvidia driver revision, I would really like to hear about it.

Regards,

Jesper D. Thomsen
AnyBody Technology A/S
Denmark

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. 
Thomsen
Sent: 21. september 2010 16:12
To: OpenSceneGraph Users (osg-users@lists.openscenegraph.org)
Subject: [osg-users] Application Verifier failure (on Windows) with 
getSampleOpenGLContext(...)

Hi all, I've just updated our OSG usage from 2.6.1 to 2.8.3 in the hopes of 
getting application verifier to accept our OSG usage. We previously had a 
problem with Application Verifier and OpenThreads in 2.6.1 but this has been 
fixed in 2.8.3, but we now experience a new problem.
Luckily it seems to happen with all OSG examples and not just our own 
application.

The setup:
I'm using Application Verifier (which we need our application to pass) on 
Windows Vista 64 SP2, Dell M6500 workstation with Quadro FX2700M graphics and 
driver revision 258.96. OSG has been built from source with Visual studio 2005 
SP1.
I'm testing osgviewerd.exe with Application Verifier default basic settings.

Observed problem:
Application Verifier breaks into the debugger during the call of 
CreateGraphicsContext() with last function call in OSG being
int pixelFormatIndex = ::ChoosePixelFormat(hdc, pixelFormat);
in osgViewer::Win32WindowingSystem::getSampleOpenGLContext().

All the OSG applications I have tested with Application Verifier breaks in 
ChoosePixelFormat, but I don't know if this could be an OSG problem, a hdc 
usage problem or an Nvidia driver problem.
I have also tried Application Verifier with osgviewerd.exe in OSG 2.9.8 with 
the same behavior.

The complete callstack for the breakpoint is:

 ntdll.dll!773a0004()
 [Frames below may be incorrect and/or missing, no 
symbols loaded for ntdll.dll]
ntdll.dll!77407c5c()
 
vfbasics.dll!AVrfpVectoredExceptionHandler(_EXCEPTION_POINTERS * 
ExceptionPointers=0x00dad994)  Line 460
ntdll.dll!773ea4df()
 ntdll.dll!773d4461()
 ntdll.dll!773d4505()
 ntdll.dll!773ae49f()
 nvoglv32.dll!69d786c1()
 nvoglv32.dll!69d786c1()
 ntdll.dll!773ba957()
 ntdll.dll!773baaad()
 ntdll.dll!774319fe()
 osgviewerd.exe!mainCRTStartup()  Line 414  
 C
ntdll.dll!7741c1da()
 ntdll.dll!7741c20b()
 ntdll.dll!7741c20b()
 ntdll.dll!7741c449()
 vfbasics.dll!AVrfLogInTracker(_AVRF_TRACKER * 
Tracker=0x, unsigned short EntryType=1, void * EntryParam1=0x04ba6d40, 
void * EntryParam2=0x0080, void * EntryParam3=0x04ba, void * 
EntryParam4=0x6935bd2e, void * ReturnAddress=0x69351556)  Line 300 + 0x10 bytes
vfbasics.dll!AVrfpRtlAllocateHeap(void * 
Heap=0x69351137, unsigned long Flags=1765138528, unsigned long Size=769)  Line 
256
00dadf98()
vfbasics.dll!AVrfpTlsGetValue(unsigned long 
dwTlsIndex=4294967295)  Line 426
nvoglv32.dll!69b2561d()
 nvoglv32.dll!69b2a5e0()
 nvoglv32.dll!69d42336()
 verifier.dll!6bd559c9()
 
vrfcore.dll!VfCoreStandardDllEntryPointRoutine(void * DllHandle=0x6950, 
unsigned long Reason=1, _CONTEXT * Context=0x)  Line 558 + 0xc bytes
vfbasics.dll!AVrfpStandardDllEntryPointRoutine(void 
* DllHandle=0x6950, unsigned long Reason=1, _CONTEXT * Context=0x)  
Line 787 + 0xa bytes
ntdll.dll!773d919c()
 ntdll.dll!773c48e7()
 ntdll.dll!773ef7eb()
 ntdll.dll!773c446d()
 ntdll.dll!773c3f00

[osg-users] Application Verifier failure (on Windows) with getSampleOpenGLContext(...)

2010-09-21 Thread Jesper D. Thomsen
.dll!7563410f()
 vfbasics.dll!AVrfpLdrLoadDll(const wchar_t * 
DllPath=0x00195400, unsigned long * DllCharacteristics=0x00dae790, const 
_UNICODE_STRING * DllName=0x00dae750, void * * DllHandle=0x00dae764)  Line 1327 
+ 0xa bytes
kernel32.dll!756342f0()
 kernel32.dll!7563436a()
 opengl32.dll!67d1c135()
 opengl32.dll!67d1c3fe()
 osg65-osgViewerd.dll!osgViewer::WindowProc(HWND__ 
* hwnd=0x0080, unsigned int uMsg=1310720, unsigned int wParam=0, long 
lParam=14347132)  Line 507 + 0xb bytes  C++
ntdll.dll!774319fe()
 ntdll.dll!773ba957()
 ntdll.dll!773baaad()
 ntdll.dll!7741c20b()
 ntdll.dll!774319fe()
 ntdll.dll!7740d45f()
 ntdll.dll!7741c1da()
 ntdll.dll!773ba957()
 ntdll.dll!773baaad()
 ntdll.dll!773bef42()
 ntdll.dll!773e7d41()
 ntdll.dll!7740d45f()
 ntdll.dll!7741c1da()
 ntdll.dll!773baeca()
 ntdll.dll!7741c20b()
 opengl32.dll!67d1c4ad()
 opengl32.dll!67d1da23()
 opengl32.dll!67d2786f()
 opengl32.dll!67d28010()
 vfbasics.dll!AVrfpRtlFreeHeap(void * 
Heap=0x67d28782, unsigned long Flags=1972322748, void * Address=0x00daed2c)  
Line 355 + 0x5 bytes
vrfcore.dll!VfCoreLdrGetProcedureAddress(void * 
DllHandle=0x00010028, const _STRING * ProcedureName=0x0024, unsigned long 
ProcedureNumber=6144, void * * ProcedureAddress=0x)  Line 846
kernel32.dll!75632138()
 gdi32.dll!758f41a4()
  
 osg65-osgViewerd.dll!osgViewer::Win32WindowingSystem::getSampleOpenGLContext(osgViewer::Win32WindowingSystem::OpenGLContext
   context={...}, HDC__ * windowHDC=0x29011371, int windowOriginX=0, int 
 windowOriginY=0)  Line 733 + 0x10 bytes C++

osg65-osgViewerd.dll!osgViewer::GraphicsWindowWin32::setPixelFormat()  Line 
1523 + 0x42 bytes  C++

osg65-osgViewerd.dll!osgViewer::GraphicsWindowWin32::createWindow()  Line 1169 
+ 0x8 bytes C++

osg65-osgViewerd.dll!osgViewer::GraphicsWindowWin32::init()  Line 1079 + 0x16 
bytes   C++

osg65-osgViewerd.dll!osgViewer::GraphicsWindowWin32::GraphicsWindowWin32(osg::GraphicsContext::Traits
 * traits=0x0332c9b8)  Line 1042C++

osg65-osgViewerd.dll!osgViewer::Win32WindowingSystem::createGraphicsContext(osg::GraphicsContext::Traits
 * traits=0x0332c9b8)  Line 976 + 0x29 bytesC++

osg65-osgd.dll!osg::GraphicsContext::createGraphicsContext(osg::GraphicsContext::Traits
 * traits=0x0332c9b8)  Line 75 + 0x1e bytes  C++

osg65-osgViewerd.dll!osgViewer::View::setUpViewAcrossAllScreens()  Line 460 + 
0x14 bytes   C++
osg65-osgViewerd.dll!osgViewer::Viewer::realize()  
Line 425   C++
osgviewerd.exe!main(int argc=2, char * * 
argv=0x0244aab0)  Line 154 + 0xe bytes  C++
osgviewerd.exe!__tmainCRTStartup()  Line 597 + 0x19 
bytes   C
osgviewerd.exe!mainCRTStartup()  Line 414   
C
kernel32.dll!756aeccb()
 ntdll.dll!7740d24d()
 ntdll.dll!7740d45f()


If anyone has any ideas as to how this problem can be fixed or worked around, 
it will be much appreciated.

Regards, and thanks in advance.

Jesper D. Thomsen
AnyBody Technology A/S
Denmark
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Integrating OSG with an existing OpenGL solution.

2010-08-18 Thread Jesper D. Thomsen
Hi all, and thanks for your support so far.

We are using OpenSceneGraph for creating model views for a muscular-skeletal 
simulation software package, which has worked really well so far.
We have had a number of inquiries if it would be possible to make this 
modelview available to other external applications. In particular CAD and VR 
systems. These systems may or may not be using OpenSceneGraph, and we are 
wondering if it would be possible to offer integration of our OSG context into 
an OpenGL system in some way. The most basic idea would be to just export our 
OSG model tree to them, and thus force them to use OpenSceneGraph in their 
systems, but for a number of CAD systems that would not be feasible. We also 
thought of having our API being able to accept a handle to an OpenGL context 
and using it for drawing the OSG content in. This would of course not offer 
integration of our OSG-based modelview and their existing OpenGL content in the 
same graphic window, but I don't know if that easily possible in any way at all.

We are currently just discussing what would be possible, so if anyone has any 
ideas as to what can be done to offer this kind of integration, we would 
appreciate any thoughts about it.

Regards, and thanks in advance

Jesper D. Thomsen
AnyBody Technology A/S
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Showing and hiding objects by removing/adding drawables.

2010-04-08 Thread Jesper D. Thomsen
Hi again, thank you very much for your insight.

I have now tried using nodemasks to hide inactive objects by applying nodemasks 
to their transforms. However, my primary problem remains. I see a massive 
speedup in general drawing speed, but the picker still finds geodes in empty 
spots on the screen (always close to actual objects), and when it finds such a 
geode it causes the multi-second pause. In my previous version this also 
happened when there were empty branches of the OSG graph with no drawables 
attached to the geodes, but it didn't happen when everything was visible (even 
though this meant that the number of objects on screen was a magnitude larger). 
In my current version, I have the same OSGgraph as in my previous version with 
all objects visible, but now with nodemasks applied to cut off invisible 
branches. Could it be possible that I need to call dirtybound() or something 
like that on the nodes with nodemasks applied to get correct picking?
Is there reason to believe that using switch-nodes would yield better results?

Thank you in advance.

Jesper D. Thomsen

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: 8. april 2010 11:57
To: OpenSceneGraph Users
Subject: Re: [osg-users] Showing and hiding objects by removing/adding 
drawables.

Hi Jesper,

Adding/removing node/drawables/stateset from the scene graph is not
something I would recommend users do for toggling the visibility of
items.  The best way is to decorate the subraphs with an osg::Switch
node, or use the osg::Node::set/getNodeMask(uint) setting it to 0x0
and 0x to switch a subgraph off/on.   An advantage of
NodeMasks is that can also be used in conjunction with the traversal
masks, so you could just toggle whether whole groups of
geometry/labels get visualized just by switching on different parts of
traversal mask on the cull visitor.

Robert.

On Thu, Apr 8, 2010 at 10:39 AM, Jesper D. Thomsen j...@anybodytech.com wrote:
 Hi all,



 I'm using OpenSceneGraph to show an interactive modelview for a
 muscular-skeletal modeling application. In this view there are a number of
 graphical objects which should only be viewed some of the time. I have
 attached a screenshot with all such objects of a single category turned on
 (the green lines with text attached), but normally only a few would be shown
 at a time. I'm currently creating the entire OSG graph for the modelview
 window at load, and turn these components on/off by removing and adding
 their drawables to the Geodes. Each geode maximally has a few (about 0-5)
 drawables, and I have several thousand geodes in total in the OSG graph. So
 far, this method of doing show/hide has worked fine, but I'm now doing
 picking using both LineSegmentIntersector and PolyTopeIntersector with each
 mouse-click in the window (to handle draggable objects), and I'm getting
 some pauses when I have a lot of objects hidden (that is, their geodes have
 no drawables attached). The pauses happen during the call to accept(picker),
 and are 1-5 seconds on a current machine. If I make everything visible (all
 geodes have drawables), no pauses occur during picking. My question is if it
 discouraged to have lots of geodes with no drawables in them, and would it
 be better to also remove the geodes/transforms from their osggroups in the
 graph?



 I also notice that I'm getting picking hits on visually empty space near the
 model from geodes with no drawables attached. I had the impression that the
 picker would only give me hits if I clicked a drawable of some sort. Can
 this be caused by having removed drawables from geodes, which somehow cache
 some kind of hit-box?



 On to another matter: In the OSG graph I have a large number (hundreds) of
 osgtext objects with identical text textures, but with different positions
 (as seen in the attached screenshot). As it is relatively slow to generate
 all these identical textures, I would like to reuse the texture for the
 osgtext's, but I can't find an example of how to do this. Or can I just have
 a single osgtext attached to multiple transforms, and thus do the instancing
 that way?



 I'm using OSG 2.6.1 and Visual Studio 2005 sp1 on Windows XP/Vista/7
 computers.



 If I have been unclear on anything, please ask me to elaborate.



 Regards, and thanks in advance for any advice.



 Jesper D. Thomsen

 AnyBody Technology A/S



 ___
 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

[osg-users] Rendering to PBO from a command line OSG program.

2009-06-22 Thread Jesper D. Thomsen
Hi all (and thank you for your help in the past).

I work on an application were I'm using OSG to display viewports of a model. I 
have a function of my application where I use PBO's to take high-res 
screenshots of the displayed model. However, I now also need to be able to take 
screenshots from a script-defined camera (a camera in my application, not an 
OSG-camera) without having a viewport of the model open. That is, I need to be 
able to render to texture (In my case PBO) even if I'm not using OSG to drive a 
viewport. But, how do I make an osg viewer without a handle to a window which 
it should use to display the model? I would also like to use this to enable 
offscreen rendering in a console application, where I need to output images of 
a running analysis, which only uses the command line (on a Windows system).

I have looked at the osgprerender and other examples, but they all create a 
viewer with some window rendering context.

Any hints and help would be much appreciated.

Regards,

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


Re: [osg-users] Rendering to PBO from a command line OSG program.

2009-06-22 Thread Jesper D. Thomsen
Thank you very much, I must have missed that one (somehow) when looking through 
the examples. From you description, this sounds to be exactly what I'm looking 
for.
I will take a look at that example, and hopefully it'll be easy to translate to 
my specific needs.

Regards, and thanks.

Jesper D. Thomsen

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: 22. juni 2009 14:06
To: OpenSceneGraph Users
Subject: Re: [osg-users] Rendering to PBO from a command line OSG program.

Hi Jesper,

You can't do OpenGL rendering without a graphics context, that
graphics context has to be supplied by either a window or a pbuffer.
In your case you'll be wanting to use a pbuffer.  The osgscreencapture
uses a pbuffer to enable the capture a screen shot without a window
appearing.

Robert.

On Mon, Jun 22, 2009 at 12:07 PM, Jesper D. Thomsenj...@anybodytech.com wrote:
 Hi all (and thank you for your help in the past).



 I work on an application were I'm using OSG to display viewports of a model.
 I have a function of my application where I use PBO's to take high-res
 screenshots of the displayed model. However, I now also need to be able to
 take screenshots from a script-defined camera (a camera in my application,
 not an OSG-camera) without having a viewport of the model open. That is, I
 need to be able to render to texture (In my case PBO) even if I'm not using
 OSG to drive a viewport. But, how do I make an osg viewer without a handle
 to a window which it should use to display the model? I would also like to
 use this to enable offscreen rendering in a console application, where I
 need to output images of a running analysis, which only uses the command
 line (on a Windows system).



 I have looked at the osgprerender and other examples, but they all create a
 viewer with some window rendering context.



 Any hints and help would be much appreciated.



 Regards,



 Jesper D. Thomsen

 ___
 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


[osg-users] Using a slave camera to take screenshots in a different resolution than the main camera.

2009-05-27 Thread Jesper D. Thomsen
Hi all, I'm trying to use a slave camera to take screenshots in a different 
resolution than the main camera. I have tried setting the slave cameras 
renderingimplementation to Frame_buffer_object and pixel_buffer_rtt and have 
made a graphics context with the desired resolution, but I'm always just 
getting a screenshot where I have the desired content in the original camera's 
resolution in the lower left corner and black pixels in the rest of the 
screenshots area. I've tried changing the background color of the slave cameras 
graphics context, and this works fine with only the screenshot being affected 
and the windows rendered by the main camera looking as normal, so I'm guessing 
that it's using the FBO for the slave camera. I'm guessing that I have 
forgotten some kind of statement regarding the slave camera's graphics context.

regards, and thanks in advance.

Jesper D. Thomsen

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


Re: [osg-users] Using a slave camera to take screenshots in a different resolution than the main camera.

2009-05-27 Thread Jesper D. Thomsen
I just tried changing the main camere to a slave camera (as supposedly a 
main+slave cam combination is bad somehow). This changed the behaviour such 
that the screenshot slave camere can now take screenshots in any resolution for 
the first screenshot, but subsequent screenshots have the same rendered area as 
the first screenshot, which either results in black area (when the second 
screenshot has higher resolution) or a cropped screenshot (when the new 
screenshot is in lower resolution). I'm assigning a fresh graphics context to 
the slave camera before each screenshot, but it seems to ignore the resolution 
in the subsequent graphics contexts.
I'm pretty sure it's something really simple I'm forgetting to do.

Regards,

Jesper D. Thomsen



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen 
[...@anybodytech.com]
Sent: Wednesday, May 27, 2009 1:18 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Using a slave camera to take screenshots in a different 
resolution than the main camera.

Hi all, I'm trying to use a slave camera to take screenshots in a different 
resolution than the main camera. I have tried setting the slave cameras 
renderingimplementation to Frame_buffer_object and pixel_buffer_rtt and have 
made a graphics context with the desired resolution, but I'm always just 
getting a screenshot where I have the desired content in the original camera's 
resolution in the lower left corner and black pixels in the rest of the 
screenshots area. I've tried changing the background color of the slave cameras 
graphics context, and this works fine with only the screenshot being affected 
and the windows rendered by the main camera looking as normal, so I'm guessing 
that it's using the FBO for the slave camera. I'm guessing that I have 
forgotten some kind of statement regarding the slave camera's graphics context.

regards, and thanks in advance.

Jesper D. Thomsen

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


Re: [osg-users] Using a slave camera to take screenshots in a different resolution than the main camera.

2009-05-27 Thread Jesper D. Thomsen
Another update:

Well, I kind of found a solution, but it's really ugly.
If I remove the slave camera from the viewer, then set the new graphics 
context, and then add the slave cam to the viewer again, it works with a new 
resolution for each screenshot.
This seems very un-elegant though, and I'm pretty sure that this is a misuse of 
OSG in comparison to what was intended.

Jesper D. Thomsen



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen 
[...@anybodytech.com]
Sent: Wednesday, May 27, 2009 2:42 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Using a slave camera to take screenshots in a 
different resolution than the main camera.

I just tried changing the main camere to a slave camera (as supposedly a 
main+slave cam combination is bad somehow). This changed the behaviour such 
that the screenshot slave camere can now take screenshots in any resolution for 
the first screenshot, but subsequent screenshots have the same rendered area as 
the first screenshot, which either results in black area (when the second 
screenshot has higher resolution) or a cropped screenshot (when the new 
screenshot is in lower resolution). I'm assigning a fresh graphics context to 
the slave camera before each screenshot, but it seems to ignore the resolution 
in the subsequent graphics contexts.
I'm pretty sure it's something really simple I'm forgetting to do.

Regards,

Jesper D. Thomsen



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen 
[...@anybodytech.com]
Sent: Wednesday, May 27, 2009 1:18 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Using a slave camera to take screenshots in a different 
resolution than the main camera.

Hi all, I'm trying to use a slave camera to take screenshots in a different 
resolution than the main camera. I have tried setting the slave cameras 
renderingimplementation to Frame_buffer_object and pixel_buffer_rtt and have 
made a graphics context with the desired resolution, but I'm always just 
getting a screenshot where I have the desired content in the original camera's 
resolution in the lower left corner and black pixels in the rest of the 
screenshots area. I've tried changing the background color of the slave cameras 
graphics context, and this works fine with only the screenshot being affected 
and the windows rendered by the main camera looking as normal, so I'm guessing 
that it's using the FBO for the slave camera. I'm guessing that I have 
forgotten some kind of statement regarding the slave camera's graphics context.

regards, and thanks in advance.

Jesper D. Thomsen

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


Re: [osg-users] Problems with FBOs when taking high resolution screenshots.

2009-05-15 Thread Jesper D. Thomsen
Hi again, I'm now doing a check for the maximum texture size and clamping the 
screenshot size to be no greater than that. I have now found a new problem in 
that I can't always take a screenshot at the maximum resolution. This seems to 
be dependent on the complexity of the loaded scene graph, so I'm guessing at a 
video memory error. The behavior is that for a given (high, as in 8192x6000) 
resolution I get the correct image with a simple model, but I'm getting a black 
image when taking a screenshot of a complex model.

I have a vague recollection that I saw something about being able to check if 
the FBO is correctly allocated and ready before using it, but after quite a bit 
of searching I haven't been able to find it again.

If anyone knows if this is easily checkable I would much appreciate a pointer 
in the right direction.

Regards, and thank.

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jean-Sébastien Guay 
[jean-sebastien.g...@cm-labs.com]
Sent: Thursday, May 14, 2009 4:27 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Problems with FBOs whentaking  high
resolution  screenshots.

Hello Jesper,

 Thank you very much, I suspected it was something like that. Do you know if 
 there another standard way of making high resolution renderings via OSG that 
 isn't hit by the graphics card texture size limitations?

You can do tiling - take multiple screenshots, each using the maximum
size the video card supports, using appropriate camera positions that,
once assembled together into one image, will give you the complete
image. Using slave cameras in an osgViewer::View can help with this, and
you can have a look at osgViewer::View::setUpViewAcrossAllScreens() for
inspiration on how to set up those slave cameras.

 Otherwise I'll just have to implement the checking mechanism you gave me and 
 limit the maximum size for the less capable graphics cards.

That could be a good first step.

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
 http://whitestar02.webhop.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] Problems with FBOs when taking high resolution screenshots.

2009-05-14 Thread Jesper D. Thomsen
Thank you very much, I suspected it was something like that. Do you know if 
there another standard way of making high resolution renderings via OSG that 
isn't hit by the graphics card texture size limitations?
Otherwise I'll just have to implement the checking mechanism you gave me and 
limit the maximum size for the less capable graphics cards.

Thanks,

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jean-Sébastien Guay 
[jean-sebastien.g...@cm-labs.com]
Sent: Wednesday, May 13, 2009 4:16 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Problems with FBOs when taking highresolution  
screenshots.

Hi Jesper,

  In both cases this occors when the screenshot
 is larger than 2048x2048 pixels. The lower-left 2048x2048 pixels of the
 screenshot are always correct, but the rest is black.

I'd guess you're hitting a texture or FBO size limitation in the
graphics cards your clients are running on. NVidia generally supports up
to 4096x4096 (newer cards even go to 8192x8192 or more) but other
manufacturers place different constraints.

I think you can quert GL_MAX_TEXTURE_SIZE or something like that to get
the maximum size supported by the current driver (make sure you have an
OpenGL context current when you try to query). Then you could limit your
app to taking screenshots of that size. If the driver reports it
correctly and doesn't lie, it would avoid the partially black screenshots.

As a first step you could make a small app that checks that value to see
if that's really the problem.

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
 http://whitestar02.webhop.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] Problems with FBOs when taking high resolution screenshots.

2009-05-14 Thread Jesper D. Thomsen
Hi, and thank you.
That would be a possibility for sure, but I was hoping to avoid having to do 
that. But if all else fails, I think that will have to be the solution (or just 
demand that the users get a decent graphics card).

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich Hertlein 
[u.hertl...@sandbox.de]
Sent: Thursday, May 14, 2009 10:23 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Problems with FBOs whentaking  high
resolution  screenshots.

Hi Jesper,

On 14/5/09 10:16 AM, Jesper D. Thomsen wrote:
 Thank you very much, I suspected it was something like that. Do you know if 
 there
 another standard way of making high resolution renderings via OSG that isn't 
 hit by the
 graphics card texture size limitations? Otherwise I'll just have to implement 
 the
 checking mechanism you gave me and limit the maximum size for the less 
 capable graphics
 cards.

How about rendering multiple tiles with asymmetric frusta and stitch them 
together?  That
way the resolution is practically unlimited.

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


[osg-users] Problems with FBOs when taking high resolution screenshots.

2009-05-13 Thread Jesper D. Thomsen
Hi all, I'm using OSG (2.6.1 compiled for windows XP/Vista by Visual Studio 
2005) to create a viewport in an MFC application. I have a function where I 
take a high resolution screenshot by doing RTT rendering to an FBO. I've now 
begun receiving bug reports from some users (so far, all ATI graphics card 
users) that the screenshots come out mostly black. This happens either all the 
time or after the first screenshot, which led me to guess that some kind of FBO 
resource is not getting released properly. On an older machine the screenshots 
always come out somewhat black. In both cases this occors when the screenshot 
is larger than 2048x2048 pixels. The lower-left 2048x2048 pixels of the 
screenshot are always correct, but the rest is black. I've tried using 
Pixel_buffer also, but with the exact same result on my old testmachine. On my 
own machine (Vista 64 - NV Quadro FX 2700M) the screenshots work fine at all 
tested resolutions.

Does anybody know if this is just a hard limitation in the drivers/graphics 
cards, or am I just forgetting something in my code (Code posted below).

Regards, and thanks in advance (again).

Jesper D. Thomsen

 Code: -


bool CModelView::CreateOSGImageSnap(int p_width, int p_height, double p_left, 
double p_right,

   double p_bottom, double p_top, double p_near, double p_far,

   double p_eye_pivot_0, double p_eye_pivot_1, double p_eye_pivot_2,

   double p_eye_eulerpar_0, double p_eye_eulerpar_1, double p_eye_eulerpar_2,

   double p_eye_eulerpar_3, double p_eye_dist, bool p_ortho, osg::Image* 
p_image){

osg::ref_ptrosg::Camera t_camera = new osg::Camera;

osg::ref_ptrosg::Group t_parent = new osg::Group;

unsigned int t_samples = 0;

unsigned int t_colorSamples = 0;

t_camera-setViewport(0,0,p_width,p_height);

if(p_ortho){

t_camera-setProjectionMatrixAsOrtho(p_left,p_right,p_bottom,p_top,p_near,p_far);

}else{

t_camera-setProjectionMatrixAsFrustum(p_left,p_right,p_bottom,p_top,p_near,p_far);

}

osg::Matrixd t_matrix = 
osg::Matrixd::translate(-(osg::Vec3d(p_eye_pivot_0,p_eye_pivot_1,p_eye_pivot_2)))*

osg::Matrixd::rotate((osg::Quat(p_eye_eulerpar_1,p_eye_eulerpar_2,p_eye_eulerpar_3,p_eye_eulerpar_0)).inverse())*

osg::Matrixd::translate(0.0,0.0,-p_eye_dist);

t_camera-setViewMatrix(t_matrix);

t_camera-setRenderOrder(osg::Camera::PRE_RENDER);

t_camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);

t_camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

t_camera-setClearColor( 
osg::Vec4(GetBackgroundColor()[0],GetBackgroundColor()[1],GetBackgroundColor()[2],1.0)
 );

p_image-allocateImage(p_width, p_height, 1, GL_RGB, GL_UNSIGNED_BYTE);

t_camera-attach(osg::Camera::COLOR_BUFFER, p_image, t_samples, t_colorSamples);

t_camera-setPostDrawCallback(new MyCameraPostDrawCallback(p_image));

osg::Node* t_oldroot = mOSG-getASG()-getOSGRoot();

t_camera-addChild(mOSG-getASG()-getOSGRoot());

t_parent-addChild(t_camera.get());

mOSG-getViewer()-setSceneData(t_parent.get());

mOSG-getViewer()-frame();

mOSG-getViewer()-setSceneData(t_oldroot);

mOSG-getViewer()-frame();

return true; //Fixme: This should be changed to a bool describing whether the 
snapshot was successful.

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


[osg-users] OpenSceneGraph always opening in fullscreen on Intel integrated graphics.

2009-04-27 Thread Jesper D. Thomsen
Hi all (again), and thanks for your help in the past.

We have now shipped an application using OpenSceneGraph for the 3D viewports of 
a model. We are now receiving a couple of bug-reports (2 so far) from users 
running the application on laptops with Intel integrated graphics (GMA 950 and 
3100). We are using OpenSceneGraph in an MFC window in the application, but 
whenever these two users open the viewport window (and thus starting the 
OpenSceneGraph part of the application), the OpenSceneGraph viewer starts in 
fullscreen (no menus or windows bar visible), which of course means that they 
have to use the task manager to quit the application.

Both users are using Windows XP pro. The OSG version used is 2.6.1, compiled 
with Visual Studio 2005 SP1 under Vista. The application is using MFC, and the 
OpenSceneGraph viewport is based on the MFCViewer example. The code for 
creating the viewer can be found below. Does anybody know why OSG suddenly will 
be forced to work in fullscreen, and is it generally because of some specific 
lack of OpenGL support?

Any help will be much appreciated.

--- Code: --

void cOSG::InitCameraConfig(void)

{

// Local Variable to hold window size data

RECT rect;

// Create the viewer for this window

mViewer = new osgViewer::Viewer();

mViewer-setThreadingModel(osgViewer::Viewer::SingleThreaded);

// Get the current window size

::GetWindowRect(m_hWnd, rect);

// Init the GraphicsContext Traits

osg::ref_ptrosg::GraphicsContext::Traits traits = new 
osg::GraphicsContext::Traits;

// Init the Windata Variable that holds the handle for the Window to display 
OSG in.

osg::ref_ptrosg::Referenced windata = new 
osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

// Setup the traits parameters

traits-x = 0;

traits-y = 0;

traits-width = rect.right - rect.left;

traits-height = rect.bottom - rect.top;

traits-windowDecoration = false;

traits-doubleBuffer = true;

traits-sharedContext = 0;

traits-setInheritedWindowPixelFormat = true;

traits-inheritedWindowData = windata;

// Create the Graphics Context

osg::GraphicsContext* gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());

// Init a new Camera (Master for this View)

camera = mViewer-getCamera();

// Assign Graphics Context to the Camera

camera-setGraphicsContext(gc);

// Set the viewport for the Camera

camera-setViewport(new osg::Viewport(traits-x, traits-y, traits-width, 
traits-height));

// Add the Camera to the Viewer

mViewer-setCamera(camera.get());

// Add the Camera Manipulator to the Viewer

//-Picking Test--

mViewer-addEventHandler(m_PickHandler.get());

//---

// Set the Scene Data

mViewer-setSceneData(mRoot.get());

mViewer-getCamera()-setProjectionResizePolicy(osg::Camera::FIXED);

}

--- end code --

Regards,

Jesper D. Thomsen

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


Re: [osg-users] OpenSceneGraph always opening in fullscreen on Intel integrated graphics.

2009-04-27 Thread Jesper D. Thomsen
Hi, I'm not currently using multisampling in the window, as we have an option 
in the application where we can switch to an older OpenGL renderer for the 
viewport, and this older implementation doesn't like multisampling. I'm however 
not having any problems with OpenGL state, as I don't use any direct OpenGL in 
the cases where I'm having the fullscreen problem.
I just dug up an old computer with integrated Intel 82865G graphics (which 
supports OpenGL 1.3), and that computer works fine with windowed OpenSceneGraph 
use (even with standard Windows XP graphics drivers).

regards,

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ümit Uzun 
[umituzu...@gmail.com]
Sent: Monday, April 27, 2009 11:14 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OpenSceneGraph always opening in fullscreen on Intel 
integrated graphics.


Hi Jesper;

As I can see from attached codes you didn't used traits-samples = (any int 
value); but you may be set multisampling in your code from using

osg::DisplaySettings* ds = new osg::DisplaySettings();
ds-setNumMultiSamples( 4 );

or osgUtil namespaces function(I have forgotten the name of this function.).

If you try to anti aliasing operation by using MultiSampling, this could be 
cause full screen problem which I had had kind of that before and solved by 
removing multisampling operation.

HTH.Regards.

2009/4/27 Jesper D. Thomsen j...@anybodytech.commailto:j...@anybodytech.com
Hi all (again), and thanks for your help in the past.

We have now shipped an application using OpenSceneGraph for the 3D viewports of 
a model. We are now receiving a couple of bug-reports (2 so far) from users 
running the application on laptops with Intel integrated graphics (GMA 950 and 
3100). We are using OpenSceneGraph in an MFC window in the application, but 
whenever these two users open the viewport window (and thus starting the 
OpenSceneGraph part of the application), the OpenSceneGraph viewer starts in 
fullscreen (no menus or windows bar visible), which of course means that they 
have to use the task manager to quit the application.

Both users are using Windows XP pro. The OSG version used is 2.6.1, compiled 
with Visual Studio 2005 SP1 under Vista. The application is using MFC, and the 
OpenSceneGraph viewport is based on the MFCViewer example. The code for 
creating the viewer can be found below. Does anybody know why OSG suddenly will 
be forced to work in fullscreen, and is it generally because of some specific 
lack of OpenGL support?

Any help will be much appreciated.

--- Code: --

void

cOSG::InitCameraConfig(void)

{

// Local Variable to hold window size data

RECT rect;

// Create the viewer for this window

mViewer =

new osgViewer::Viewer();

mViewer-setThreadingModel(osgViewer::Viewer::SingleThreaded);

// Get the current window size

::GetWindowRect(m_hWnd, rect);

// Init the GraphicsContext Traits

osg::ref_ptrosg::GraphicsContext::Traits traits =

new osg::GraphicsContext::Traits;

// Init the Windata Variable that holds the handle for the Window to display 
OSG in.

osg::ref_ptrosg::Referenced windata =

new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

// Setup the traits parameters

traits-x = 0;

traits-y = 0;

traits-width = rect.right - rect.left;

traits-height = rect.bottom - rect.top;

traits-windowDecoration =

false;

traits-doubleBuffer =

true;

traits-sharedContext = 0;

traits-setInheritedWindowPixelFormat =

true;

traits-inheritedWindowData = windata;

// Create the Graphics Context

osg::GraphicsContext* gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());

// Init a new Camera (Master for this View)

camera = mViewer-getCamera();

// Assign Graphics Context to the Camera

camera-setGraphicsContext(gc);

// Set the viewport for the Camera

camera-setViewport(

new osg::Viewport(traits-x, traits-y, traits-width, traits-height));

// Add the Camera to the Viewer

mViewer-setCamera(camera.get());

// Add the Camera Manipulator to the Viewer

//-Picking Test--

mViewer-addEventHandler(m_PickHandler.get());

//---

// Set the Scene Data

mViewer-setSceneData(mRoot.get());

mViewer-getCamera()-setProjectionResizePolicy(osg::Camera::FIXED);

}

--- end code --

Regards,


Jesper D. Thomsen



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




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


[osg-users] OpenScenegraph MFC application freezes in Vista when cpu is maxed out.

2009-04-20 Thread Jesper D. Thomsen
Hi all, I have a somewhat irritating error in Vista (and to a lesser degree 
Windows XP).

I'm using OSG 2.6.1 to render a viewport in an MFC application (built in Visual 
Studio 2005 SP1). I'm running in single-threaded mode (although I have tried 
multithreaded also without any luck). I'm manually calling frame when I want 
the viewport to be updated rather than using run(), as I don't want to waste 
cpu/gpu on redrawing a stationary viewport. My problem is that when I have a 
somewhat complex model loaded, the cpu-load on the single core sometimes spikes 
out at maximum load when doing updates fast (such as during a fast drag). When 
this happens the machine often freezes the OSG viewport (and the cpu load 
continues at maximum for a single core). In Vista I have to terminate the 
application, but in Windows XP I can change focus to another application window 
and the viewport returns to normal (0% cpu load) when I switch back to my 
application.

I'm all out of ideas as to exactly why this happens, as I don't completely 
understand if I'm allowed to call frame() rapidly or not. I'm looking for a 
function which can tell me if the previous frame() has completed, in order to 
not call a new frame() before the previous is done. I don't believe this should 
be necessary, but I have obviously done something to offend OSG :)
Any ideas or insights will be much appreciated.

regards, and thanks in advance.

Jesper D. Thomsen

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


Re: [osg-users] OpenScenegraph MFC application freezes in Vista when cpu is maxed out.

2009-04-20 Thread Jesper D. Thomsen
Hi, and thank you for answering.

I'm currently doing that by calling frame() within my OnDraw() handler, but I'm 
suspecting (without any proof) that it gets called too often somehow, and that 
there's some queuing within OSG that I'm not using properly. When calling a 
pure OpenGL rendering pipeline from OnDraw() (the old viewport renderer which 
OSG is replacing) I do not have the problem.

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Can T. Oguz 
[cto...@gmail.com]
Sent: Monday, April 20, 2009 12:41 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OpenScenegraph MFC application freezes in Vista when 
cpu is maxed out.


Hi,

You may want to try posting frame requests as windows messages (via 
PostMessage()). Call frame() within the handler.

Regards,

Can


2009/4/20 Jesper D. Thomsen j...@anybodytech.commailto:j...@anybodytech.com
Hi all, I have a somewhat irritating error in Vista (and to a lesser degree 
Windows XP).

I'm using OSG 2.6.1 to render a viewport in an MFC application (built in Visual 
Studio 2005 SP1). I'm running in single-threaded mode (although I have tried 
multithreaded also without any luck). I'm manually calling frame when I want 
the viewport to be updated rather than using run(), as I don't want to waste 
cpu/gpu on redrawing a stationary viewport. My problem is that when I have a 
somewhat complex model loaded, the cpu-load on the single core sometimes spikes 
out at maximum load when doing updates fast (such as during a fast drag). When 
this happens the machine often freezes the OSG viewport (and the cpu load 
continues at maximum for a single core). In Vista I have to terminate the 
application, but in Windows XP I can change focus to another application window 
and the viewport returns to normal (0% cpu load) when I switch back to my 
application.

I'm all out of ideas as to exactly why this happens, as I don't completely 
understand if I'm allowed to call frame() rapidly or not. I'm looking for a 
function which can tell me if the previous frame() has completed, in order to 
not call a new frame() before the previous is done. I don't believe this should 
be necessary, but I have obviously done something to offend OSG :)
Any ideas or insights will be much appreciated.

regards, and thanks in advance.


Jesper D. Thomsen



___
osg-users mailing list
osg-users@lists.openscenegraph.orgmailto: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] Openscenegraph Image to Windows HBITMAP

2009-04-03 Thread Jesper D. Thomsen
Thank you, I can certainly rewrite the rest of the pipeline to work with 
osg::Image, but I just needed to check if there was some easy method that I 
hadn't found yet myself.

regards,

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason Daly 
[jd...@ist.ucf.edu]
Sent: Thursday, April 02, 2009 8:21 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Openscenegraph Image to Windows HBITMAP


I believe an HBITMAP is more than just an array of pixels.  It's more like a 
drawing context (HDC).  I think no matter what you do, you'll have to create 
your HBITMAP from scratch and copy data to it.

Do you really need an HBITMAP for what you're doing?

--J


Glenn Waldron wrote:
Not sure, but the code in the bmp plugin might help.


Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791


2009/4/2 Jesper D. Thomsen j...@anybodytech.commailto:j...@anybodytech.com
Hi all, (and thank you for you help on previous occasions).

I'm writing (in Visual studio 2005sp1) the Openscenegraph (2.6.1) part of an 
application for Windows (XP/Vista). I need to be able to record and take 
screenshots of my Openscenegraph viewports and also from non-viewport cameras. 
I'm going to do this with RTT cameras, and I'm implementing this now.
However, I'm going to get my screenshots in the form of osg::Image and I need 
to convert them to HBITMAPs in order to use them further in the conversion 
chain of the application.
Is there an easier method than reading the osg::image pixel for pixel and 
writing this to the HBITMAP?

regards, and thanks in advance.


Jesper D. Thomsen



___
osg-users mailing list
osg-users@lists.openscenegraph.orgmailto: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] Openscenegraph Image to Windows HBITMAP

2009-04-02 Thread Jesper D. Thomsen
Hi all, (and thank you for you help on previous occasions).

I'm writing (in Visual studio 2005sp1) the Openscenegraph (2.6.1) part of an 
application for Windows (XP/Vista). I need to be able to record and take 
screenshots of my Openscenegraph viewports and also from non-viewport cameras. 
I'm going to do this with RTT cameras, and I'm implementing this now.
However, I'm going to get my screenshots in the form of osg::Image and I need 
to convert them to HBITMAPs in order to use them further in the conversion 
chain of the application.
Is there an easier method than reading the osg::image pixel for pixel and 
writing this to the HBITMAP?

regards, and thanks in advance.

Jesper D. Thomsen

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


[osg-users] Most efficient way to use osg::DrawElementsUInt?

2009-03-26 Thread Jesper D. Thomsen
Hi all, I'm developing an application where I have to create up to 1000 
osg:geometry objects per frame during certain interaction modes.
I'm using osg::DrawElementsUInt push_back() to define the geometry primitive 
sets, and this push_back() seems to be the primary bottleneck for my 
applications graphical performance. Is there a more efficient way to define the 
primitive sets than to fill a osg::DrawElementsUInt by push_back and add it to 
the geometry?

This is currently bringing me down to about 1 second per frame, which is kind 
of a roadblock.

regards,

Jesper D. Thomsen

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


Re: [osg-users] Most efficient way to use osg::DrawElementsUInt?

2009-03-26 Thread Jesper D. Thomsen
Hi, and thank you.

I naturally tried to use reserve() (but thanks for suggesting it) and this of 
course helped somewhat, but it still seems to be the primary bottleneck. I've 
changed most of the rest of the per-frame geometry generation code to use 
static arrays rather than std::vector and this caused a major speedup (factor 
10 or more) of my own part of the code, but I'm still stuck with the push_backs 
on osg::DrawElementsUInt.
Maybe there's just no faster way to do it, or maybe I'm just using OSG in a 
somewhat un-intended way.

Jesper D. Thomsen


From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Peter Hrenka 
[p.hre...@science-computing.de]
Sent: Thursday, March 26, 2009 12:00 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Most efficient way to use osg::DrawElementsUInt?

Hi Jesper,

Jesper D. Thomsen schrieb:
 Hi all, I'm developing an application where I have to create up to 1000
 osg:geometry objects per frame during certain interaction modes.
 I'm using osg::DrawElementsUInt push_back() to define the geometry
 primitive sets, and this push_back() seems to be the primary bottleneck
 for my applications graphical performance. Is there a more efficient way
 to define the primitive sets than to fill a osg::DrawElementsUInt by
 push_back and add it to the geometry?

 This is currently bringing me down to about 1 second per frame, which is
 kind of a roadblock.

You can use reserve() to pre-allocate the needed memory.
After that push_back() will not perform any reallocations/copies
until the limit is reached.

 regards,


 Jesper D. Thomsen


Cheers,

Peter
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier,
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196


___
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] osgText::readFontFile returns NULL on valid argument

2009-03-18 Thread Jesper D. Thomsen
Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from this 
method:


osgText::Font* t_font = osgText::readFontFile(fonts/arial.ttf);



The strange part is that when I compile and run the osgText and osgHud 
examples, it works just fine (so it isn't the font-file which is missing). It 
only happens in my own program.
So far I have tested it on both Vista and XP machines in the office, and this 
doesn't seem to affect the problem. However, my program works just fine on a 
single XP machine, but not on any of the other machines. I have tried in both 
debug and release modes, and tried both copying the executable and building it 
on different machines, and so far it is consistent in that the deciding factor 
is which machining is running the program and not which machine it was built on.



I'm using OSG 2.6.1 in Visual Studio 2005 sp1 on a Vista machine (but have 
tested on XP also).



Since the osg examples work just fine on the same machine, I guess it is 
something I have done in either the project settings or somewhere in the code, 
but I'm running out of ideas. If anybody have tried something like this, or 
knows what could cause this, I would very much appreciate it.


regards, and thanks in advance.

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


Re: [osg-users] osgText::readFontFile returns NULL on valid argument

2009-03-18 Thread Jesper D. Thomsen
Thank you for your answers.

I have actually found out that the problem is that my program can't find the 
osgdb_freetype.dll plugin, even though it is in the osgPlugins-2.6.1 directory 
in the private assembly I have created for OSG distribution. I'm currently 
messing about a bit with the manifests to try and get it to find it. Apparently 
it doesn't use it if I just add it to the manifest along with the osg48-osg.dll 
and other dll's, but if I place it in the same directory as my application it 
works just fine.

I don't want to have to add OSG to the path of the computer as I want to 
preserve backwards compatability when my program gets ported to a newer OSG 
version.
BTW: have anybody tried creating an OSG shared assembly?

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cole, Charles E. 
(LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY] [charles.e.c...@nasa.gov]
Sent: Wednesday, March 18, 2009 1:54 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgText::readFontFile returns NULL on valid argument

Hi Jesper,

My first inclination is that the path is incorrect, or at least doesn’t match 
with where the font file actually is.  With the code snippet you listed, I 
believe that the file (and path) that you list must be relative to your 
project’s compiled executable.  That would be the first thing that I’d check, 
and Paul’s tip on adding the OSG_NOTIFY_LEVEL can help if you can run your 
executable from a DOS window.  Another means of checking is to place the font 
file in the same directory as your executable and change the readFontFile 
parameter to just “arial.ttf”.  If that works, then that confirms that it’s a 
path issue.

Hope that helps.

Chuck

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. 
Thomsen
Sent: Wednesday, March 18, 2009 7:57 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] osgText::readFontFile returns NULL on valid argument

Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from this 
method:


osgText::Font* t_font = osgText::readFontFile(fonts/arial.ttf);



The strange part is that when I compile and run the osgText and osgHud 
examples, it works just fine (so it isn't the font-file which is missing). It 
only happens in my own program.
So far I have tested it on both Vista and XP machines in the office, and this 
doesn't seem to affect the problem. However, my program works just fine on a 
single XP machine, but not on any of the other machines. I have tried in both 
debug and release modes, and tried both copying the executable and building it 
on different machines, and so far it is consistent in that the deciding factor 
is which machining is running the program and not which machine it was built on.



I'm using OSG 2.6.1 in Visual Studio 2005 sp1 on a Vista machine (but have 
tested on XP also).



Since the osg examples work just fine on the same machine, I guess it is 
something I have done in either the project settings or somewhere in the code, 
but I'm running out of ideas. If anybody have tried something like this, or 
knows what could cause this, I would very much appreciate it.

regards, and thanks in advance.

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


[osg-users] (no subject)

2009-03-05 Thread Jesper D. Thomsen
Hi all,

I'm using OSG to create a single 3D viewport window in an Windows MFC 
application (running on XP and Vista). I'm having problems with sometimes 
getting defective mouse coordinates for the OSG window after I have begun using 
OSG in the application (The window was previously drawn by pure OpenGL). Most 
of the time the mouse coordinates are correct, but about 1/100 of them are 
randomly displaced by up to 500 pixels or so.
I know that this is probably something in OSG conflicting with some part of the 
existing applications readouts of the mouse position, but if any of you have 
experienced anything like it, I would appreciate any pointers.

Regards, and thanks in advance.

Jesper D. Thomsen

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


Re: [osg-users] (no subject)

2009-03-05 Thread Jesper D. Thomsen
Oh, and sorry about the no subject. I hit the Send button to soon.

Jesper D. Thomsen

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


[osg-users] Creating ellipsoids from ShapeDrawables?

2009-01-22 Thread Jesper D. Thomsen
Hi all, a very simple question?

Is it possible to create an ellipsoid from ShapeDrawable(sphere shape) by 
applying some kind of scaling, or do I have to create the geometry myself (not 
really a problem, but shapeDrawable is nice and easy for testing purposes)?
I thought that maybe there was som kind of ScalingTransform kind of like 
PositionAttitudeTransform.

Thanks in advance

Jesper D. Thomsen

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


Re: [osg-users] Creating ellipsoids from ShapeDrawables?

2009-01-22 Thread Jesper D. Thomsen
Thank you very much, it was exactly something like that I was looking for.
I'm primarily using the ShapeDrawables for some prototyping, and I will be 
replacing them at a later stage of the project.

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Melis 
[p...@science.uva.nl]
Sent: Thursday, January 22, 2009 3:59 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Creating ellipsoids from ShapeDrawables?

Hi,

Jesper D. Thomsen wrote:
 Is it possible to create an ellipsoid from ShapeDrawable(sphere shape)
 by applying some kind of scaling,
Sure, just put the relevant transform node above the a Geode that holds
the ShapeDrawable, i.e.
transform - Geode - ShapeDrawable
 I thought that maybe there was som kind of ScalingTransform kind of
 like PositionAttitudeTransform.
Well, there is the general MatrixTransform that you can use to define a
transformation using a 4x4 matrix.
For a scale it can be used as (pseudo-code):

mt = new osg::MatrixTransform(osg::Matrix::scale(sx, sy, sz))

Note that ShapeDrawable is indeed nice for quickly generating shapes,
but if you want more functionality (specifically texture mapping) it
isn't supported by it.

Paul
___
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] How to find out when events are added to the eventqueue?

2008-10-22 Thread Jesper D. Thomsen
Hi all, I'm using OSG for a single window in an MFC application.
As the contents of the window are only changed/updated rarely (kind of like a 
3d-view of a model), I'm manually calling frame() on the viewer when updates 
are necessary, which has been working fine so far.
My problem is that I would like to know when mouseclicks occur in the window, 
as I would like to call frame() on these occasions in order for them to be 
handled by a GUIEventHandler. Currently they are only handled whenever I update 
the viewport, and I would like to be able to detect whenever an event is added 
to the EventQueue, and ideally what type of event it is.

I have been looking through the code, and I don't see any obvious way to to 
this, but I'm still somewhat of a novice regarding OSG.

regards, and thanks in advance.

Jesper D. Thomsen
mailto:[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Intersection destroy - memory errors

2008-10-02 Thread Jesper D. Thomsen
Hi again, I have integrated an OSG viewer in an existing application and have 
gotten the viewer to display a model correctly. I now wanted to implement some 
picking, and I have been using the osgkeyboardmouse example for this.
My problem is that whenever I click on something the deconstructor for 
intersection causes a Heap pointer out of local error when intersection 
goes out of scope.

The code snippet is the following (from osgkeyboardmouse):
---

osgUtil::IntersectionVisitor iv(picker);

viewer-getCamera()-accept(iv);

if (picker-containsIntersections())

{

osgUtil::LineSegmentIntersector::Intersection intersection = 
picker-getFirstIntersection();

osg::notify(osg::NOTICE)Picked 
intersection.localIntersectionPointstd::endl;

osg::NodePath nodePath = intersection.nodePath;

node = (nodePath.size()=1)?nodePath[nodePath.size()-1]:0;

parent = 
(nodePath.size()=2)?dynamic_castosg::Group*(nodePath[nodePath.size()-2]):0;

if (node) std::cout Hits node-className() nodePath 
sizenodePath.size()std::endl;

toggleScribe(parent, node);

}

-
I have tried integrating the osgkeyboardmouse in the osgviewermfc example, and 
there it works fine, so I'm mostly suspecting that the problem lies with my 
existing application, but if anyone have tried anything similar I would like to 
hear any ideas you might have.

Regards,

Jesper D. Thomsen
mailto:[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Problems integrating MFC example with existing application

2008-09-30 Thread Jesper D. Thomsen
Hi again all,

I have an existing MFC application with a window based on Cview, which have 
been used as an OpenGL rendering canvas. I have now disabled the OpenGL 
rendering of the window and instead replicated the osgviewermfc example in my 
application in exactly the same way as in the example.

The problem is that I can't get my model to render, even though the 
backgroundcolor is defined and rendered by the osg viewer.

When debugging the application I noticed that the 
viewer-view-_slaves-[0]-_projectionOffset-_mat-[0]...[3]-[0] values change from 
their initialisation from addslave to -1.#IND000 right after i 
dispatch the rendering thread. This off course causes further problems in 
frame() with other values going bad.

My question is whether OSG could be doing this, or if it must be the original 
application writing somewhere it shouldn't? Or does OSG use som standard OpenGL 
variables which might be overwritten by the existing application?

Regards, and I know this problem is rightly irritating, but I hope somebody can 
give me some hints.

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


Re: [osg-users] Problems getting a model to render using OSG in an MFC application

2008-09-26 Thread Jesper D. Thomsen
I tried changing my implementation to follow the osgviewermfc example very 
closely with the rendering being done exactly as in the example. It didn't help 
with the problem however.
I'm currently trying to take some screenshots at varying times to try to find 
out if the model is being rendered and later blanked out.
I was using osgprerender as inspiration for taking screenshots, and I noticed 
that if I changed the viewer.run() to while(!viewer.done()){viewer.frame()} in 
the example, I would get the exact same problem as in my own application with 
the model not being rendered, but the background being rendered.

regards, and thank in advance.

Jesper D. Thomsen
mailto:[EMAIL PROTECTED]

From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Ümit Uzun [EMAIL 
PROTECTED]
Sent: Thursday, September 25, 2008 11:00 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Problems getting a model to render using OSG in an MFC 
application


Hi Jesper,

Anyone couldn't find your problem by this way, but problem looks like simple. I 
advice you to look at cOSG class and Render threads activation way in 
osgviewerMFC example. I think there is render thread activation problem. You 
can change clear color  but can't render scene. So I think problem is threading 
activation.

I hope have answered your question.
Best Regards.

Umit Uzun

2008/9/25 Jesper D. Thomsen [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
Hi all, first posting here, so be gentle.

I'm trying to integrate OSG in an existing MFC application in place of a 
temporary custom OpenGL renderer.

I have looked at the osgviewermfc example and based my code on that. So far I 
have got a viewer up and running with a single master camera. I have tested 
that the camera is being redrawn by changing the clear-color to a random value 
every frame. When I assign scenedata to the viewer there is nothing being drawn 
however.

I am using the following code in my CView::Oncreate:



// Create a trackball manipulator

trackball =

new osgGA::TrackballManipulator();

// Create a Manipulator Switcher

keyswitchManipulator =

new osgGA::KeySwitchMatrixManipulator;

// Add our trackball manipulator to the switcher

keyswitchManipulator-addMatrixManipulator(

'1', Trackball, trackball);

// Init the switcher to the first manipulator (in this case the only 
manipulator)

keyswitchManipulator-selectMatrixManipulator(0);

// Zero based index Value

// Init the main Root Node/Group

mRoot =

new osg::Group;

// Load the Model from the model name

mModel = osgDB::readNodeFile(

c:/cow.osg);

 Optimize the model

//osgUtil::Optimizer optimizer;

//optimizer.optimize(mModel);

//optimizer.reset();

// Add the model to the scene

mRoot-addChild(mModel);

// Local Variable to hold window size data

RECT rect;

// Create the viewer for this window

mViewer =

new osgViewer::Viewer();

// Add a Stats Handler to the viewer

mViewer-addEventHandler(

new osgViewer::StatsHandler);

// Get the current window size

::GetWindowRect(m_hWnd, rect);

// Init the GraphicsContext Traits

traits =

new osg::GraphicsContext::Traits;

// Init the Windata Variable that holds the handle for the Window to display 
OSG in.

windata =

new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

// Setup the traits parameters

traits-x = 0;

traits-y = 0;

traits-width = rect.right - rect.left;

traits-height = rect.bottom - rect.top;

traits-windowDecoration =

false;

traits-doubleBuffer =

true;

traits-sharedContext = 0;

traits-setInheritedWindowPixelFormat =

true;

traits-inheritedWindowData = windata;

// Create the Graphics Context

gc = osg::GraphicsContext::createGraphicsContext(traits);

// Init a new Camera (Master for this View)

osg_camera =

new osg::Camera;

// Assign Graphics Context to the Camera

osg_camera-setGraphicsContext(gc);

// Set the viewport for the Camera

osg_camera-setViewport(

new osg::Viewport(traits-x, traits-y, traits-width, traits-height));

// Add the Camera to the Viewer

mViewer-addSlave(osg_camera);

// Add the Camera Manipulator to the Viewer

mViewer-setCameraManipulator(keyswitchManipulator);

// Set the Scene Data

mViewer-setSceneData(mRoot);

// Realize the Viewer

mViewer-realize();

-



And in my views OnDraw I use the following:





float r = (float) rand()/RAND_MAX;

float g = (float) rand()/RAND_MAX;

float b = (float) rand()/RAND_MAX;

float a = (float) rand()/RAND_MAX;

osg_camera-setClearColor( osg::Vec4(r,g,b,a) );

mViewer-frame();





As far as I can tell the osgviewermfc uses pretty much the same code.

Any and all help and hint as to what I'm doing wrong would be much appreciated.



Regards, and thanks in advance.



Jesper D. Thomsen

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

[osg-users] Problems getting a model to render using OSG in an MFC application

2008-09-25 Thread Jesper D. Thomsen
Hi all, first posting here, so be gentle.

I'm trying to integrate OSG in an existing MFC application in place of a 
temporary custom OpenGL renderer.

I have looked at the osgviewermfc example and based my code on that. So far I 
have got a viewer up and running with a single master camera. I have tested 
that the camera is being redrawn by changing the clear-color to a random value 
every frame. When I assign scenedata to the viewer there is nothing being drawn 
however.

I am using the following code in my CView::Oncreate:



// Create a trackball manipulator

trackball = new osgGA::TrackballManipulator();

// Create a Manipulator Switcher

keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;

// Add our trackball manipulator to the switcher

keyswitchManipulator-addMatrixManipulator( '1', Trackball, trackball);

// Init the switcher to the first manipulator (in this case the only 
manipulator)

keyswitchManipulator-selectMatrixManipulator(0); // Zero based index Value

// Init the main Root Node/Group

mRoot = new osg::Group;

// Load the Model from the model name

mModel = osgDB::readNodeFile(c:/cow.osg);

 Optimize the model

//osgUtil::Optimizer optimizer;

//optimizer.optimize(mModel);

//optimizer.reset();

// Add the model to the scene

mRoot-addChild(mModel);

// Local Variable to hold window size data

RECT rect;

// Create the viewer for this window

mViewer = new osgViewer::Viewer();

// Add a Stats Handler to the viewer

mViewer-addEventHandler(new osgViewer::StatsHandler);

// Get the current window size

::GetWindowRect(m_hWnd, rect);

// Init the GraphicsContext Traits

traits = new osg::GraphicsContext::Traits;

// Init the Windata Variable that holds the handle for the Window to display 
OSG in.

windata = new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);

// Setup the traits parameters

traits-x = 0;

traits-y = 0;

traits-width = rect.right - rect.left;

traits-height = rect.bottom - rect.top;

traits-windowDecoration = false;

traits-doubleBuffer = true;

traits-sharedContext = 0;

traits-setInheritedWindowPixelFormat = true;

traits-inheritedWindowData = windata;

// Create the Graphics Context

gc = osg::GraphicsContext::createGraphicsContext(traits);

// Init a new Camera (Master for this View)

osg_camera = new osg::Camera;

// Assign Graphics Context to the Camera

osg_camera-setGraphicsContext(gc);

// Set the viewport for the Camera

osg_camera-setViewport(new osg::Viewport(traits-x, traits-y, traits-width, 
traits-height));

// Add the Camera to the Viewer

mViewer-addSlave(osg_camera);

// Add the Camera Manipulator to the Viewer

mViewer-setCameraManipulator(keyswitchManipulator);

// Set the Scene Data

mViewer-setSceneData(mRoot);

// Realize the Viewer

mViewer-realize();

-



And in my views OnDraw I use the following:





float r = (float) rand()/RAND_MAX;

float g = (float) rand()/RAND_MAX;

float b = (float) rand()/RAND_MAX;

float a = (float) rand()/RAND_MAX;

osg_camera-setClearColor( osg::Vec4(r,g,b,a) );

mViewer-frame();





As far as I can tell the osgviewermfc uses pretty much the same code.

Any and all help and hint as to what I'm doing wrong would be much appreciated.



Regards, and thanks in advance.



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