Re: [osg-users] Bug in OSG? getMatrix() and setByMatrix() is not enough to transrer camera state

2015-02-05 Thread Dan Shebounin
For now, existing manipulators does fit. Well... almost :)

I have an idea to write my own, but for quick-n-dirty concept existing will be 
ok. 

Cheers,
Dan

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





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


Re: [osg-users] Bug in OSG? getMatrix() and setByMatrix() is not enough to transrer camera state

2015-02-05 Thread Dan Shebounin
Thanx, Robert!

Get it.

I suppose, the most convenient way then - is to subclass 
KeySwitchMatrixManipulator and override handle() method. My app knows, what 
manipulators will be added to KeySwitcher, and will perform all required 
additional settings during switch.

Cheers,
Dan

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





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


[osg-users] Bug in OSG? getMatrix() and setByMatrix() is not enough to transrer camera state

2015-02-05 Thread Dan Shebounin
I have discovered, that when working with manipulators, it is not enough to 
call getMatrix() and setByMatrix(), when switching between manipulators, say, 
with KeySwitchManipulator.

You can try it: run osgsimulation example and try to switch between 
manipulators with '1' and '2' keys. The camera become crazy.

I do not know the source code well, but suppose, that some mean should be 
created, that notifies manipulator, when it is switched in and out.

Cheers,
Dan

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





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


Re: [osg-users] How to save camera position between manipulators switching?

2015-02-05 Thread Dan Shebounin
I think, I have found a bug in OSG KeySwitchMatrixManipulator.

I have checked example, provided with OSG, it have same troubles, when I switch 
between Trackball and NodeTracker manipulators.

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





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


Re: [osg-users] How to save camera position between manipulators switching?

2015-02-04 Thread Dan Shebounin
KeySwitcherMatrixManipulator doing exactly, as you're described: getMatrix from 
current, and set it to manipulator, that becomes current. But this default 
behavior does not work.

Cheers,
Dan

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





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


[osg-users] How to save camera position between manipulators switching?

2015-02-04 Thread Dan Shebounin
Hello!

I'm using KeySwitchMatrixManipulator with two added manipulators: 
TrackballManipulator and NodeTrackerManipulator.

autoComputeHome is true for KeySwitch manipulator.

TrackballManipulator centered by default in a center of a scene

NodeTracker is looking at one of scene's model.

When I switching a manipulators, camera position and angle changes randomly. Is 
it possible to preserve a camera position and direction of view between changes?

Thank you!

Cheers,
Dan

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





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


Re: [osg-users] compositeView in multithreaded Win32 MFC MDI application

2015-01-30 Thread Dan Shebounin
Well, I have tried a strategy 1 Viewer per 1 ClientWnd. I'm not using Doc/View 
model. It works pretty well for me.

The only thing I have discovered so far: you shouldn't initialize OSG and 
render thread in WM_CREATE handler. This will cause a crash.

Because of this, I have to initialize OSG and render thread in first call to 
WM_PAINT. Of course, it could be done from MainFrame OnNew method, but then I 
have to traverse all chain MainFrame->ChildFrame->ClientWnd. I don't like this 
kind of dependencies.

More disturbing is a very slippery glitch with app hang. I have discovered this 
in my current version of 3d-module, which have been written using Ogre3D. After 
transferring to Windows 7, application hangs in about 50% of runs in Ogre's 
Present method. This method swaps backbuffer to show it on a display. Usually 
app hangs somewhere deep inside video driver or Windows ntdll. My current app 
using a somewhat complicated threading model, so I decided, that it is 
something completely wrong with it.

But today I have experienced a similar hang in my new version of 3D-module, 
written using OSG. In render thread's call to viewer->frame() method. As I 
understand, this method swaps a backbuffer. Not this again! It happened once so 
far, but I don't like this.

Something have changed seriously in Windows 7 graphics. So, multithreaded 
rendering using accelerated 3D graphics should be done in a different way. 
Maybe someone know the issue?

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





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


Re: [osg-users] compositeView in multithreaded Win32 MFC MDI application

2015-01-26 Thread Dan Shebounin
I have found an answer for my own question. I don't know, whether it is 
complete or not, but...

It is an app in OSG examples, named osgviewerMFC, that demonstrates almost 
exactly what I need.

The app doesn't use CompositeView class. And things are much simpler then.

Will investigate further...

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





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


[osg-users] compositeView in multithreaded Win32 MFC MDI application

2015-01-25 Thread Dan Shebounin
Hi!

We have a mature app, that uses Microsoft's MFC library for GUI management. 
Application windowing model is MDI.

I have to render a multiple 3D scenes in different MDI childs, which are 
created elsewhere. So, I should attach OSG context to existing window.

The threading model of our app is messy, so it is a possibility, that calls 
will be made from different threads.

Is there any general sources of information, how to use correctly compositeView 
in this environment, and how to correctly attach View to MDI child's client 
window?

Thank you!

Cheers,
Dan

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





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