Re: [osg-users] re-initialize OpenGL objects after window

2009-10-26 Thread Robert Osfield
Hi Terry,

I'm not clear on the sequence of events in your app, but it does look
like you are probably doing a couple of things that shouldn't be
required.

First up, it is possible to release all the GL objects in the
scenegraph, flush the deleted GL objects, delete a graphics context,
and then reuse the same ContextID for a new graphics context, as all
the slots for this contextID shoudl be cleared already.  I've tested
this sequence out with using osgViewer and it works fine.

One thing to be wary of is that that you have to do the
osg::flushAllGLObjects(contextID) from the graphics thread of the
graphics context that you are about to delete as it does all the
glDelete's of the various OpenGL object ID's.  If your graphics
context has already been deleted then you'll need to call
osg::discardAllDeletedGLObjects(contextID) which will clear out all
the internal buffers storing the deleted OpenGL object id's without
attempt to do any GL calls.  Note, the osgUtil::SceneView calls just
call the osg::flush/discard.. methods.

If these internal OpenGL object buffers aren't empty when you create
your new graphics context then you'll find the OSG will try to reuse
those OpenGL objects believing them to still be relevant - and this
will cause a range of problems from crashes to missing textures.
Incrementing the ContextID for each new context will work around this
reuse as it'll force the OSG to create a new set of buffer entries for
the new context, but if you manage things correctly it won't be
necessary.

osgViewer will actually do a lot of this work for you, so I'd
recommend using it instead of digging down into the low level
SceneView.

Robert.


On Sun, Oct 25, 2009 at 10:27 PM, Terry Welsh mogu...@gmail.com wrote:
 Thanks for the suggestions Robert.  I played around with rebuilding my
 OpenGL objects some more and found that the necessary steps are:

 sceneview-releaseAllGLObjects();
 state-setContextID(state-getContextID() + 1);

 For completness's sake, I've been doing this

 scenegraphroot-releaseGLObjects();
 sceneview-releaseAllGLObjects();
 sceneview-flushAllDeletedGLObjects();
 state-setContextID(state-getContextID() + 1);

 However, the extra two steps don't appear to be necessary.

 If I only increment the context ID and do nothing else, most OpenGL
 objects get rebuilt except for the ones that were onscreen at the time
 of the context switch.  This makes it look as if all objects not
 culled on the last frame do not get re-initialized.

 So while I have a working solution, it might be fragile since I still
 don't completely understand what's going on inside OSG.  I'd like to
 hear any other thoughts you or anyone else have on this problem.
 --
 Terry Welsh  /  mogumbo 'at' gmail.com
 www.reallyslick.com  /  www.mogumbo.com



 Message: 11
 Date: Mon, 19 Oct 2009 09:01:21 +0100
 From: Robert Osfield robert.osfi...@gmail.com
 To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
 Subject: Re: [osg-users] re-initialize OpenGL objects after window
        resize
 Message-ID:
        7ffb8e9b0910190101ya523cbckd5b319842667d...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1

 Hi Terry,

 On Sun, Oct 18, 2009 at 11:12 PM, Terry Welsh mogu...@gmail.com wrote:
 I'm working on and OSG/SDL application. ?Resizing the window in Linux
 works fine, but resizing it in Windows causes the app to lose all its
 OpenGL objects. ?Is there a recommended way to re-initialize all
 OpenGL objects?

 I really wouldn't recommend using SDL for windowing...

 In your case it does sound like SDL is deleting the original graphics
 context and then recreating a completely new one on resize.

 So far I have been experimenting with SceneView's releaseAllGLObjects,
 flushAllDeletedGLObjects, and COMPILE_GLOBJECTS_AT_INIT. ?But this has
 mostly led to crashes and hasn't fixed the problem. ?Just thought I
 would take a break and see if anyone has any other suggestions

 The problem is that the scene graph itself is retaining handles to the
 original OpenGL objects and still has this around when you try to
 reapply them to a completely new graphics context, which
 unsurprisingly causes problems.  The scene graph itself doesn't know
 about the fact that you've changed the graphics context from
 underneath it so you'll need to tell it but doing a
 scenegraph-releaseGLObjects();   The SceneView methods just clean up
 already released GL objects, so you'd call these after the scenegraph
 release.

 Robert.


 ___
 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] Double transparency :O

2009-10-26 Thread Robert Osfield
Hi Rene,

To do transparency work you'll need to enable OpenGL blending via:

  stateset-setMode(GL_BLEND, osg::StateAttribute::ON);


And is typically best also tell the OSG to depth sort the geometry too
by placing it in the transparent bin:

   stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

Robert.

On Sun, Oct 25, 2009 at 10:11 PM, Rene Bokhorst episo...@home.nl wrote:
 Hi,

 I can't find the solution to my problem in any of the other posts, so I'm 
 writing in a new thread.

 For a lighting event here in Eindhoven (NL) our company is going to project 
 an image on a building using big ass beamers. It's an event which follows up 
 after Glow (http://www.gloweindhoven.nl/). Our idea was to have an 
 interactive application running between two users and the image projected by 
 the big ass beamer. We're going to capture the movements of two users that 
 are throwing paint at a building. All the user does is make the gesture, 
 and my application extrapolates the course the paint will fly at the 
 building. To round it off; a nice animated splash of paint is then projected 
 on the building.

 So I decided OSG would be a decent way to make this happen. Well... I got 
 most things in place. Someone supplied a sequence of transparent PNG images 
 for me to display. I used libpng to load them and put them in a osg::Image 
 object which I then proceed to put in an osg::ImageSequence object. I then 
 proceed to do some things I read on these forums to make the loaded PNG 
 appear as a transparent texture-on-a-quad in my view.

 And this actually works:


 Code:

 SplashContainer
 LichtStadEindhovenApp::Splash(
        osg::Vec3f position,
        osg::Vec2f scale,
        DWORD color,
        float speed,
        int nsplash)
 {
        SplashContainer cont;
        osg::ref_ptrosg::ImageSequence tmpImageSequence = new 
 osg::ImageSequence();

        for ( int k = 0 ; k  splash[nsplash]-size() ; k += 1 )
        {
                
 tmpImageSequence-addImage(LoadBitmapPNG(splash[nsplash]-operator 
 [](k).c_str(), color));
        }

        osg::ref_ptrosg::Geode geode = new osg::Geode();
        osg::ref_ptrosg::PositionAttitudeTransform texPAT = new 
 osg::PositionAttitudeTransform();

    osg::ref_ptrosg::Geometry quad1 = createTexturedQuadGeometry(
        osg::Vec3d(0.0, 0.0, 0.0),                      //Center vector
                osg::Vec3d(0.0, 0.0, scale.x()),        //Width vector
        osg::Vec3d(scale.y(), 0.0, 0.0),        //Height vector
        1.0,                                                            
 //Texture coordinates left
        1.0);                                                           
 //Texture coordinatse top

        texPAT-setPosition(position);

        mNavTrans-addChild(texPAT.get());
        texPAT-addChild(geode);
        osg::Quat q(osg::DegreesToRadians(90.0f), osg::Vec3f(0.0f, 1.0f, 
 0.0f));
        texPAT-setAttitude(q);
    geode-addDrawable(quad1.get());

        osg::ref_ptrosg::Texture2D splashTexture = new 
 osg::Texture2D(tmpImageSequence);
        osg::ref_ptrosg::StateSet stateset = quad1-getOrCreateStateSet();

    stateset-setTextureAttributeAndModes(0, splashTexture.get(), 
 osg::StateAttribute::ON);
    stateset-setMode(GL_LIGHTING, osg::StateAttribute::OFF);

        osg::ref_ptrosg::BlendFunc texture_blending_function = new 
 osg::BlendFunc(osg::BlendFunc::SRC_ALPHA, 
 osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
    stateset-setAttributeAndModes(texture_blending_function.get(), 
 osg::StateAttribute::ON);
    stateset-setMode(GL_BLEND, osg::StateAttribute::ON);

        osg::ref_ptrosg::AlphaFunc alpha_transparency_function = new 
 osg::AlphaFunc();
        
 alpha_transparency_function-setFunction(osg::AlphaFunc::ComparisonFunction::ALWAYS,
  0.5);
        stateset-setAttributeAndModes(alpha_transparency_function.get(), 
 osg::StateAttribute::ON );

        stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

        quad1-setStateSet(stateset.get());

        cont.geode = geode;
        cont.imgseq = tmpImageSequence;
        cont.pos = texPAT;
        cont.f_incr = speed;
        cont.f_time = 0.0f;
        if ( nsplash == 1 || nsplash == 2 )
                cont.bSaveLastFrame = false;
        else
                cont.bSaveLastFrame = true;

        printf(ptr count 1: %d\n, tmpImageSequence-referenceCount());
        m_vecSplashes.push_back(cont);
        printf(ptr count 2: %d\n, 
 m_vecSplashes[m_vecSplashes.size()-1].imgseq-referenceCount());

        nThrown += 1;

        return cont;
 }




 My problem is is that I also want this quad to be 70% transparent. So that 
 when a new quad is placed in front of it, a little bit of the image farther 
 away remains visible.

 I've read several posts all of which say I should add this piece of code 
 somewhere.


 Code:

        osg::Material* mat = 
 (osg::Material*)stateset-getAttribute(osg::StateAttribute::MATERIAL);
        if ( !mat )
                mat = new 

Re: [osg-users] Question about possible changes between 2.6 and 2.8.2

2009-10-26 Thread Robert Osfield
Hi Peter,

For most users moving from 2.6 to 2.8.2 should simply be a case of
rebuilding the OSG and your app,  typically no code or link changes
should be required. It looks to me link your app isn't linking to the
core OSG library for some reason, so go check what you app is linking
against and make sure all the correct libs are in the right places
w.r.t project files.

Robert.

On Mon, Oct 26, 2009 at 2:19 AM, Peter Bear th3fly...@gmail.com wrote:
 Hi,
 I'm working with a project right now, and it was using 2.6, and it was 
 compiling fine until I implemented the shadow code using osgShadow, however I 
 seem to have fixed the link errors from shadows by updating the OSG Libraries 
 to 2.8.2 from 2.6, however now I get these linker errors:


 Code:
WindowManagerViewerNode.obj : error LNK2001: unresolved external symbol 
public: virtual class osg::Switch const * __thiscall 
osg::Node::asSwitch(void)const  (?asswi...@node@osg@@ubepbvswi...@2@XZ)
 3Control.obj : error LNK2001: unresolved external symbol public: virtual 
 class osg::Switch const * __thiscall osg::Node::asSwitch(void)const  
 (?asswi...@node@osg@@ubepbvswi...@2@XZ)
 3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Switch const * __thiscall 
 osg::Node::asSwitch(void)const  (?asswi...@node@osg@@ubepbvswi...@2@XZ)
 3WindowManager.obj : error LNK2001: unresolved external symbol public: 
 virtual class osg::Switch const * __thiscall osg::Node::asSwitch(void)const  
 (?asswi...@node@osg@@ubepbvswi...@2@XZ)
 3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Switch const * __thiscall 
 osg::Node::asSwitch(void)const  (?asswi...@node@osg@@ubepbvswi...@2@XZ)
 3WindowManagerViewerNode.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
 (?asswi...@node@osg@@uaepavswi...@2@XZ)
 3Control.obj : error LNK2001: unresolved external symbol public: virtual 
 class osg::Switch * __thiscall osg::Node::asSwitch(void) 
 (?asswi...@node@osg@@uaepavswi...@2@XZ)
 3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
 (?asswi...@node@osg@@uaepavswi...@2@XZ)
 3WindowManager.obj : error LNK2019: unresolved external symbol public: 
 virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
 (?asswi...@node@osg@@uaepavswi...@2@XZ) referenced in function public: 
 virtual bool __thiscall csp::wf::WindowManager::onClick(int,int) 
 (?oncl...@windowmanager@w...@csp@@uae_...@z)
 3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
 (?asswi...@node@osg@@uaepavswi...@2@XZ)
 3WindowManagerViewerNode.obj : error LNK2019: unresolved external symbol 
 public: virtual class osg::Geode const * __thiscall 
 osg::Node::asGeode(void)const  (?asge...@node@osg@@ubepbvge...@2@XZ) 
 referenced in function public: __thiscall 
 csp::wf::WindowManagerViewerNode::WindowManagerViewerNode(int,int) 
 (??0windowmanagerviewern...@wf@csp@@q...@hh@Z)
 3Control.obj : error LNK2001: unresolved external symbol public: virtual 
 class osg::Geode const * __thiscall osg::Node::asGeode(void)const  
 (?asge...@node@osg@@ubepbvge...@2@XZ)
 3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Geode const * __thiscall 
 osg::Node::asGeode(void)const  (?asge...@node@osg@@ubepbvge...@2@XZ)
 3WindowManager.obj : error LNK2001: unresolved external symbol public: 
 virtual class osg::Geode const * __thiscall osg::Node::asGeode(void)const  
 (?asge...@node@osg@@ubepbvge...@2@XZ)
 3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Geode const * __thiscall 
 osg::Node::asGeode(void)const  (?asge...@node@osg@@ubepbvge...@2@XZ)
 3WindowManagerViewerNode.obj : error LNK2019: unresolved external symbol 
 public: virtual class osg::Geode * __thiscall osg::Node::asGeode(void) 
 (?asge...@node@osg@@uaepavge...@2@XZ) referenced in function public: 
 __thiscall osg::ref_ptrclass osg::Group::~ref_ptrclass osg::Group(void) 
 (??1?$ref_...@vgroup@osg@@@osg@@q...@xz)
 3Control.obj : error LNK2001: unresolved external symbol public: virtual 
 class osg::Geode * __thiscall osg::Node::asGeode(void) 
 (?asge...@node@osg@@uaepavge...@2@XZ)
 3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Geode * __thiscall osg::Node::asGeode(void) 
 (?asge...@node@osg@@uaepavge...@2@XZ)
 3WindowManager.obj : error LNK2001: unresolved external symbol public: 
 virtual class osg::Geode * __thiscall osg::Node::asGeode(void) 
 (?asge...@node@osg@@uaepavge...@2@XZ)
 3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
 public: virtual class osg::Geode * __thiscall osg::Node::asGeode(void) 
 (?asge...@node@osg@@uaepavge...@2@XZ)
 

[osg-users] Vacancy in Fort Worth, Texas.

2009-10-26 Thread Robert Osfield
Hi All,

A recruiter from Comforce Information Technologies, Inc. has asked me
if I could pass on details of full time vacancy at Comforce.  Details
are:

* Url: http://www.comforce.com
* Contact: Martha Couch mco...@comforce.com
* Duration: Full-time
* First posted: 26th October 2009

Desired qualification/experience:

* Bachelor Degree or high or equivalent technical expertise
through self-study
* 4 plus years of related job experience
* Fluent in C++ and OOD programming on Linux and/or Windows
* Experience with all phases of software development, testing and delivery
* Experience with real-time graphics APIs such as OpenGL,
Performer or OpenSceneGraph
* Experience developing real-time or time-critical applications. Familiar
* with open source software development tools and processes
* Excellent problem solving skills
* Ability to work in a fast-paced environment
* Experience with military or commercial Simulators used for
training is a plus
* Experience with 3D modeling and terrain generation tolls such as
3D Studio, MPI Creator and Terrex (Presagis TVP) is a plus
Cross-platform development experience is a plus Some experience with
embedded RDBMS is a plus
* Experience with customer support is a plus

I've also posted this info on the JobOffers page:

http://www.openscenegraph.org/projects/osg/wiki/Community/JobOffers

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


Re: [osg-users] Double transparency :O

2009-10-26 Thread Rene Bokhorst
Hi,

I have done that :)

it's in the code above, it still doesn't work.

Thank you!

Cheers,
Rene

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





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


Re: [osg-users] Double transparency :O

2009-10-26 Thread J.P. Delport

Hi,

instead of attaching a material, just check what colours the 
createTexturedQuadGeometry assigns to the quad. I think if you modify 
the alpha there it should work. OSG by default uses GL_MODULATE to get 
the final colour from the quad colours and the texture colours. Make 
sure blending is on for all the transparent geometry you draw (quad and 
whatever you are drawing over it later).


jp

Rene Bokhorst wrote:

Hi,

I can't find the solution to my problem in any of the other posts, so I'm 
writing in a new thread.

For a lighting event here in Eindhoven (NL) our company is going to project an image on a 
building using big ass beamers. It's an event which follows up after Glow 
(http://www.gloweindhoven.nl/). Our idea was to have an interactive application running 
between two users and the image projected by the big ass beamer. We're going to capture 
the movements of two users that are throwing paint at a building. All the 
user does is make the gesture, and my application extrapolates the course the paint will 
fly at the building. To round it off; a nice animated splash of paint is then projected 
on the building.

So I decided OSG would be a decent way to make this happen. Well... I got most 
things in place. Someone supplied a sequence of transparent PNG images for me 
to display. I used libpng to load them and put them in a osg::Image object 
which I then proceed to put in an osg::ImageSequence object. I then proceed to 
do some things I read on these forums to make the loaded PNG appear as a 
transparent texture-on-a-quad in my view.

And this actually works:


Code:

SplashContainer
LichtStadEindhovenApp::Splash(
osg::Vec3f position,
osg::Vec2f scale,
DWORD color,
float speed,
int nsplash)
{
SplashContainer cont;
osg::ref_ptrosg::ImageSequence tmpImageSequence = new 
osg::ImageSequence();

for ( int k = 0 ; k  splash[nsplash]-size() ; k += 1 )
{

tmpImageSequence-addImage(LoadBitmapPNG(splash[nsplash]-operator 
[](k).c_str(), color));
}

osg::ref_ptrosg::Geode geode = new osg::Geode();
osg::ref_ptrosg::PositionAttitudeTransform texPAT = new 
osg::PositionAttitudeTransform();

osg::ref_ptrosg::Geometry quad1 = createTexturedQuadGeometry(
osg::Vec3d(0.0, 0.0, 0.0),  //Center vector
osg::Vec3d(0.0, 0.0, scale.x()),//Width vector
osg::Vec3d(scale.y(), 0.0, 0.0),//Height vector
1.0,
//Texture coordinates left
1.0);   
//Texture coordinatse top

texPAT-setPosition(position);

mNavTrans-addChild(texPAT.get());
texPAT-addChild(geode);
osg::Quat q(osg::DegreesToRadians(90.0f), osg::Vec3f(0.0f, 1.0f, 0.0f));
texPAT-setAttitude(q);
geode-addDrawable(quad1.get());

osg::ref_ptrosg::Texture2D splashTexture = new 
osg::Texture2D(tmpImageSequence);
osg::ref_ptrosg::StateSet stateset = quad1-getOrCreateStateSet();

stateset-setTextureAttributeAndModes(0, splashTexture.get(), 
osg::StateAttribute::ON);
stateset-setMode(GL_LIGHTING, osg::StateAttribute::OFF);

osg::ref_ptrosg::BlendFunc texture_blending_function = new 
osg::BlendFunc(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
stateset-setAttributeAndModes(texture_blending_function.get(), 
osg::StateAttribute::ON);
stateset-setMode(GL_BLEND, osg::StateAttribute::ON);

osg::ref_ptrosg::AlphaFunc alpha_transparency_function = new 
osg::AlphaFunc();

alpha_transparency_function-setFunction(osg::AlphaFunc::ComparisonFunction::ALWAYS,
 0.5);
stateset-setAttributeAndModes(alpha_transparency_function.get(), 
osg::StateAttribute::ON );

stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

quad1-setStateSet(stateset.get());

cont.geode = geode;
cont.imgseq = tmpImageSequence;
cont.pos = texPAT;
cont.f_incr = speed;
cont.f_time = 0.0f;
if ( nsplash == 1 || nsplash == 2 )
cont.bSaveLastFrame = false;
else
cont.bSaveLastFrame = true;

printf(ptr count 1: %d\n, tmpImageSequence-referenceCount());
m_vecSplashes.push_back(cont);
printf(ptr count 2: %d\n, 
m_vecSplashes[m_vecSplashes.size()-1].imgseq-referenceCount());

nThrown += 1;

return cont;
}




My problem is is that I also want this quad to be 70% transparent. So that when 
a new quad is placed in front of it, a little bit of the image farther away 
remains visible.

I've read several posts all of which say I should add this piece of code 
somewhere.


Code:

osg::Material* mat = 
(osg::Material*)stateset-getAttribute(osg::StateAttribute::MATERIAL);
if ( !mat )
mat = new osg::Material();
  

Re: [osg-users] how restart AnimationPathHandler at start position

2009-10-26 Thread Felix Ilbring
Thanks Rafa,

that sounds like it would solve the problem. 
real big thanks for the fast reply

Felix

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





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


[osg-users] Rotating models with respect to CoordinateSystemNode / EllipsoidModel

2009-10-26 Thread Michael Weber
Hi,

I have a moving model located in a CoordinateSystemNode with a default 
EllipsoidModel. The goal is that the model is rotated into the direction which 
it is moving. My current code looks like this:


Code:
osg::Matrixd ModelPositionCallback::calculatePositionMatrix(
   const osg::EllipsoidModel* ellipsoid,
   const osg::Vec3d newPosition, 
   const osg::Vec3d oldPosition)
{
   osg::Vec3d up = ellipsoid-computeLocalUpVector(newPosition.x(), 
newPosition.y(), newPosition.z());
   osg::Vec3d forward = newPosition - oldPosition;
   forward.normalize();

   osg::Quat rotation;
   rotation.makeRotate(up, forward);

   osg::Matrixd matrix;
   matrix.makeTranslate(newPosition);
   matrix.preMultRotate(rotation);

   return matrix;
}



The problem is, that the rotation obviously depends on the model's position 
within the CoordinateSystemNode / EllipsoidModel, hence the model doesn't head 
in the right direction right now. It is probably pretty simple to do -- but 
I've searched the forum and googled for this but I still have no clue on how to 
solve this... any ideas?

Thank you!

Cheers,
Michael

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





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


[osg-users] osgAnimation::ReaderWriter Bug on Linux ?

2009-10-26 Thread pp
We noticed a Bug in osgAnimation of the stable osg release 2.8.2, and 
only on Linux ( Ubuntu 9.04 ), which does not occur on Windows with 
Visual Studio 2005.
When writing out an osgAnimation programm to a osg file, the process 
stops before writing keyframe data:


Node {
nodeMask 0x
cullingActive TRUE
UpdateCallbacks {
  osgAnimation::BasicAnimationManager {
num_animations 1
osgAnimation::Animation {
  name myTestanimation
  num_channels 1
  Channel {
name position
target whatever
Keyframes Vec3 2 {

In Debug Mode we figured out, that the problem comes from 
src/osgplugins/osganimation/ReaderWriter.cpp  Line 273, 274, pointer kk 
points to adresse 0x0 after dynamic_cast


osgAnimation::Vec3KeyframeContainer* kk = 
dynamic_castosgAnimation::Vec3KeyframeContainer*(kf);
fw.indent()  key   (*kk)[k].getTime()  
(*kk)[k].getValue()  std::endl;


Source Code Attached

Cheers, searching for the Pivot of my Soul, PP !!!
/*  -*-c++-*- 
 *  Copyright (C) 2008 Cedric Pinson morni...@plopbyte.net
 *
 * This library is open source and may be redistributed and/or modified under  
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * OpenSceneGraph Public License for more details.
*/

#include iostream
#include osg/Geometry
#include osg/Shape
#include osg/ShapeDrawable
#include osgViewer/Viewer
#include osgDB/FileUtils
#include osgDB/WriteFile
#include osgDB/ReadFile
#include osgGA/TrackballManipulator
#include osg/MatrixTransform
#include osg/Material
#include osgAnimation/Sampler
#include osgAnimation/BasicAnimationManager
#include osgAnimation/Animation




int main( int , char** )
{
   //create node
   osg::Node* testNode = new osg::Node(); //you can also use osg::Group or osg::MatrixTransform here

   //create animationmanager (= updatecallback)
   osgAnimation::BasicAnimationManager* testanimationManager = new osgAnimation::BasicAnimationManager();

   //create animation for this updatecallback
   osgAnimation::Animation* testAnimation = new osgAnimation::Animation();
   testAnimation-setName(myTestanimation);

   //create channel for this animation
   osgAnimation::Vec3LinearChannel* testchannel = new osgAnimation::Vec3LinearChannel; //we are not using Vec3CubicBezier because this cannot be written to file. maybe it is not specified in writer.
   testchannel-setTargetName(whatever);
   testchannel-setName(position); //the name must be a certain keyword like position otherwise it does not work
   //get keys and fill them with some data --- WARNING: IF you add no keys, programm will crash when calling testAnimation-addChannel(testchannel);
   osgAnimation::Vec3KeyframeContainer* keys = testchannel-getOrCreateSampler()-getOrCreateKeyframeContainer();
   keys-push_back(osgAnimation::Vec3Keyframe(0, osg::Vec3(0,0,0))); //first frame
   keys-push_back(osgAnimation::Vec3Keyframe(2, osg::Vec3(1,1,0))); //second frame

   // now add channel to animation
   testAnimation-addChannel(testchannel);
   //add animation to updatecallback
   testanimationManager-registerAnimation(testAnimation);
   //add updatecallback (=animationmanager) to node
   testNode-addUpdateCallback(testanimationManager);


   //in the end write all data to a file
   osgDB::writeNodeFile(*testNode, testNode.osg);
}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Mike Fried
Hi,

yes cmake build the makefile and with mingw-make.exe i build up the *.dll's, 
but now i search the dae plugin for the COLLADA files. The makefile build the 
dll's but where i can find the plugin or more specifically how is the name for 
that plugin?


Thank you!

Cheers,
Mike

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





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


Re: [osg-users] osgAnimation::ReaderWriter Bug on Linux ?

2009-10-26 Thread Cedric Pinson
Hi pp,

Did you notice the same behavior with the current svn version ? There
are a lot of fixed bug since the 2.8.xx about osgAnimation

Cheers,
Cedric

-- 
+33 659 598 614  Cedric Pinson mailto:cedric.pin...@plopbyte.net
http://www.plopbyte.net


On Mon, 2009-10-26 at 11:08 +0100, p...@graphics.cs.uni-sb.de wrote:
 We noticed a Bug in osgAnimation of the stable osg release 2.8.2, and 
 only on Linux ( Ubuntu 9.04 ), which does not occur on Windows with 
 Visual Studio 2005.
 When writing out an osgAnimation programm to a osg file, the process 
 stops before writing keyframe data:
 
 Node {
  nodeMask 0x
  cullingActive TRUE
  UpdateCallbacks {
osgAnimation::BasicAnimationManager {
  num_animations 1
  osgAnimation::Animation {
name myTestanimation
num_channels 1
Channel {
  name position
  target whatever
  Keyframes Vec3 2 {
 
 In Debug Mode we figured out, that the problem comes from 
 src/osgplugins/osganimation/ReaderWriter.cpp  Line 273, 274, pointer kk 
 points to adresse 0x0 after dynamic_cast
 
 osgAnimation::Vec3KeyframeContainer* kk = 
 dynamic_castosgAnimation::Vec3KeyframeContainer*(kf);
 fw.indent()  key   (*kk)[k].getTime()  
 (*kk)[k].getValue()  std::endl;
 
 Source Code Attached
 
 Cheers, searching for the Pivot of my Soul, PP !!!
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cleaning out Community/JobOffers -- osg

2009-10-26 Thread David Callu
Hi Roland


BTW, I see my job request is still on JobRequests wiki
pagehttp://www.openscenegraph.org/projects/osg/wiki/Community/JobRequests

I create an account on the trac and login to remove it,
but I haven't WIKI_MODIFY permission (don't know why).

Can you remove my job request please ?
Or fix my permission if you can ?
Or anyone can help me ?


David Callu


2009/10/26 Chris 'Xenon' Hanson xe...@alphapixel.com

 Roland Smeenk wrote:
  Done.
  I added the some of the rules for the jobs page in the past. Typically
 companies don't take the effort to remove jobs when filled so I don't take
 the effort to contact them and remove the jobs when they are old enough. If
 it's not OK they can always restore the data from the page history.

   Thanks Roland!

  Roland

 --
 Chris 'Xenon' Hanson, omo sanza lettere  Xenon
 AlphaPixel.com
 PixelSense Landsat processing now available!
 http://www.alphapixel.com/demos/
 There is no Truth. There is only Perception. To Perceive is to Exist. -
 Xen
 ___
 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] Cleaning out Community/JobOffers -- osg

2009-10-26 Thread Roland Smeenk
Please, contact Jose Luis Hidalgo to let him update your Wiki permissions.

--
Roland

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





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


[osg-users] Video as background

2009-10-26 Thread Nectarios Pelekanos
Hi,

I am very new with osg and I am trying to develop an AR application, is there 
any example for using Video at the bckground of the scene? Any other help is 
also welcome

Thank you!

Cheers,
Nectarios

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





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


Re: [osg-users] Cleaning out Community/JobOffers -- osg

2009-10-26 Thread David Callu
ok

Thanks Roland

David

2009/10/26 Roland Smeenk roland.sme...@tno.nl

 Please, contact Jose Luis Hidalgo to let him update your Wiki permissions.

 --
 Roland

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





 ___
 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] Improving multisampled FBO

2009-10-26 Thread Wojciech Lewandowski

Hi Paul,

I hope Robert also reads this ;-)

I compiled your code. Everything seems fine. I agree that 
setImplicitBuffers() or even setImplicitBufferAttachments() would be more 
self explanatory. I would also like to have one more (global) level of 
control where I would be able to set defaults for _renderBuffersMask  
_resolveBuffersMask for all cameras. I guess Robert saw a need for this as 
well, when he proposed to extend DisplaySettings for this purpose. It could 
be useful for already existing code like osgShadow shadow map techniques. By 
zeroing _RenderBuffersMask we could make these techniques more efficient, as 
most of the shadow map cameras does not need to use COLOR_ATTACHMENTS.


Extrapolating Robert  sugesstion (I am trying to guess how he would tackle 
this) I would add _implicitBufferAttachmentsRenderMask  
_implicitBufferAttchmentsResolveMask flags and corresponding setters and 
getters to DisplaySettings structure. I would also initilize them to 
defaults you had set up for the camera in your submission: ie 
USE_COLOR_BUFFER | USE_DEPTH_BUFFER.  In the Camera class I would add one 
more enum value USE_DISPLAY_SETTINGS_MASK and would make it a default for 
the Camera. This flag would mean that Camera honors flags set in associted 
DisplaySettings. So it would be possible to setup defaults for all cameras 
by simply changing masks in DisplaySettings instance. And it would be easy 
to override global defaults with the flags and methods you added when 
creating a camera. Would this work for you ?


I will prepare and submit a code with these modifications if you accept 
general direction.


Cheers,
Wojtek Lewandowski



- Original Message - 
From: Paul Martz pma...@skew-matrix.com

To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Sent: Saturday, October 24, 2009 10:38 PM
Subject: Re: [osg-users] Improving multisampled FBO



Wojciech Lewandowski wrote:
 Hi Paul,

 Thank You. I like your solution. I cannot test it now,  will do it on
 monday and let you know how it went.

Have a good weekend. :-)

I'm starting to think a better name for this entry point would be 
setImplicitBuffers(), as that's what it really does: it lets the app tell 
OSG what buffer attachments to create implicitly.


But take a look when you have time and give me your thoughts, I'm open to 
suggestions.


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466

___
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] runtime bug when loading obj model in OpenSceneGraph 2.8.2

2009-10-26 Thread Ulrich Hertlein

Hi Dat,

On 23/10/09 5:26 PM, tien dat wrote:

Dear Ulrich,
Could you tell me more about how to specify that option? Can I specify
it while using osgviewer.exe or I have to rebuild osgviewer.exe with
the option?


Unfortunately you can't (at the moment) set this option externally or internally, because 
the .obj loader doesn't pass the options object along.


Even if you could it would only avoid loading the same image over and over again.  It will 
not solve the massively duplicated state/material that the model has.


Either the modelling is done very inefficiently in the 3D application or whatever exporter 
is used messes things up.


If you absolutely have to use osgviewer (rather than your own app) I'd actually write a 
script to optimise the .obj and .mtl files by removing duplicate materials.


What you might also want to do is to remove the 'map_Ka' (ambient texture map) statements 
since they are not used with the standard OpenGL paths (but are still loaded).


Cheers,
/ulrich


On Fri, Oct 23, 2009 at 5:02 AM, Ulrich Hertleinu.hertl...@sandbox.de  wrote:

On 23/10/09 10:58 AM, Ulrich Hertlein wrote:


On 22/10/09 9:40 PM, tien dat wrote:


I have a model in obj format and want to load the model into
OpenSceneGraph. When there is no texture, OpenSceneGraph can load the
model fine. But when I use the model with texture, OpenSceneGraph
allocates a huge amount of memory and crashes. I think it's a runtime
bug and would like to know how to fix it. Please find some pictures


Not really a bug, I'd say you're running out of memory.

- try to reduce the image sizes.
- a lot of materials reference the same image. I don't think the obj
loader caches this which means you're loading that image over and over
again. Use osgDB::Options to specify caching of images.


Oh, and you seem to have pretty much one material per drawable.  This will
absolutely kill your performance.  Have a look at the .mtl file, you'll
notice that there are heaps of materials that have identical properties.

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


Re: [osg-users] osgAnimation::ReaderWriter Bug on Linux ?

2009-10-26 Thread pp

Cedric Pinson wrote:

Hi pp,

Did you notice the same behavior with the current svn version ? There
are a lot of fixed bug since the 2.8.xx about osgAnimation

Cheers,
Cedric
  

Hi, the current hg version does not have this bug.
Problem is that we are supposed to use the stable releases only.
Anyway, thx.

Cheers, searching for the Pivot of my Soul, PP !!!
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgAnimation::ReaderWriter Bug on Linux ?

2009-10-26 Thread Cedric Pinson
Hi pp,

If you have a fix maybe it could have its place in a new release of the
2.8.x branch. I read Paul would like to make a new release.

Cheers,
Cedric

-- 
+33 659 598 614  Cedric Pinson mailto:cedric.pin...@plopbyte.net
http://www.plopbyte.net


On Mon, 2009-10-26 at 13:48 +0100, p...@graphics.cs.uni-sb.de wrote:
 Cedric Pinson wrote:
  Hi pp,
 
  Did you notice the same behavior with the current svn version ? There
  are a lot of fixed bug since the 2.8.xx about osgAnimation
 
  Cheers,
  Cedric

 Hi, the current hg version does not have this bug.
 Problem is that we are supposed to use the stable releases only.
 Anyway, thx.
 
 Cheers, searching for the Pivot of my Soul, PP !!!
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Ümit Uzun
Hi Mike,

You need to open up cmake again and assign collada dependency columns to
collada 3rdParty folder which is in your system, And after generated
solution again you need to build up osg dae plugin. I mean you simply build
fully OSG again. That's all I think.

Regards.

Ümit Uzun


2009/10/26 Mike Fried mike.fr...@gmx.de

 Hi,

 yes cmake build the makefile and with mingw-make.exe i build up the
 *.dll's, but now i search the dae plugin for the COLLADA files. The makefile
 build the dll's but where i can find the plugin or more specifically how is
 the name for that plugin?


 Thank you!

 Cheers,
 Mike

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





 ___
 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] Video as background

2009-10-26 Thread Ümit Uzun
Hi Nectarious;

There isn't video example or application in osg release except osgmovie as I
know. But if you want to use Augmented Reality with osg I strongly advice
you to look at osgART(http://www.artoolworks.com/community/osgart/) This is
what look for.

Regards.

Ümit Uzun


2009/10/26 Nectarios Pelekanos nectarios.peleka...@armes-tech.com

 Hi,

 I am very new with osg and I am trying to develop an AR application, is
 there any example for using Video at the bckground of the scene? Any other
 help is also welcome

 Thank you!

 Cheers,
 Nectarios

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





 ___
 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] Improving multisampled FBO

2009-10-26 Thread Robert Osfield
Hi Wojtek and Paul.

On Mon, Oct 26, 2009 at 12:06 PM, Wojciech Lewandowski
lewandow...@ai.com.pl wrote:
 I hope Robert also reads this ;-)

Sorry missed it completely :-)

 I will prepare and submit a code with these modifications if you accept
 general direction.

I believe you guessed correctly what type of approach I'd take w.r.t
setting global defaults in DisplaySettings.  The suggestion of
ImplicitBufferAttachment also sounds like it conveys an appropriate
meaning.  So you have my thumbs up for making the mods and submitting
these.  I haven't had a chance to review Paul original yet, so I'm
just do a best guess from this thread and the previous ones.

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


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Mike Fried
Hi,

if the new build was OK, how i can find the dae plugin? Is the osgdb_dae the 
name of the dae plugin?


Thank you!

Cheers,
Mike

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





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


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Mike Fried

mikefried wrote:
 Hi,
 
 if the new build was OK, where  can i find the dae plugin? Is the osgdb_dae 
 the name of the dae plugin?
 
 
 Thank you!
 
 Cheers,
 Mike


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





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


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Ümit Uzun
Yes, osgdb_dae plugin for collada :D

Ümit Uzun


2009/10/26 Mike Fried mike.fr...@gmx.de


 mikefried wrote:
  Hi,
 
  if the new build was OK, where  can i find the dae plugin? Is the
 osgdb_dae the name of the dae plugin?
 
 
  Thank you!
 
  Cheers,
  Mike


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





 ___
 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] Vacancy in Fort Worth, Texas.

2009-10-26 Thread Chris 'Xenon' Hanson
  I'm reasonably sure this is for New York Air Brake, who I have been working 
with all
summer. They are a decent outfit to work for. Their project is a 3D train 
driving simulator.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Side-effect with two cameras sharing Viewports

2009-10-26 Thread Himar Carmona
Hi,

   i noticed a strange (buggy?) behavior with two cameras sharing the
same Viewport instance with version 2.9.5 (Windows XP).

   Situation: Main camera, adding a slave camera (with addSlave) and
setting the slave camera's viewport with this line of code:

  slaveCamera-setViewport( viewer.getCamera()-getViewport());

   The objective is to have two cameras rendering to the whole window

   Problem: If the viewer is in window mode (setUpViewInWindow) and
the window is resized, the viewport updates incorrectly. In my case,
it doesn't fill the window.

   I suspect this behaviour is due to
GraphicsContext::resizedImplementation having updated the viewport
twice, since it is share between the two cameras.

   Workaround: Don't share the viewport between two cameras :)

   slaveCamera-setViewport(new
osg::Viewport(*(viewer.getCamera()-getViewport(;

   or

   osg::Viewport* vp = viewer.getCamera()-getViewport();
   slaveCamera-setViewport(vp-x(), vp-y(), vp-width(),
vp-height());

If this use isn't as expected (i use it wrong) or if
resizedImplementation need to be fixed, then i could try do the job
and submit a patch for this odd behaviour. At least i could modify
Camera and add some comments regarding this behavior. But first i
wanted to know experts advise about it.


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


Re: [osg-users] Improving multisampled FBO

2009-10-26 Thread Paul Martz

Wojciech Lewandowski wrote:
I will prepare and submit a code with these modifications if you accept 
general direction.


Sounds good to me, please go ahead and make these changes (including the 
entry point name change). And thanks for the help with this.

   -Paul

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


Re: [osg-users] how restart AnimationPathHandler at start position

2009-10-26 Thread Felix Ilbring
Hi Again,

somehow it is still not working. The setStartTick method has no effect at all. 
i tried to set the startTick in _view, _timer and both, nothing worked.

As i want to start the animation from the beginning, each time i press the play 
button, i do the folowing:


Code:

bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter ea, 
osgGA::GUIActionAdapter aa)
{
_view = dynamic_castosgViewer::View*(aa);


// The user has requested to BEGIN playback.
if (!_currentlyPlaying)
{
_view-setStartTick(_timer-tick());
_timer-setStartTick(_timer-tick());
std::ifstream in(_filename.c_str());
_animPath.~ref_ptr();
_animPathManipulator.~ref_ptr();
_animPath = new osg::AnimationPath();
_animPath-read(in);
_animPathManipulator = new 
osgGA::AnimationPathManipulator(_animPath.get());
_animPathManipulator-home(ea,aa);

// If we successfully found our _filename file, set it and keep 
a copy
// around of the original MatrixManipulator to restore later.
if (_animPathManipulator.valid()  
_animPathManipulator-valid())
{
_oldManipulator = _view-getCameraManipulator();
_view-setCameraManipulator(_animPathManipulator.get());
_currentlyPlaying = true;
}
}

// The user has requested to STOP playback.
else
{
// Restore the old manipulator if necessary and stop playback.
_view-setCameraManipulator(_oldManipulator);
_currentlyPlaying = false;
_oldManipulator = 0;
}
}




I guess, i am doing something wrong. Please give me some support.

thanks
Felix[/code]

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





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


Re: [osg-users] Video as background

2009-10-26 Thread Himar Carmona
  Hi,

   if your system is Vista, run it as Administrator, perhaps you don't
have permissions to write to Program Files. Try copy it manually there
if you can. Also be sure no app is using the dll.

2009/10/26 Nectarios Pelekanos nectarios.peleka...@armes-tech.com:
 Thanks,

 I have tried to install osgART but I had  a problem during the final step of 
 the installation. I dont' know if someone can help but I tried to install 
 osgART 2.0 RC3 and after the Cmake and the buid install I get the following 
 error

 file INSTALL cannot copy file
  C:/Users/.../osgART_2.0_RC3/build/lib/Debug/osg55-osgART_debug.dll
  to C:/Program Files/osgART/bin/osg55-osgART_debug.dll.

 Any suggestions??

 Thank you!

 Cheers,
 Nectarios

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





 ___
 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] Side-effect with two cameras sharing Viewports

2009-10-26 Thread Robert Osfield
Hi Himar,

The assumption that I made with osg::Camera is that each camera would
have it's own Viewport, sharing a Viewport between Camera's is not
something I've considered so code like the GraphicsContext code for
passing up updates to resizing of the window will probably be resizing
the viewport onces for each Camera.

Solutions would be to clone the viewport for your slave camera, or
modify the resize code so it doesn't resize viewports that it's
already resized.  The later is really the best solution as it would
remove the assumption of one Viewport per Camera.  I'm currently got
my head down on OpenGL ES work so if you could dive into the
appropriate code and provide a solution it'd appreciated :-)

Cheers,
Robert.

On Mon, Oct 26, 2009 at 1:45 PM, Himar Carmona himarcarm...@gmail.com wrote:
 Hi,

   i noticed a strange (buggy?) behavior with two cameras sharing the
 same Viewport instance with version 2.9.5 (Windows XP).

   Situation: Main camera, adding a slave camera (with addSlave) and
 setting the slave camera's viewport with this line of code:

          slaveCamera-setViewport( viewer.getCamera()-getViewport());

   The objective is to have two cameras rendering to the whole window

   Problem: If the viewer is in window mode (setUpViewInWindow) and
 the window is resized, the viewport updates incorrectly. In my case,
 it doesn't fill the window.

   I suspect this behaviour is due to
 GraphicsContext::resizedImplementation having updated the viewport
 twice, since it is share between the two cameras.

   Workaround: Don't share the viewport between two cameras :)

           slaveCamera-setViewport(new
 osg::Viewport(*(viewer.getCamera()-getViewport(;

       or

           osg::Viewport* vp = viewer.getCamera()-getViewport();
           slaveCamera-setViewport(vp-x(), vp-y(), vp-width(),
 vp-height());

    If this use isn't as expected (i use it wrong) or if
 resizedImplementation need to be fixed, then i could try do the job
 and submit a patch for this odd behaviour. At least i could modify
 Camera and add some comments regarding this behavior. But first i
 wanted to know experts advise about it.


   Best regards,
 Himar.
 ___
 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] runtime bug when loading obj model in OpenSceneGraph 2.8.2

2009-10-26 Thread Nguyen Tien Dat
Dear Ulrich,
Sorry for my stupidity, but I don't know anything about modifying
models. The model is actually created in VRML, and I use 3DS Max to
export it to obj format. So if you can, please tell me a bit more
about how to optimize the model:
- How can you remove duplicate materials (if you can tell me how to do
it by hand, that helps too)
- What else can I do to load the model in an efficient way?
Thank you very much,
Dat

On Mon, Oct 26, 2009 at 7:33 AM, Ulrich Hertlein u.hertl...@sandbox.de wrote:
 Hi Dat,

 On 23/10/09 5:26 PM, tien dat wrote:

 Dear Ulrich,
 Could you tell me more about how to specify that option? Can I specify
 it while using osgviewer.exe or I have to rebuild osgviewer.exe with
 the option?

 Unfortunately you can't (at the moment) set this option externally or
 internally, because the .obj loader doesn't pass the options object along.

 Even if you could it would only avoid loading the same image over and over
 again.  It will not solve the massively duplicated state/material that the
 model has.

 Either the modelling is done very inefficiently in the 3D application or
 whatever exporter is used messes things up.

 If you absolutely have to use osgviewer (rather than your own app) I'd
 actually write a script to optimise the .obj and .mtl files by removing
 duplicate materials.

 What you might also want to do is to remove the 'map_Ka' (ambient texture
 map) statements since they are not used with the standard OpenGL paths (but
 are still loaded).

 Cheers,
 /ulrich

 On Fri, Oct 23, 2009 at 5:02 AM, Ulrich Hertleinu.hertl...@sandbox.de
  wrote:

 On 23/10/09 10:58 AM, Ulrich Hertlein wrote:

 On 22/10/09 9:40 PM, tien dat wrote:

 I have a model in obj format and want to load the model into
 OpenSceneGraph. When there is no texture, OpenSceneGraph can load the
 model fine. But when I use the model with texture, OpenSceneGraph
 allocates a huge amount of memory and crashes. I think it's a runtime
 bug and would like to know how to fix it. Please find some pictures

 Not really a bug, I'd say you're running out of memory.

 - try to reduce the image sizes.
 - a lot of materials reference the same image. I don't think the obj
 loader caches this which means you're loading that image over and over
 again. Use osgDB::Options to specify caching of images.

 Oh, and you seem to have pretty much one material per drawable.  This
 will
 absolutely kill your performance.  Have a look at the .mtl file, you'll
 notice that there are heaps of materials that have identical properties.

 ___
 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] How i build the osg dll on WINXP

2009-10-26 Thread Mike Fried
Hi,

Why i see my email adress???


Thank you!

Cheers,
Mike

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





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


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Jean-Sébastien Guay

Hi Mike,


In my attachment is a screenshot from the build error (the build with dae)

but the osgdb_dae was build ???
can i use this plugin now even though the build error??


It seems you're building the wrappers. If you don't need them, don't 
build them (disable BUILD_OSG_WRAPPERS in CMake and regenerate your 
solution).


The build error is another story, I haven't built the wrappers in ages 
so I can't help there but someone who builds them will need to fix it. 
But in your case, I doubt you need them, so just disable them.


Then, yes, you can use the plugin (either directly or after doing an 
INSTALL).


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


Re: [osg-users] dynamically adding a view

2009-10-26 Thread John Morris
Hi,

The stopThreading and startThreading methods were exactly what I needed.  My 
code is working great now.

Thank you!
John

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





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


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Mike Fried

Skylark wrote:
 Hi Mike,
 
 
  In my attachment is a screenshot from the build error (the build with dae)
  
  but the osgdb_dae was build ???
  can i use this plugin now even though the build error??
  
 
 It seems you're building the wrappers. If you don't need them, don't 
 build them (disable BUILD_OSG_WRAPPERS in CMake and regenerate your 
 solution).
 
 The build error is another story, I haven't built the wrappers in ages 
 so I can't help there but someone who builds them will need to fix it. 
 But in your case, I doubt you need them, so just disable them.
 
 Then, yes, you can use the plugin (either directly or after doing an 
 INSTALL).
 
 Hope this helps,
 
 J-S
 -- 
 __
 Jean-Sebastien Guay
 http://www.cm-labs.com/
 http://whitestar02.webhop.org/
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum




Hi Skylark

thanks for your answer

if i take the cmd in WinXP and i test c:/.../osgviewer.exe test1.dae (enter)
the viewer can't find a jpg plugin

where i can find jpg dll's for a new OSG Build 

by mike

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





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


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Jean-Sébastien Guay

Hi Mike,


if i take the cmd in WinXP and i test c:/.../osgviewer.exe test1.dae (enter)
the viewer can't find a jpg plugin

where i can find jpg dll's for a new OSG Build 


Please search for answers to questions like that, it's basic info you 
need to be able to build OSG from scratch. On the wiki in particular you 
can find a section called Platform Specifics, in which there's a page 
called Visual Studio where you'll find info. I won't repeat all the 
info found there in this post...


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


Re: [osg-users] Double transparency :O

2009-10-26 Thread Rene Bokhorst
Hi,

This has worked perfectly. Thank you very much!

Thank you!

Cheers,
Rene

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





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


Re: [osg-users] [build] How i build the osg dll on WINXP

2009-10-26 Thread Mike Fried
Thank you!

Cheers,
Mike

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





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


Re: [osg-users] Improving multisampled FBO

2009-10-26 Thread Wojciech Lewandowski
Hi Paul,

Thanks. I am almost done with modifications for DisplaySettings. I have to test 
it and will submit the code tomorrow. But I have one question regarding your 
changes in RenderStage.cpp. I have understood that RenderMask defines implicit 
attachments for main FBO and ResolveMask defines implicit attachments for 
multisample FBO. I noticed that when multisampling is not used both masks are 
actually set to RenderMask value (RenderStage.cpp line 352). But when 
multisampling is on, it looks like masks are swapped because ResolveMask is 
used to force implicit buffers for main FBO and RenderMask is used to force  
implicit buffers for MS FBO. Its bit surprising to me, but maybe its correct ?

For example: see excerpt from RenderStage lines 440-455 

if (!depthAttached)

{

if( resolveBuffersMask  osg::Camera::USE_DEPTH_BUFFER )

{

fbo-setAttachment(osg::Camera::DEPTH_BUFFER, 

osg::FrameBufferAttachment(new osg::RenderBuffer(width, height, 
GL_DEPTH_COMPONENT24)));

depthAttached = true;

}

if (fbo_multisample.valid() 

( renderBuffersMask  osg::Camera::USE_DEPTH_BUFFER ) )

{

fbo_multisample-setAttachment(osg::Camera::DEPTH_BUFFER, 

osg::FrameBufferAttachment(new osg::RenderBuffer(width, height, 
GL_DEPTH_COMPONENT24, samples, colorSamples)));

depthAttached = true;

}

}

Cheers,
Wojtek Lewandowski

- Original Message - 
From: Paul Martz pma...@skew-matrix.com
To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Sent: Monday, October 26, 2009 2:56 PM
Subject: Re: [osg-users] Improving multisampled FBO


 Wojciech Lewandowski wrote:
 I will prepare and submit a code with these modifications if you accept 
 general direction.
 
 Sounds good to me, please go ahead and make these changes (including the 
 entry point name change). And thanks for the help with this.
-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] Mac OS X mouse handling Warp pointer.

2009-10-26 Thread David Guthrie
Hi,

I'm having an issue which with warping the mouse pointer on Mac OS X that is 
generally expected, but behaves differently than on other platforms.

That is, when you warp the mouse pointer using either of the warp functions 
(GraphicsWindowCarbon uses CGDisplayMoveCursorToPoint), all input is frozen for 
0.25 seconds.  When trying to implement a mouse look style mouse movement, the 
normal method is to move the mouse pointer back to the center of the screen 
even frame on other platforms, but doing this blocks all input in OS X for a 
quarter second unless I call

CGSetLocalEventsSuppressionInterval(0);

The other method is to disassociate the mouse pointer position from the mouse 
movement, but that solution won't work with the current osx window classes 
because they track the mouse position, not its movement.

I was going to submit a change adding the above line to GraphicsWindowCarbon, 
and possible the Cocoa version, but it appears that this function is deprecated 
in 10.6 in favor of

CGEventSourceSetLocalEventsSuppressionInterval(...);


So, to conclude,  I have two points to this post.

1.  I think we should make this the default behavior so it will work the same 
across platforms, unless there is another solution

2.  I don't know how to implement this using the other function because I'm not 
an expert on event sources, and I haven't really been able to make it work.  
Does anyone more skilled than I in this area know how to make this work or do 
you recommend I just use the older function for now?



Thank you!

Cheers,
David

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





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


Re: [osg-users] Call for Increased Participation

2009-10-26 Thread Montgomery, John T.
Hello All,

I too would be happy to help at the spelling bee level.
It would be a good way to learn.

Robert knows how much I don't know ;-)


:-)
John Montgomery
Medi-CAL Unit, CLSM, Polwarth Bldg., Forresterhill, Aberdeen AB25 2ZD.
Mob: 07592453757
Web: http://www.abdn.ac.uk/JMVP/ | http://www.abdn.ac.uk/clsm/  |  
http://www.thevigils.co.uk/


The University of Aberdeen is a charity registered in Scotland, No SC013683.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Call for Increased Participation

2009-10-26 Thread Chris 'Xenon' Hanson
Montgomery, John T. wrote:
 Hello All,
 I too would be happy to help at the spelling bee level.
 It would be a good way to learn.

  That'd be great. I know several of us others can participate -- would you be 
willing to
organize it?

  Basically, make a wiki page listing all of the source/header files (like an 
ls -lR) and
as each one is assigned we can note next to it the initials of who is working 
on it.
When it's done being checked, we can append (done) to that line.

  I'm thinking we should do this to the most-current branch to prevent a huge 
branch-merge
mess, but I don't want to step on Robert's OGL-ES work.

  Robert, should we wait to being this process, or is it safe to perform it 
now? Would it
be desirable to set up John with SVN trunk access to commit spelling-only 
changes? I don't
know your comfort level with that, or John's experience level with SVN, so I'm 
just
shooting out in the dark on that.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] layering of text and geometry in a 2.5D setup

2009-10-26 Thread stefan nortd
Thanks Paul, Jeremy,

So after some contemplation I am pretty sure I want to use the painter's 
layering. The reason is that if  for example I want to rotate a panel in 
front of another one I don't want it to intersect with panals behind it. I 
could use orthographic projection and dynamically change the z distances
 based on bounding box but this just seems overkill if I could just disable 
depth testing.  I just want it 2.5D--looking 3D but layering 2D. 

So I tried forcing the osgText in a the opaque render bin with the following
 but without much luck.

 mytextstateset-setRenderBinDetails(0, RenderBin, 
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);

Is there something else I need to do other than that?  If I understand 
correctly there are two default bins--RenderBin and DepthSortedBin. 
Former is sorted based on the binNum, latter based on the depth.

I guess what I don't understand is how does the binNum realate to the 
other items in the default bin. I know they are rendered in the order they 
are added to the scene. How to they relate to the binNum? Still a bit 
confused. 

Will read some more of the osg source code but let me know if you guy 
know what I am doing wrong.

Thank you!

Cheers,
stefan


stefan hechenberger

http://linear.nortd.com

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





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


Re: [osg-users] Call for Increased Participation

2009-10-26 Thread Montgomery, John T.
Hi Chris,

Yes, I'll give it a go.  I'll start by reading up on wiki formatting whilst we 
wait for Robert's thoughts.
Do you have a suggestion which page the Spellcheck Listing should be linked 
from?

:-)
John Montgomery, Glassel, Scotland.



-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' 
Hanson
Sent: 26 October 2009 17:51
To: OpenSceneGraph Users
Subject: Re: [osg-users] Call for Increased Participation

Montgomery, John T. wrote:
 Hello All,
 I too would be happy to help at the spelling bee level.
 It would be a good way to learn.

  That'd be great. I know several of us others can participate -- would you be 
willing to
organize it?

  Basically, make a wiki page listing all of the source/header files (like an 
ls -lR) and
as each one is assigned we can note next to it the initials of who is working 
on it.
When it's done being checked, we can append (done) to that line.

  I'm thinking we should do this to the most-current branch to prevent a huge 
branch-merge
mess, but I don't want to step on Robert's OGL-ES work.

  Robert, should we wait to being this process, or is it safe to perform it 
now? Would it
be desirable to set up John with SVN trunk access to commit spelling-only 
changes? I don't
know your comfort level with that, or John's experience level with SVN, so I'm 
just
shooting out in the dark on that.

--
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


The University of Aberdeen is a charity registered in Scotland, No SC013683.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Call for Increased Participation

2009-10-26 Thread Chris 'Xenon' Hanson
Montgomery, John T. wrote:
 Yes, I'll give it a go.  I'll start by reading up on wiki formatting whilst 
 we wait for Robert's thoughts.
 Do you have a suggestion which page the Spellcheck Listing should be linked 
 from?

  There already is one, from the last time I orchestrated one of these:
http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/SpellingBee

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Call for Increased Participation

2009-10-26 Thread Montgomery, John T.
That's fine, thanks.

:-)
John Montgomery, Glassel, Scotland.


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' 
Hanson
Sent: 26 October 2009 18:49
To: OpenSceneGraph Users
Subject: Re: [osg-users] Call for Increased Participation

Montgomery, John T. wrote:
 Yes, I'll give it a go.  I'll start by reading up on wiki formatting whilst 
 we wait for Robert's thoughts.
 Do you have a suggestion which page the Spellcheck Listing should be linked 
 from?

  There already is one, from the last time I orchestrated one of these:
http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/SpellingBee

--
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


The University of Aberdeen is a charity registered in Scotland, No SC013683.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] layering of text and geometry in a 2.5D setup

2009-10-26 Thread Paul Martz
Are you setting this StateSet on the parent Group or Geode above all 
your Text? If so, it should work. If it's not working, then this should 
be investigated and resolved. I'd advise creating a very simple scene 
graph that appears to reproduce the behavior, and stepping through the 
CullVisitor to find out why it is changing RenderBins even though a 
parent scene graph has set the override bit.


(For more information on RenderBins in general, search the mail list. I 
almost hate to advise this, as the info is scattered all over the place, 
and you'll need to do a lot of digging and reading. But it has been 
discussed multiple times in the past, and I don't have the cycles to 
regurgitate the salient info at the moment.)


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466



stefan nortd wrote:

Thanks Paul, Jeremy,

So after some contemplation I am pretty sure I want to use the painter's 
layering. The reason is that if  for example I want to rotate a panel in 
front of another one I don't want it to intersect with panals behind it. I 
could use orthographic projection and dynamically change the z distances
 based on bounding box but this just seems overkill if I could just disable 
depth testing.  I just want it 2.5D--looking 3D but layering 2D. 


So I tried forcing the osgText in a the opaque render bin with the following
 but without much luck.

 mytextstateset-setRenderBinDetails(0, RenderBin, 
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);

Is there something else I need to do other than that?  If I understand 
correctly there are two default bins--RenderBin and DepthSortedBin. 
Former is sorted based on the binNum, latter based on the depth.


I guess what I don't understand is how does the binNum realate to the 
other items in the default bin. I know they are rendered in the order they 
are added to the scene. How to they relate to the binNum? Still a bit 
confused. 

Will read some more of the osg source code but let me know if you guy 
know what I am doing wrong.


Thank you!

Cheers,
stefan


stefan hechenberger

http://linear.nortd.com

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





___
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] Help with Run-Time error using osgdem

2009-10-26 Thread Jacob Armstrong

All,

I'm currently receiving a Windows Run-Time Error when running osgdem.exe in an 
attempt to build a pretty large database (approx. 132GB or so). I have a 
process that generates 1879 bitmaps of various resolutions (up to 2 meters per 
pixel) and stores a bunch of data for each bitmap in a text file which I then 
pass into osgdem.exe using the -ARGS_FILE option. Some of the data contained in 
the file for each bitmap is the lower-left-hand coordinate of the file (as --xt 
and --yt), the size in meters per pixel (as --xx and --yy), and the path to the 
filename (as -t). I've done this before successfully with smaller samples of 
the visual database I'm generating, but now I'm using the entire DB and at a 
minimum of 4 meters per pixel. Are there any suggestions as to why I might be 
getting a run-time error here? Any help is appreciated!


Thanks,
Jake
  
_
Windows 7: Simplify your PC. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen1:102009___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Question about possible changes between 2.6 and 2.8.2

2009-10-26 Thread Peter Bear

robertosfield wrote:
 Hi Peter,
 
 For most users moving from 2.6 to 2.8.2 should simply be a case of
 rebuilding the OSG and your app,  typically no code or link changes
 should be required. It looks to me link your app isn't linking to the
 core OSG library for some reason, so go check what you app is linking
 against and make sure all the correct libs are in the right places
 w.r.t project files.
 
 Robert.
 
 On Mon, Oct 26, 2009 at 2:19 AM, Peter Bear  wrote:
 
  Hi,
  I'm working with a project right now, and it was using 2.6, and it was 
  compiling fine until I implemented the shadow code using osgShadow, however 
  I seem to have fixed the link errors from shadows by updating the OSG 
  Libraries to 2.8.2 from 2.6, however now I get these linker errors:
  
  
  Code:
  
   WindowManagerViewerNode.obj : error LNK2001: unresolved external symbol 
   public: virtual class osg::Switch const * __thiscall 
   osg::Node::asSwitch(void)const  (?asswi...@node@osg@@ubepbvswi...@2@XZ)
   
  3Control.obj : error LNK2001: unresolved external symbol public: virtual 
  class osg::Switch const * __thiscall osg::Node::asSwitch(void)const  
  (?asswi...@node@osg@@ubepbvswi...@2@XZ)
  3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Switch const * __thiscall 
  osg::Node::asSwitch(void)const  (?asswi...@node@osg@@ubepbvswi...@2@XZ)
  3WindowManager.obj : error LNK2001: unresolved external symbol public: 
  virtual class osg::Switch const * __thiscall osg::Node::asSwitch(void)const 
   (?asswi...@node@osg@@ubepbvswi...@2@XZ)
  3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Switch const * __thiscall 
  osg::Node::asSwitch(void)const  (?asswi...@node@osg@@ubepbvswi...@2@XZ)
  3WindowManagerViewerNode.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
  (?asswi...@node@osg@@uaepavswi...@2@XZ)
  3Control.obj : error LNK2001: unresolved external symbol public: virtual 
  class osg::Switch * __thiscall osg::Node::asSwitch(void) 
  (?asswi...@node@osg@@uaepavswi...@2@XZ)
  3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
  (?asswi...@node@osg@@uaepavswi...@2@XZ)
  3WindowManager.obj : error LNK2019: unresolved external symbol public: 
  virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
  (?asswi...@node@osg@@uaepavswi...@2@XZ) referenced in function public: 
  virtual bool __thiscall csp::wf::WindowManager::onClick(int,int) 
  (?oncl...@windowmanager@w...@csp@@uae_...@z)
  3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Switch * __thiscall osg::Node::asSwitch(void) 
  (?asswi...@node@osg@@uaepavswi...@2@XZ)
  3WindowManagerViewerNode.obj : error LNK2019: unresolved external symbol 
  public: virtual class osg::Geode const * __thiscall 
  osg::Node::asGeode(void)const  (?asge...@node@osg@@ubepbvge...@2@XZ) 
  referenced in function public: __thiscall 
  csp::wf::WindowManagerViewerNode::WindowManagerViewerNode(int,int) 
  (??0windowmanagerviewern...@wf@csp@@q...@hh@Z)
  3Control.obj : error LNK2001: unresolved external symbol public: virtual 
  class osg::Geode const * __thiscall osg::Node::asGeode(void)const  
  (?asge...@node@osg@@ubepbvge...@2@XZ)
  3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Geode const * __thiscall 
  osg::Node::asGeode(void)const  (?asge...@node@osg@@ubepbvge...@2@XZ)
  3WindowManager.obj : error LNK2001: unresolved external symbol public: 
  virtual class osg::Geode const * __thiscall osg::Node::asGeode(void)const  
  (?asge...@node@osg@@ubepbvge...@2@XZ)
  3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Geode const * __thiscall 
  osg::Node::asGeode(void)const  (?asge...@node@osg@@ubepbvge...@2@XZ)
  3WindowManagerViewerNode.obj : error LNK2019: unresolved external symbol 
  public: virtual class osg::Geode * __thiscall osg::Node::asGeode(void) 
  (?asge...@node@osg@@uaepavge...@2@XZ) referenced in function public: 
  __thiscall osg::ref_ptrclass osg::Group::~ref_ptrclass 
  osg::Group(void) (??1?$ref_...@vgroup@osg@@@osg@@q...@xz)
  3Control.obj : error LNK2001: unresolved external symbol public: virtual 
  class osg::Geode * __thiscall osg::Node::asGeode(void) 
  (?asge...@node@osg@@uaepavge...@2@XZ)
  3ControlGeometryBuilder.obj : error LNK2001: unresolved external symbol 
  public: virtual class osg::Geode * __thiscall osg::Node::asGeode(void) 
  (?asge...@node@osg@@uaepavge...@2@XZ)
  3WindowManager.obj : error LNK2001: unresolved external symbol public: 
  virtual class osg::Geode * __thiscall osg::Node::asGeode(void) 
  (?asge...@node@osg@@uaepavge...@2@XZ)
  3WindowManagerViewer.obj : error LNK2001: unresolved external symbol 
  public: virtual 

Re: [osg-users] layering of text and geometry in a 2.5D setup

2009-10-26 Thread Paul Martz
Better idea -- Write out the subgraph that draws your text -- and also 
contains the override render bin bit, to a .osg file and post here or 
email me. I'll take a look to see if the render bin details are set 
correctly.

   -Paul



Paul Martz wrote:
Are you setting this StateSet on the parent Group or Geode above all 
your Text? If so, it should work. If it's not working, then this should 
be investigated and resolved. I'd advise creating a very simple scene 
graph that appears to reproduce the behavior, and stepping through the 
CullVisitor to find out why it is changing RenderBins even though a 
parent scene graph has set the override bit.


(For more information on RenderBins in general, search the mail list. I 
almost hate to advise this, as the info is scattered all over the place, 
and you'll need to do a lot of digging and reading. But it has been 
discussed multiple times in the past, and I don't have the cycles to 
regurgitate the salient info at the moment.)


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466



stefan nortd wrote:

Thanks Paul, Jeremy,

So after some contemplation I am pretty sure I want to use the 
painter's layering. The reason is that if  for example I want to 
rotate a panel in front of another one I don't want it to intersect 
with panals behind it. I could use orthographic projection and 
dynamically change the z distances
 based on bounding box but this just seems overkill if I could just 
disable depth testing.  I just want it 2.5D--looking 3D but layering 2D.
So I tried forcing the osgText in a the opaque render bin with the 
following

 but without much luck.

 mytextstateset-setRenderBinDetails(0, RenderBin, 
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);


Is there something else I need to do other than that?  If I understand 
correctly there are two default bins--RenderBin and 
DepthSortedBin. Former is sorted based on the binNum, latter based 
on the depth.


I guess what I don't understand is how does the binNum realate to the 
other items in the default bin. I know they are rendered in the order 
they are added to the scene. How to they relate to the binNum? Still a 
bit confused.
Will read some more of the osg source code but let me know if you guy 
know what I am doing wrong.


Thank you!

Cheers,
stefan


stefan hechenberger

http://linear.nortd.com

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





___
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] Improving multisampled FBO

2009-10-26 Thread Paul Martz

Yes it's quite confusing.

The RenderStage code was already set up as follows: If doing MSFBO (and 
therefore need two FBOs, one for multisampled rendering and one for 
final resolve), then configure fbo as the resolve FBO, and When done 
configuring, swap it into _resolveFbo (see line 554). But, if not 
using MSFBO, then fbo is just the render fbo.


(I did not write this code, I am just the poor sap left to maintain it. :-)

My code handles this correctly: If using MSFBO, then resolveBuffersMask 
is the value set by the app for the resolve buffers. But if not using 
MSFBO, then resolveBuffersMask is the value set by the app for render 
buffers. In both cases, resolveBuffersMask is used to configure fbo.


So, my code is correct, in light of how the existing code is written.

I attempted to explain this briefly in code comments at lines 349-351 
and also lines 377-378, but perhaps to clarify things further, you could 
paste this email from me as a code comment about line 442.


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466



Wojciech Lewandowski wrote:

Hi Paul,
 
Thanks. I am almost done with modifications for DisplaySettings. I have 
to test it and will submit the code tomorrow. But I have one question 
regarding your changes in RenderStage.cpp. I have understood that 
RenderMask defines implicit attachments for main FBO and ResolveMask 
defines implicit attachments for multisample FBO. I noticed that 
when multisampling is not used both masks are actually set to RenderMask 
value (RenderStage.cpp line 352). But when multisampling is on, it looks 
like masks are swapped because ResolveMask is used to force implicit 
buffers for main FBO and RenderMask is used to force  implicit buffers 
for MS FBO. Its bit surprising to me, but maybe its correct ?
 
For example: see excerpt from RenderStage lines 440-455 
 


if (!depthAttached)

{

if( resolveBuffersMask  osg::Camera::USE_DEPTH_BUFFER )

{

fbo-setAttachment(osg::Camera::DEPTH_BUFFER,

osg::FrameBufferAttachment(new osg::RenderBuffer(width, 
height, GL_DEPTH_COMPONENT24)));


depthAttached = true;

}

if (fbo_multisample.valid() 

( renderBuffersMask  osg::Camera::USE_DEPTH_BUFFER ) )

{

fbo_multisample-setAttachment(osg::Camera::DEPTH_BUFFER,

osg::FrameBufferAttachment(new osg::RenderBuffer(width, 
height, GL_DEPTH_COMPONENT24, samples, colorSamples)));


depthAttached = true;

}

}

Cheers,
Wojtek Lewandowski
 
- Original Message -

From: Paul Martz pma...@skew-matrix.com mailto:pma...@skew-matrix.com
To: OpenSceneGraph Users osg-users@lists.openscenegraph.org 
mailto:osg-users@lists.openscenegraph.org

Sent: Monday, October 26, 2009 2:56 PM
Subject: Re: [osg-users] Improving multisampled FBO

  Wojciech Lewandowski wrote:
  I will prepare and submit a code with these modifications if you accept
  general direction.
 
  Sounds good to me, please go ahead and make these changes (including the
  entry point name change). And thanks for the help with this.
 -Paul
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org 
mailto: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] osgslice Error Message

2009-10-26 Thread Vincent Gadoury
Hi,

The osgslice example fails on windows vista on revision 10691. 
GraphicsContext::setWindowingSystemInterface is never called because the static 
object RegisterWindowingSystemInterfaceProxy 
createWindowingSystemInterfaceProxy in GraphicsWindowWin32.cpp is never 
instantiated.

Even if not using the viewer, the example is supposed to link with 
osgViewerd.lib, but it seems the global object is just wiped out for a reason I 
can't explain... Creating a dummy viewer at the end of the main function force 
the instantiation of the global object and lets the example run.

Tested in debug on Visual Studio 2005. This really looks like a compiler 
issue...

regards,

Vincent Gadoury

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





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


Re: [osg-users] layering of text and geometry in a 2.5D setup

2009-10-26 Thread stefan nortd
How does this look like ...


Code:

PositionAttitudeTransform {
  UniqueID PositionAttitudeTransform_15
  nodeMask 0x
  cullingActive TRUE
  StateSet {
UniqueID StateSet_16
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
GL_LIGHTING OFF
GL_DEPTH_TEST OFF
  }
  referenceFrame RELATIVE
  position 0 0 0
  attitude 0 0 0 1
  scale 1 1 1
  pivotPoint 0 0 0
  num_children 1
  Geode {
UniqueID Geode_17
UserData {
  NodeCallback {
name MyTextfield
  }
}
nodeMask 0x
cullingActive TRUE
StateSet {
  UniqueID StateSet_18
  rendering_hint DEFAULT_BIN
  renderBinMode OVERRIDE
  binNumber 1
  binName RenderBin
}
num_drawables 1
  }
}




The one drawable is the osgText. I am also :O  new to writing osg files ... 
couldn't get it to write the drawable to file.

(Paul, I am still working on the minimal example)
Thank you!

Cheers,
stefan


stefan hechenberger

http://linear.nortd.com

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





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


Re: [osg-users] Help with Run-Time error using osgdem

2009-10-26 Thread Robert Osfield
Hi Jake,

For large databases you will have to use vpbmaster to manage a
complete database build, osdem doesn't scale on it's own.

Robert.

On Mon, Oct 26, 2009 at 7:46 PM, Jacob Armstrong jaco...@hotmail.com wrote:
 All,

 I'm currently receiving a Windows Run-Time Error when running osgdem.exe in
 an attempt to build a pretty large database (approx. 132GB or so). I have a
 process that generates 1879 bitmaps of various resolutions (up to 2 meters
 per pixel) and stores a bunch of data for each bitmap in a text file which I
 then pass into osgdem.exe using the -ARGS_FILE option. Some of the data
 contained in the file for each bitmap is the lower-left-hand coordinate of
 the file (as --xt and --yt), the size in meters per pixel (as --xx and
 --yy), and the path to the filename (as -t). I've done this before
 successfully with smaller samples of the visual database I'm generating, but
 now I'm using the entire DB and at a minimum of 4 meters per pixel. Are
 there any suggestions as to why I might be getting a run-time error here?
 Any help is appreciated!

 Thanks,
 Jake

 
 Windows 7: Simplify your PC. Learn more.
 ___
 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] layering of text and geometry in a 2.5D setup

2009-10-26 Thread Paul Martz

stefan nortd wrote:
 How does this look like ...

I would put the StateSet with the override flag all the way at the 
topmost Group in your UI, above all the Text and above all the other 
geometry you're drawing with the text.


 The one drawable is the osgText. I am also :O  new to writing osg 
files ... couldn't get it to write the drawable to file.


You don't need to do anything special to get the Drawable output. The 
fact that you are not getting the Drawable output would indicate that 
OSG can't find the .osg plugin for osgText. Perhaps you have a bad install.


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466




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


Re: [osg-users] runtime bug when loading obj model in OpenSceneGraph 2.8.2

2009-10-26 Thread Nguyen Tien Dat
Hi,
So I have read about .mtl and .obj files and understood what you
meant. I created a program to optimize the model
(http://cs.uiowa.edu/~tinguyen/OptimizeMtlFiles.rar)
But the new one that I created doesn't look the same as the old one
when I don't use texture. Please click this link to download both
versions, and use osgviewer.exe to view them.
http://cs.uiowa.edu/~tinguyen/supermarket_3ds.rar
The old one has some color (again, without texture), but the new one
doesn't. So I'm wondering what's wrong.
Could any of you give me a hand?
Thanks,
Dat

On Mon, Oct 26, 2009 at 10:10 AM, Nguyen Tien Dat tienda...@gmail.com wrote:
 Dear Ulrich,
 Sorry for my stupidity, but I don't know anything about modifying
 models. The model is actually created in VRML, and I use 3DS Max to
 export it to obj format. So if you can, please tell me a bit more
 about how to optimize the model:
 - How can you remove duplicate materials (if you can tell me how to do
 it by hand, that helps too)
 - What else can I do to load the model in an efficient way?
 Thank you very much,
 Dat

 On Mon, Oct 26, 2009 at 7:33 AM, Ulrich Hertlein u.hertl...@sandbox.de 
 wrote:
 Hi Dat,

 On 23/10/09 5:26 PM, tien dat wrote:

 Dear Ulrich,
 Could you tell me more about how to specify that option? Can I specify
 it while using osgviewer.exe or I have to rebuild osgviewer.exe with
 the option?

 Unfortunately you can't (at the moment) set this option externally or
 internally, because the .obj loader doesn't pass the options object along.

 Even if you could it would only avoid loading the same image over and over
 again.  It will not solve the massively duplicated state/material that the
 model has.

 Either the modelling is done very inefficiently in the 3D application or
 whatever exporter is used messes things up.

 If you absolutely have to use osgviewer (rather than your own app) I'd
 actually write a script to optimise the .obj and .mtl files by removing
 duplicate materials.

 What you might also want to do is to remove the 'map_Ka' (ambient texture
 map) statements since they are not used with the standard OpenGL paths (but
 are still loaded).

 Cheers,
 /ulrich

 On Fri, Oct 23, 2009 at 5:02 AM, Ulrich Hertleinu.hertl...@sandbox.de
  wrote:

 On 23/10/09 10:58 AM, Ulrich Hertlein wrote:

 On 22/10/09 9:40 PM, tien dat wrote:

 I have a model in obj format and want to load the model into
 OpenSceneGraph. When there is no texture, OpenSceneGraph can load the
 model fine. But when I use the model with texture, OpenSceneGraph
 allocates a huge amount of memory and crashes. I think it's a runtime
 bug and would like to know how to fix it. Please find some pictures

 Not really a bug, I'd say you're running out of memory.

 - try to reduce the image sizes.
 - a lot of materials reference the same image. I don't think the obj
 loader caches this which means you're loading that image over and over
 again. Use osgDB::Options to specify caching of images.

 Oh, and you seem to have pretty much one material per drawable.  This
 will
 absolutely kill your performance.  Have a look at the .mtl file, you'll
 notice that there are heaps of materials that have identical properties.

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





-- 
Dat Tien Nguyen
PhD student, Computer Science Department
The University of Iowa, IA 52242
http://cs.uiowa.edu/~tinguyen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org