Re: [osg-users] Failure in casting to osg::AnimationPathCallback*

2013-02-07 Thread Philip Lamb
Hi all,

Thanks for the pointers to the source of the problem. Indeed it is related to 
symbol visibility. For reference, I had to change Xcode's default settings as 
follows:

GCC_SYMBOLS_PRIVATE_EXTERN = NO (Setting name in Xcode is Symbols 
Hidden by Default)
GCC_INLINES_ARE_PRIVATE_EXTERN = NO (Setting name in Xcode is Inline 
Methods Hidden)

and finally things work as expected on OS X. In my case I needed both for the 
fix. For reference, this is with Clang/LLVM 4.2.1.

A thread on the Clang/LLVM mailing list indicates that there is a warning flag 
which can be activated to alert to these kind of issues:
-Wweak-vtables
With the default Xcode settings (hiding symbols not explicitly exported) and 
this warning activated, I got a lot of warnings like: 
'ResetAnimationNodesVisitor' has no out-of-line virtual method 
definitions; its vtable will be emitted in every translation unit

This is in spite of it clearly having a virtual method -- it would be more 
helpful if the weak vtables check could have told me that the vtable was being 
discarded by the symbol hiding, rather than not being created at all. A missing 
(or weak) vtable would certainly prevent RTTI from working correctly.

Many thanks for the help with a rather obscure problem.

Regards,
Phil.

On 8/02/2013, at 8:40 AM, Robert Osfield robert.osfi...@gmail.com wrote:

 Hi Stephan,
 
 Thanks for the explanation, you learn something new everyday :-)
 
 Incompatibility like this I'd personally put down as a bug in the
 design/implementation rather than a feature.  I am curious why we
 haven't seen this particular issue more often.  If the visibility of
 classes is hidden by default then we should be seeing these issues
 between OSG libs and applications all the time - for instance the code
 almost identical that that Philip is using is used in osgPresentation
 with it doing dynamic_cast on objects provided by the core osg lib.
 
 The question next is really what to do about the issue.  Just document
 the bug and it's workaround - changing symbol visibility via compiler
 options or do we change the OSG itself so it by default doesn't hide
 visibility of symbols.
 
 Robert.

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


[osg-users] Failure in casting to osg::AnimationPathCallback*

2013-02-06 Thread Philip Lamb
Hi all,

I'm running into an interesting bug in my code which manifests as behaviour 
that works on one platform (Windows) and not on another (OS X) with the same 
OSG code. (Using OSG trunk, around 3.1.4)

I am using the following node visitor to reset animations attached to transform 
nodes:

class ResetAnimationNodesVisitor : public osg::NodeVisitor
{
public:

ResetAnimationNodesVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}

virtual void apply(osg::Transform transform)
{
osg::NodeCallback *nc = transform.getUpdateCallback();
osg::AnimationPathCallback* apc = 
dynamic_castosg::AnimationPathCallback*(nc);
if (apc) {
apc-reset();
apc-update(transform);
}
traverse(transform);
}
};

This visitor is instantiated on a node thus:

void resetAnimationTime(osg::ref_ptrosg::Node modelNode)
{
ResetAnimationNodesVisitor ranv;
modelNode-accept(ranv);
}

When compiled and run on an animated model under Windows (compiled with Visual 
Studio 2010 SP1) all works as expected. When the exact same code is compiled 
and run under OS X (using Xcode 4.5.2, with LLVM 4.2.1) the dynamic cast to 
osg::AnimationPathCallback* is always NULL.

I have checked that RTTI is not disabled (it's on by default, and no errors are 
produced by the dynamic_cast, and that indeed things are as expected with 
this snippet inside apply():

if (nc) osg::notify(osg::NOTICE)  UpdateCallback: className is   
std::string(transform.getUpdateCallback()-className())   and type_id.name() 
is  typeid(transform.getUpdateCallback()).name()  std::endl; 

which produces the output:

UpdateCallback: className is AnimationPathCallback and type_id.name() is 
PN3osg12NodeCallbackE

So it looks like a failure somewhere in RTTI. Both typeid and the 
dynamic_cast fail to convert the osg::NodeCallback* to an 
osg::AnimationPathCallback*. Yet clearly, the callback IS the right type, as 
evidenced by OSG's className() function's output.

Any ideas about where this kind of issue might be coming from?

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


Re: [osg-users] How can I create a polgons with gaps for texts inside the polygon?

2013-01-24 Thread Philip Lamb
Have you considered an approach using stenciling? The general approach is to 
draw your labels (text) first with stencil buffer writes enabled. Then disable 
stencil writes, and draw the rest of your scene. When you come to drawing the 
lines or polygons which should have the outlines of the text removed, then 
enable the stencil test.

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





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


Re: [osg-users] “Include can't be =?UTF-8?Q?found=E2=80=9D?=, how to fix it?

2013-01-14 Thread Philip Lamb
You'll also need to add /Library/Frameworks to the Frameworks search path in 
your project settings.

Regards,
Phil.

On 12/01/2013, at 3:02 AM, Mohamed Alji osgfo...@tevs.eu wrote:

 Hi,
 
 I am developing using OpenSceneGraph. I installed it from a user-runnable 
 installer.
 
 When I try to compile an application using OpenSceneGraph, I have this 
 Include can't be found for all includes, like .

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


Re: [osg-users] seg fault with text-setText(mystring) called in NodeCallback

2013-01-12 Thread Philip Lamb
If you're developing on Windows under visual studio one thing you should check 
is that all libraries are linked with the same runtime. I have seen weird  
segfaults using std::string when linking debug binaries with binaries built 
using release mode.

Apparently Microsofts debug and release runtimes have different implementations 
of std::string leading to misalignment and overflow when passing strings 
between modules.

Regards,
Phil

On 12/01/2013, at 12:44 AM, DavidHornung horn...@googlemail.com wrote:

 Hi Robert,
 
 i have tested you tip, but it in my case it seems not to work.
 I only call the setText() method via my NodeVisitor, also run the viewer in 
 SingleThreaded mode, and set text-setDataVariance(osg::Object::DYNAMIC).
 what else could be wrong?
 
 David
 Hi David,
 
 Best guess would be that you are running the viewer multi-threaded
 (it's default if you have a multicore processor) and the update
 traversal to the text is occurring at the same time as the draw
 traversal that is reading.  The solution is to tell the scene graph
 that you plan to dynamically update the text object so that it knows
 not to overlap the update/event and draw traversals.  You can do this
 by using text-setDataVariance(osg::Object::DYNAMIC);
 
 Robert.
 
 On 10 January 2013 16:41, DavidHornung horn...@googlemail.com wrote:
 Hello,
 i have a seg fault because the osgText::Text::setText(std::string) is not
 thread-save.
 It appears from type to time
 
 Why get I this seg fault sometimes?
 
 I have the following setup
 
 class ObjectGroup : public osg::Group
 {
 ...
ObjectGroup()
   {
...
text = osgText::Text;

this-addChild(text);
this-setUpdateCallback(new ObjectNodeCallback);
   }
 
 //called from NodeCallback
   void updateText()
   {
 text-setText(myText);
}
 
 private:
osgText::Text text;
std::String myText;
 ...
 };
 
 class ObjectNodeCallback : public osg::NodeCallback
 {
 //override
 operator ()(osg::Node* node, osg::NodeVisitor* nv)
 {
 osg::ref_ptrObjectGroup obj =
 dynamic_castObjectGroup*(node);
 obj-updateText();
 traverse(node, nv);
 }
 };
 
 
 Cheers,
 David
 ___
 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Build Install OpenSceneGraph-3.1.3 give me a No WindowSystemInterface error ?

2013-01-06 Thread Philip Lamb
If you'd like a more recent Mac OSG binary which includes a user-runnable 
installer, OSG Frameworks supporting both 32 and 64-bit archs, etc. you can use 
the one published by ARToolworks:

http://www.artoolworks.com/dist/openscenegraph/3.1.x/

It doesn't include the COLLADA (.dae) plugin but most other plugins are present.

Regards,
Phil.

On 6/01/2013, at 12:18 PM, Chris Hanson xe...@alphapixel.com wrote:

 You can get an OSG 3.0.1 pre-built OSX binary from my site:
 http://alphapixel.com/osg/downloads/free-openscenegraph-binary-downloads
 
 You'll need a 7zip extractor to uncompress them:
 http://www.macupdate.com/app/mac/19139/ez7z
 
 I can't help you a whole lot as I am not a Mac developer myself, but see if 
 those will run for you.
 
 
 On Sat, Jan 5, 2013 at 2:10 PM, Mohamed Alji osgfo...@tevs.eu wrote:
 Hi,
 
 I would like to use pre-binaries if possible but I could not make it work. I 
 used MacPort to install OSG ...
 
 Do you advise me to try somehow different ?
 
 
 
 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Huge binaries on Android.

2012-11-22 Thread Philip Lamb
Thanks everyone for the help. I have identified two things. The first was a 
blunder on my part; I was looking at my linked dylib in obj/local, which 
includes all the debug symbols. The ndk-build 'Install' step actually strips 
the shared lib before placing it in lib/, and this was a much more reasonable 
size.

The second thing I did was add:

LOCAL_CPPFLAGS += -fvisibility-hidden

to my Android.mk and that shrinks things a bit further too. End result is total 
of 40MB total for all 4 architectures.

Regards,
Philip Lamb

On 22/11/2012, at 9:12 PM, Jorge Izquierdo Ciges jori...@gmail.com wrote:

 I think Matthias is totally right. Android NDK toolchain doesn't use strip 
 when generating static libraries (it's not safe for all the cases). Usually 
 when you are compiling the final dylib that is loaded through Java the 
 toolchan uses stripping to reduze the size. but i think that it is only used 
 IF you are using the ndk-scripts. So maybe if you have set your own compile 
 configuration you didn't include that step.
 
 More info about stripping here: 
 http://www.technovelty.org/linux/stripping-shared-libraries.html
 
 But the simple version is that stripping a dylib is safe.
 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Huge binaries on Android.

2012-11-22 Thread Philip Lamb
On 22/11/2012, at 11:44 PM, Jan Ciger jan.ci...@gmail.com wrote:
 Do you actually need to compile for MIPS and x86? x86 Android devices are 
 very very rare and I have never heard about a MIPS one (maybe some TVs?). The 
 armeabi and armeabi-v7a are the most common ones, in fact, if you want to cut 
 down even more (and don't mind a bit of performance loss), armeabi binaries 
 will run on everything.

Yes, since we (ARToolworks) use OSG in our ARToolKit SDKs (across Windows, OS 
X, Linux, iOS and hopefully soon, Android :-) ), we have to anticipate that the 
users of our SDK will potentially run on any architecture supported by Android. 
Intel is making a push with Atom-based Android tablets, so x86 is likely to be 
more common going into 2013. There are a bunch of low-cost Android devices in 
China using MIPS.

On another note made in the thread about attempting to replicate OpenCV's 
OpenCV Manager strategy for Android: to those developing the Android port of 
OSG, and on behalf of the users, don't do this. It makes for bad user 
experience. The user just wants to install and run your app, and then has to 
deal with what is this asking me to install NOW? along with the delay, 
logging in and fiddling with the Android market. We use OpenCV and we have gone 
to some lengths to statically link OpenCV to as to avoid having to put our 
users through this. It's basically trying to solve a problem which doesn't 
exist -- users really don't care that much about a couple of extra MB in size 
of your app. It also potentially breaks your app if the user installs new 
binaries including changes which are not completely backwards compatible.

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


[osg-users] Huge binaries on Android.

2012-11-20 Thread Philip Lamb
Hi all,

I'm doing a few experiments with builds of OSG on Android, and thus far have 
things compiling and linking OK, but the size of the built binaries is HUGE.

With building to static libs and in release mode, the libraries are weighing in 
at over 1GB per architecture. Once linked into a dylib, the finished product is 
still over 170MB per architecture.By way of comparison, the same type of build 
on iOS weighs in at around 40MB total for 2 architectures.

Is there some Build massive binaries setting which I've inadvertently 
enabled? Or some strip options which I've missed or could add? Tips and/or 
experiences in this area gladly welcomed.

Regards,
Phil

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





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


[osg-users] osgFX::Outline implementation for OpenGL ES?

2012-10-18 Thread Philip Lamb
Hi all,

osgFX::Outline is quite a useful effect to have, but due to its dependency on 
glPolygonMode, doesn't function on OpenGL ES implementations.

Does anyone have any suggestions or even an implementation of osgFX::Outline 
that will work on OpenGL ES?

There appear to be promising approaches out there which do two passes, where 
the second moves each vertex along its normal by an amount proportional to the 
z distance in eye coordinates, but I wouldn't even know where to begin to 
implement this in OpenSceneGraph within the existing osgFX classes.

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


Re: [osg-users] [forum] Wiki editing contact

2012-10-18 Thread Philip Lamb
Jordi,

I'm keen to help where I can. I'd like to update and move the osgExp pages over 
as soon as possible.

Would you please grant me editing rights.

Thanks,

Phil.

On 18/10/2012, at 9:47 PM, Jordi Torres jtorresfa...@gmail.com wrote:

 Hi Phil,
 
 Right now we are moving the wiki to a joomla site (see [1] and [2]). So I 
 think it is worth to update the information in the new web. Community help is 
 really appreciated :).
 
 [1]http://www.openscenegraph.com
 [2]http://www.openscenegraph.com/index.php/community/news/68-openscenegraph-com-website-needs-community-help
 

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


Re: [osg-users] osgFX::Outline implementation for OpenGL ES?

2012-10-18 Thread Philip Lamb
So it looks like a viable option for an OpenGL ES 1.x-compatible outline is to 
scale the model in the second pass (rather than drawing wireframe), calculating 
the scaling factor so that it outlines the normal-size model by approximately 
the required amount.

With a couple of approximations, the scaling factor works out a bit like this:

scalef = ((2 * outlineWidth / viewPortHeight) + 1) * projection[1][1] * 
distanceFromCentreOfModelBoundingSpehereToEye / modelBoundingSphereRadius;

and that's fine, but now the difficult part can a scaling operation even be 
implemented within the constraints of osgFX's pathways? If so, how? And if so, 
how can I retrieve the projectionMatrix, viewPort, and distance to the eyepoint?

TIA,
Phil.

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





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


[osg-users] [forum] Wiki editing contact

2012-10-17 Thread Philip Lamb
Hi all,

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

but have had no response.

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

Regards,
Phil

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





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


Re: [osg-users] [forum] Site web down

2012-08-21 Thread Philip Lamb
Hi,

The main OSG web is down again. The error reported is Trac database locked.

Regards,
Phil.

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





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


Re: [osg-users] Regarding osgOcean

2011-04-08 Thread Philip Lamb
Hi,

I also have run into similar issues (errors about invalid forward declarations 
of fstream) when compiling osgDB on Mac OS X Xcode.

I have identified the cause and two actions to take to fix the problem.

The cause is that osgDB includes a header osgDB/fstream which is being picked 
up the #include fstream preprocessor line. The reason why this is occuring is 
that by default Xcode builds a headermap of all headers used in the project, 
and the local version of fstream is being used instead of the C++ standard 
library version.

The fix is to add two build settings at the root of the OSG project:

Code:
HEADERMAP_INCLUDES_FLAT_ENTRIES_FOR_TARGET_BEING_BUILT = NO
ALWAYS_SEARCH_USER_PATHS = NO



Hope this helps.

Regards,
Phil

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





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


Re: [osg-users] [build] OSG 2.8.3 with XCode 3.2 on 10.6.4

2010-11-15 Thread Philip Lamb
From memory, OpenThreads.framework needs to be added into the link phase of 
some of the other frameworks and libs.

If all you need is a working pre-compiled version of OSG 2.8.2 for Mac OS X, I 
have made an installer package available here:

www.artoolworks.com/dist/openscenegraph/2.8.2/

Regards,
Philip


gabyx wrote:
 Hi,
 
 I have a general build problem:
 -I downloaded the 2.8.3 stable version ZIP file.
 - Compiled (out of the box) the XCode Project (Release 32bit Cocoa)
 - Compiles fine, no errors, all frameworks  builded
 - Copied the Frameworks to /library/frameworks/
 - Made a new XCode Project from Template of the ZIP (2.8.3)
 
   - This Project does not compile:
   - Included only the osg/* headers in the prefix header
   - It cannot find several files, header in the framework I think, this is 
 strange:
 
 In file included from /Library/Frameworks/osg.framework/Headers/AlphaFunc:17,
  from .../Desktop/OSGTEST/OSGTEST_Prefix.pch:31:
 /Library/Frameworks/osg.framework/Headers/StateAttribute:19:38: error: 
 osg/StateAttributeCallback: No such file or directory
 In file included from ...Desktop/OSGTEST/OSGTEST_Prefix.pch:83:
 /Library/Frameworks/osg.framework/Headers/ImageStream:18:27: error: 
 osg/AudioStream: No such file or directory
 
 When I copy the missing headers in the frameworks, it compiles,but gives a 
 linking error with:
   OpenThreads::Atomic::operator--(), referenced from:
  osg::Referenced::unref() constin main.o
 ld: symbol(s) not found
 collect2: ld returned 1 exit status
 
 
 
 What is wrong here, I dont know really how to get this working?...
 Could anyone help?
 
 
 Thank you!
 
 Cheers,
 Gabriel[/b]


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





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


Re: [osg-users] OSG on IPhone

2010-11-15 Thread Philip Lamb
Hi all,

I've just checked out the OSG iOS (a.k.a. iPhone) port which several of you 
have been putting a lot of effort into. Congratulations on the achievements so 
far.

Am I correct in thinking that the branch at
https://github.com/stmh/osg/tree/iphone contains the most recent efforts?

I have two particular issues which I've encountered so far. The first is that 
on iOS retina-display devices (currently iPhone 4 and iPod Touch 4G) the 
graphics are being rendered only half-size. I saw some discussion on this in 
earlier posts, but I can't see any fixes for this in the current repo. Does 
anyone have a fix coded up waiting for testing?

The second issue is that I'm not seeing animation on some animated OSG models. 
Are there known issues with animation in the current port?

I'd like to help out where possible with this port, and I have a bunch of 
devices I can test on.

Regards,

Philip

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





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


[osg-users] osgViewer crash loading textures under Windows Vista

2009-11-02 Thread Philip Lamb
osgViewer (OSG v2.6, compiled under Windows XP SP3 with Visual Studio  
2005 SP1) crashes while loading textured models (e.g. cow.osg) when I  
run it on a clean install of Windows Vista SP2. Before I go through the
pain of installing VS on this copy of Vista to run the debugger, are  
there any known gotchas running OSG compiled under XP in Vista?


I'm tempted to just tell the customer to go back to running our app  
under XP but I'm sure this unfortunately won't be the last time we end  
up having to support a deployment on Vista.


Any help or experiences much appreciated.

Regards,
Philip Lamb

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


Re: [osg-users] Pausing and restarting animations in a subgraph read in via osgDB

2009-05-21 Thread Philip Lamb
Thanks for the help. However, I'm not sure how I go about locating  
which nodes have AnimationPathCallback attached in the nodevisitor. I  
think I understand that usually in a nodevisitor, one can just  
overload the accept() method with the node type one is interested in,  
but in this case the callbacks are attached to MatrixTransformation  
nodes; how to I identify whether a MatrixTransform has an attached  
AnimationPathCallback?


If there's a piece of sample code which shows a method, I'd be happy  
just to be pointed to that.


Regards,
Phil.

On 21/05/2009, at 9:44 AM, Robert Osfield wrote:


Hi Phil,

I would write a custom Registry::ReadFileCallback that loads the
models using the standard Registry::readFileImplementation() way and
then runs a custom visitor on the loaded model before returning this
model to application.

The custom visitor would look for nodes in the scene graph that are
animated and then toggle their state to the state you want, and
potentially add extra callbacks or mapping so that you application can
keep track of these animating nodes.

Robert.

On Wed, May 20, 2009 at 9:20 PM, Philip Lamb p...@eden.net.nz wrote:

Hi all,

Apologies if the answer to this question should be self-evident,  
but I'm

having some trouble implementing a solution for pausing, restarting,
resetting and detecting the end of animations contained in a  
subgraph read

in via osgDB.


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


Re: [osg-users] Pausing and restarting animations in a subgraph read in via osgDB

2009-05-21 Thread Philip Lamb

Robert,

Thanks for this. It works well. When I get a moment, I'll write up a  
patch for the osganimate example to add a play/pause function.


Regards,
Phil.

On 21/05/2009, at 10:48 AM, Robert Osfield wrote:

In the NodeiVisitor simply do:

void apply(osg::Transform tranform)
{
osg::AnimationPathCallback* apc =
dynamic_cast 
osg::AnimationPathCallback*(transform.getUpdateCallback());

   if (apc)
  {
   // do your stuff...
  }
}


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


Re: [osg-users] Pausing and restarting animations in a subgraphread in via osgDB

2009-05-21 Thread Philip Lamb


On 21/05/2009, at 4:21 PM, Thrall, Bryan wrote:


Also, if Philip wants to pause all animations in the scene (instead of
just ones from the subgraph), he could just pause the simulation  
time in

the frame loop like this untested code:
... SNIP ...


Bryan,

That's a good tip, and closer to my original intent of having a global  
pause / resume of all time-based things happening in the scene. For  
reference for others, here is the code I've used. Class names removed  
for sake of brevity.


In my application class header:

double _mySimulationTimeStart, _mySimulationTimePause,  
_mySimulationTime;

bool _globallyPaused;

In my application class (_viewer is an osg::Viewer, already set up):

_viewer.realize();
_mySimulationTimeStart = _mySimulationTimePause =  
_mySimulationTime = 0.0;
_globallyPaused = false; // Could also be true, to start in a  
paused state.

while (!_Viewer.done())
{
_mySimulationTime =  _viewer.getViewerFrameStamp()- 
getReferenceTime() - _mySimulationTimeStart;

if (_globallyPaused) _viewer.frame(_mySimulationTimePause);
else _viewer.frame(_mySimulationTime);
}

and the handler for pause/resume events:

void setGloballyPaused(bool pause)
{
_globallyPaused = pause; // Set global state.
if (_globallyPaused) _mySimulationTimePause = _mySimulationTime;
else _mySimulationTimeStart += _mySimulationTime -  
_mySimulationTimePause; // Add elapsed time since pause started to  
offset.


That's it.

Incidentally, I've also discovered a bug/feature in  
osg::AnimationCallback::reset(). if the animation callback is in a  
paused state, the reset of the actual transform node which the  
callback is attached to only takes effect once the animation callback  
is placed into the unpaused state. This has the rather annoying effect  
that if an animation has run its course, and has been paused, a reset  
won't change it's state in the scene graph. I tried to work up a work- 
around for this, but haven't so far.


Regards,

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


[osg-users] Pausing and restarting animations in a subgraph read in via osgDB

2009-05-20 Thread Philip Lamb

Hi all,

Apologies if the answer to this question should be self-evident, but  
I'm having some trouble implementing a solution for pausing,  
restarting, resetting and detecting the end of animations contained in  
a subgraph read in via osgDB.


Basically, I have some models with animations embedded (exported from  
3DS Max via osgExp plugin for Max) and I load these in via osgDB. What  
I want to do is provide a set of controls to start the animations,  
pause them while in progress, resume them from pause, and then get a  
callback (or detect via some other means) when they've finished running.


My idea in general was to use a keyboard handler which then creates a  
node visitor, asks the models to accept the visitor, and then in the  
visitor I change some state. Any hints on whether this is the  
recommended approach, and how to actually implement it gladly welcomed.


Regards,
Phil.

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


Re: [osg-users] Stereo Problem

2009-05-19 Thread Philip Lamb


On 19/05/2009, at 12:44 AM, Jan Ciger wrote:
The caveat with using quad-buffered mode is that Apple's machines  
don't
include any means of signalling the shutter glasses or stereo  
goggles,

so you're back to using something like the Stereographics blue-line
detector box to perform the signal extraction.


It doesn't work through the VGA pin 13 DDC signal? That is what NVIDIA
used to use on consumer cards before and it is an option on Quadros  
too.


No, and although it wouldn't be too hard to drive the DDC signal  
manually on a Mac (I believe this can be done through IOKit entirely  
from userland API) getting it to sync correctly to the page-flip is  
more challenging.


My solution is clumsy but workable, which is two use the  
Stereographics Stereoenabler (http://reald-corporate.com/scientific/stereoenabler.asp 
) and then take the vesa 3-pin stereo signal (http://www.stereoscopic.org/2001/standards.html 
) and re-inject it into the VGA cable on pine 13 (the so-called ELSA  
revelator mode) via a custom-made adapter. This works well with the  
eMagin z800, which is still one of the best value 3D headsets out there.


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


Re: [osg-users] Stereo Problem

2009-05-18 Thread Philip Lamb
I can back this up. I have it direct from an engineer at Apple that  
quad-buffered stereo is operational in almost the whole range of Apple  
cards. This apparently caused some difficulty between Apple and Nvidia  
in the past, as Nvidia wanted Apple to include the feature to drive  
sales of the high-end Quadro cards, and now stereo-in-a-window is only  
enabled on Quadro cards.


The caveat with using quad-buffered mode is that Apple's machines  
don't include any means of signalling the shutter glasses or stereo  
goggles, so you're back to using something like the Stereographics  
blue-line detector box to perform the signal extraction.


Regards,
Phil.

On 18/05/2009, at 9:27 PM, Jan Ciger wrote:



Thomas Hogarth wrote:

Hi Peted

Liked your info on Quadbuffered opengl and stereo modes. I have one
interesting point to add. I recently brought a MacBook with an Nvidia
9400m graphics card. This card 'does' support quadbuffered opengl and
seemingly so do all recent Macs using Geforce graphics cards.


Do you have some source to back this up? Did you try if it actually
works? You can do that even without glasses - if the mode is
broken/unsupported you get an OpenGL error about unsupported visual.


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


[osg-users] VRML plugin

2009-05-15 Thread Philip Lamb

Hi all,

Given that the VRML plugin is a bit of work to compile due to the  
dependence on a very old version of OpenVRML, I've built a binary  
packages of OpenVRML-0.14.3 for Win32 Visual Studio .NET 2003 and  
Visual Studio 2005, and Mac OS X 10.4 32-bit universal.


The binaries are here for your pleasure:
http://www.artoolworks.com/dist/openvrml/0.14.3/

I also note that previous discussion about why the VRML plugin  
couldn't be updated to a newer version of OpenVRML centred on the  
boost dependency. I'm sure that thats much less of an issue now that  
we have boost binaries for most Linux distros, plus Windows and Mac.

http://www.boostpro.com/download
http://pdb.finkproject.org/pdb/browse.php?summary=boost

Of course, the bigger issue with the VRML plugin is that it doesn't  
support any sort of animation. OpenVRML 0.14.3 supports animation  
including animated textures. Does anyone here have a good knowledge of  
the VRML, good enough to add support for importing VRML animations  
from OpenVRML nodes?


Regards,

Philip Lamb



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


[osg-users] Animated textures

2009-05-15 Thread Philip Lamb

Hi all,

I have a request from a user for support for animated textures in an  
OSG model. They're doing their modelling in 3DS Max and exporting to  
OSG via the 3DS exported plugin, to native .osg format.


1) Is it straightforward to use animated textures in OSG (for example  
in VRML, one can specify an mpeg file as a texture and animation just  
works)?
2) If yes, is there a straightforward workflow from modelling tools to  
OSG to include animated textures? Post-processing of exported files is  
also fine.


Regards

Philip Lamb



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


[osg-users] Animation in COLLADA files supported?

2009-05-15 Thread Philip Lamb

Hi all,

I have a question about which plugins support files that include  
animations. I have experimented with the COLLADA plugin, but it  
appears that as of OSG 2.8.1-RC3 and COLLADA DOM 1.4, animation  
in .dae files doesn't carry through to the scene graph. Does anyone  
have any suggestions as to whether animations in .dae files should be  
supported (and if I'm doing something wrong)?


Can anyone else share their preferred workflow for getting animations  
out of modelling applications and into OSG? The artist I'm trying to  
support uses Cinema 4D. Our backup is exporting to VRML2 and doing a  
second rendering pass using libopenvrml-gl outside OSG.


Thanks in advance,

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