Re: [osg-users] Loading an osgb file from a statically linked application

2013-01-06 Thread Thilo Weigel
Hi,

With the following lines added to my code everything works as expected:

USE_SERIALIZER_WRAPPER(DefaultUserDataContainer)
USE_SERIALIZER_WRAPPER(StringValueObject)

Interestingly, these macros aren't used in osgstaticviewer.

Cheers,
Thilo

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





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


Re: [osg-users] Animation of shared model

2012-08-18 Thread Thilo Weigel
Hi Sergey, 

Ok, thanks. I'll do that.

Cheers,
Thilo

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





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


Re: [osg-users] play animation backwards?

2012-08-18 Thread Thilo Weigel
Hi,

I locally changed Animation::update() to be virtual and inherited my own 
animation class with special backwards animation code in the update() 
function.

Would it be possible to make Animation::update() virtual in future osg 
releases? Or is my approach rather discouraged?

Thank you!

Cheers,
Thilo

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





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


Re: [osg-users] Animation of shared model

2012-08-17 Thread Thilo Weigel
Hi Sergey,

Thanks for your advice! Unfortunately I'm not sure if I completely understood 
your solution. Would you mind to help me a little bit further?

Suppose I retrieved the model and the animation manager as follows:
osg::ref_ptr osg::Node  model = osgDB::readNodeFile(nathan.osg);
osgAnimation::BasicAnimationManager* modelManager = dynamic_cast  
osgAnimation::BasicAnimationManager*  (model-getUpdateCallback());

Now I  add one of several transforms:
osg::ref_ptr  osg::PositionAttitudeTransform  transform = new 
PositionAttitudeTransform();
transform-addChild(model);
transform-addUpdateCallback(modelManager.get());

And finally play all animations of the model:
const osgAnimation::AnimationList animations = 
modelManager-getAnimationList();
for (unsigned int i=0; i  animations.size(); ++i )
{
  modelManager-playAnimation( animations[i].get() );
}

After reading your post I tried not to add the modelManager to the transform 
but  a new animation manger using the existing animations:
osg::ref_ptr  osgAnimation::BasicAnimationManager  manager = new 
osgAnimation::BasicAnimationManager;
for (unsigned int i = 0; i  modelManager-getAnimationList().size(); ++i)
{
osgAnimation::Animation* animation = new 
osgAnimation::Animation(*modelManager-getAnimationList()[i]);
// alternatively: osgAnimation::Animation* animation = 
modelManager-getAnimationList()[i];
manager-registerAnimation(animation);
}
transform-addUpdateCallback(manager);

But with this approach also all animations off all instances are playing in 
parallel. What am I missing?

Thank you!

Cheers,
Thilo

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





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


Re: [osg-users] Animation of shared model

2012-08-17 Thread Thilo Weigel
Hi Sergey,

I removed the animation manager from the original model:
model-removeUpdateCallback(model-getUpdateCallback());
and created a new animation manager with clones of the original animations:
osg::ref_ptr  osgAnimation::BasicAnimationManager  manager = new 
osgAnimation::BasicAnimationManager;
for (unsigned int i = 0; i  modelManager-getAnimationList().size(); ++i)
{
osgAnimation::Animation* animation = dynamic_cast  osgAnimation::Animation* 
(modelManager-getAnimationList()[i]-clone(osg::CopyOp::DEEP_COPY_ALL));
manager-registerAnimation(animation);
}
transform-addUpdateCallback(manager); 

The animations are still played on all instances - even if I add the animation 
manager to only the first transform.
Do I have to remove more than just the updateCallback of the original model? 
How is it possible that the animation is played on the second instance even if 
there is no (animation) updateCallback added to it?

Thank you!

Cheers,
Thilo

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





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


[osg-users] Animation of shared model

2012-08-15 Thread Thilo Weigel
Hi,

I'd like to place several instances of the same model in a scene and play the 
model's animation individually on each instance - just like having several 
nathans standing around and letting each one scratch his head asynchronously to 
the others.

The model is loaded once and assigned  to a osg::Group. The model's instances 
are placed by attaching the osg::Group  to different 
PositionAttitudeTransforms. Similar code as in the osganimationviewer is used 
to retrieve the model's osgAnimation::BasicAnimationManager which is then added 
as an UpdateCallback for each PositionAttitudeTransform.

Obviously, the animations can now only be played synchronously on all 
instances. How could I achieve being able to start the animation of each 
instance individually - for example to let each nathan start scratching its 
head for a few seconds after clicking on it?

Thanks a lot for any hints,

Cheers,
Thilo

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





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


Re: [osg-users] Loading an osgb file from a statically linked application

2012-08-05 Thread Thilo Weigel
Hi,

The simple solution for me was now to let my statically linked application do 
the conversion from osgt to osgb using simple readNodeFile and writeNodeFile 
calls. No need to remove useradata containers. The -rdynamic flag isn't 
necessary, either.

Obviously there is a binary incompatibility between two library versions 
related to the osgb format (The static osg library is build from the 
OpenSceneGraph-3.0.1.zip archive downloaded from the osg website. The dynamic 
library version is 3.0.1-4.6 from OpenSuse BuildService.). 

Does this mean that most probably I'll have to convert all model files again 
when upgrading the osg library?

Cheers,
Thilo

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





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


Re: [osg-users] play animation backwards?

2012-07-03 Thread Thilo Weigel
Hi Paul,

Thank your for your suggestion. Decrementing the simulation time in 
Viewer::frame() would probably allow to play one animation backwards. But I 
would be stuck if I wanted to play two different animations at the same time, 
one being played backwards and one in the normal direction?

Cheers,
Thilo

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





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


[osg-users] play animation backwards?

2012-07-02 Thread Thilo Weigel
Hi,
Unfortunately I couldnt figure out how to play a given animation 
backwards. The animation is part of a model read from an osgt file. 
Looking at osgAnimation/Animation.cpp it would be straightforward to add 
an additional switch case to Animation::update()

case ONCE_BACKWARDS:
 t = _originalDuration - t;
 if (t  0)
 return false;

However, I wonder if there is an obvious way to achieve the same without 
having to modify the file Animation.cpp ?

Thank you for any hints!

Cheers,

Thilo
Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App fr iPhone und Android.https://produkte.web.de/freemail_mobile_startseite/

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


Re: [osg-users] osgviewer crash

2009-12-10 Thread Thilo Weigel
Hi Robert,

Thank you for your reply!

Probably there is a misunderstanding: osgviewer is not killed all the time. It 
is started once until it crashes by itself. The xterm-script is started in a 
separate terminal and only opens/closes a single plain xterm. osgviewer runs 
fine for quite some time while the script opens and closes an xterm on top of 
the osgviewer fullscreen view. But after a while osgviewer crashes.

The script opens and closes an xterm to simulate opening and closing a Settings 
Window in my application. Once in a while my application crashes after a user 
opened/closed that window. I found that the same thing happens with osgviewer 
and xterm.

I'm ran osgviewer in SingeThreaded mode.

I'd appreciate any further hints,

Thanks,

Thilo



 Hi Thilo,
 
 This is may well be a driver issue.  Killing the app really isn't a
 good way to test things... you can actually get the OSG to
 viewer::run() for a limited number of frames then exit using the env
 var - set OSG_RUN_FRAME_COUNT to something like 10. i.e.
 
  export OSG_RUN_FRAME_COUNT=10
  osgvewer cow.osg
 
 Another route of investigation would be to for the OSG to run single
 threaded by doing:
 
  export OSG_THREADING=SingleThreaded
 
 Then running osgviewer/example.
 
 Whether this will change the behavior, or whether it'd indicate an OSG
 threading bug or X11/GL driver bug I wouldn't be able to say.  What I
 can say is really thrashing the X server/GL driver this way is not
 really testing it in ways that actual users will ever stress your
 application.
 
 Robert.
 
 On Wed, Dec 9, 2009 at 5:18 PM, Thilo Weigel thilo.weigel at web.de wrote:
  Hi,
 
  If I run /usr/bin/osgviewer cow.osg while constantly toggling an xterm
 
 window (using the script below) osgviewer crashes after a while (anything
 between 15 Minutes and 2 hours)
 
  It seems like the crash only occurs in fullscreen mode.
 
  Does this sound familiar to anybody? Is this rather an OSG, OpenGL,
  XServer
 
 or a NVIDIA driver issue?
 
  I'm using
  - OpenSceneGraph 2.8.2
  - One single XScreen
  - NVIDIA driver 185.18.14 (also tried several others including the latest
 
 190.42)
 
  - AntiAliasing Settings 4xMS, Anisotropic Filtering 2x
  - OpenSuse 11.1
  - Icewm WindowManager
  - osgviewer
   - in SingleThreaded mode
   - in Fullscreen mode
 
 
  The script for toggling an xterm window is the following:
 
  #!/bin/bash
  while [ 1 ]
  do
   xterm 
   sleep 1
   /usr/bin/pkill -P $$
   sleep 1
  done
 
 
  The following coredump is generated:
 
  Core was generated by `osgviewer cow.osg'.
  Program terminated with signal 11, Segmentation fault.
  #0  0x7fbb9cb6c59b in ?? () from /usr/lib64/libGLcore.so.1
  (gdb) bt
  #0  0x7fbb9cb6c59b in ?? () from /usr/lib64/libGLcore.so.1
  #1  0x7fbb9c8facf2 in ?? () from /usr/lib64/libGLcore.so.1
  #2  0x7fbb9c8ff29d in ?? () from /usr/lib64/libGLcore.so.1
  #3  0x7fbb9c8ee321 in ?? () from /usr/lib64/libGLcore.so.1
  #4  0x7fbb9ea38813 in ?? () from /usr/lib64/libGL.so.1
  #5  0x7fbb9ea5343e in glXSwapBuffers () from /usr/lib64/libGL.so.1
  #6  0x7fbb9f54691b in
 
 osgViewer::GraphicsWindowX11::swapBuffersImplementation() () from
 /usr/lib64/libosgViewer.so.55
 
  #7  0x7fbba01444a9 in osg::GraphicsContext::swapBuffers() () from
 
 /usr/lib64/libosg.so.55
 
  #8  0x7fbb9f53d60d in osgViewer::ViewerBase::renderingTraversals() ()
 
 from /usr/lib64/libosgViewer.so.55
 
  #9  0x7fbb9f53b771 in osgViewer::ViewerBase::run() () from
 
 /usr/lib64/libosgViewer.so.55
 
  #10 0x00403a37 in main ()
 
 
  Thank you for any hints!
 
  Cheers,
 
  Thilo
 

___
Preisknaller: WEB.DE DSL Flatrate für nur 16,99 Euro/mtl.! 
http://produkte.web.de/go/02/

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


[osg-users] GraphicsWindow::setWindowDecoration using kde4 and icewm

2009-11-04 Thread Thilo Weigel
Hi,

Switching osgviewer to windowed mode (using the 'f' key) yields a decorated 
window using icewm. However, I get a borderless window using kde4.
The same happens if I change the window decoration in my own app using  
osgViewer::GraphicsWindow::setWindowDecoration().

Is there a way to force kde to put borders around the window? Or am I just 
missing a simple kde setting and should rather post on a kde mailing list?

Thanks for help,

Cheers,

Thilo
_
DSL-Preisknaller: DSL-Komplettpakete von WEB.DE schon für 
16,99 Euro/mtl.!* Hier klicken: http://produkte.web.de/go/02/

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