Re: [osg-users] Need help regarding rendering to a texture

2009-08-24 Thread J.P. Delport

Hi,

Brett Thomas Lee wrote:

Hi again thank you Mr. delport for spending your time.I have a last
and final question.  setProjectionMatrixAsOrtho() is not working in
the code.can you please tell me the reason for that please.


It is working, OSG just by default automatically computes near and far 
planes. I'm not sure it is working correctly for ortho cameras, so I 
switch it off normally.



If i set
ortho or lookat in osg is it like opengl(with z coming out) or like
osg(with y coming out)??


Like OpenGL. OSG's camera manipulators use y out, but you can change 
this if you want.


jp




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






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





--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] Need help regarding rendering to a texture

2009-08-24 Thread J.P. Delport

Hi,

just uncomment the line:
mPreRenderCamera-setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);

jp

Brett Thomas Lee wrote:

Hi,

Here I attached another quad at some distance but Im unable to see the 
projection of one quad over the other.I am unable figure the reason why I dont 
see the projection of one quad over the other.Mr.delport can you please figure 
the reason why its happening like this.Thanks in advance.

Thanks  Regards,
brett.

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







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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


[osg-users] adding new node/object to globe node (osgEarth)

2009-08-24 Thread miroslav karpis
Hi,

please can you help me with this? I have a node globe (from osgEarth). All I 
want now is add a new model (for example helicopter) and place it on top of the 
surface of the globe and set camera so that it points like from the helicopter 
model.

I have tried MatrixTransfrom, but most probably am not using it right...

Here is what I made until now..(I'm not able to see both nodes together. only 
globe, or helicopter...)


Code:

osg::Group* root = new osg::Group();
osg::ref_ptrosg::Node globe = 
osgDB::readNodeFile(multiple_heightfields.earth);
osg::ref_ptrosg::Node heliNode = osgDB::readNodeFile(CH-146 Griffon.flt);

osg::MatrixTransform* mNavTrans = new osg::MatrixTransform();

root-addChild(globe.get());
root-addChild(mNavTrans);

double s = 100.0;

osg::Quat rotation;
osg::MatrixTransform* mModelTrans = new osg::MatrixTransform();
mModelTrans-preMult(osg::Matrix::rotate(-90.0f, 1.0f, 0.0f, 40.0f));
mModelTrans-setMatrix(osg::Matrixd::scale(s,s,s));// I have tried only with 
scale but it didn't work

mModelTrans-addChild(heliNode.get());
mNavTrans-addChild(mModelTrans);

osgUtil::Optimizer optimizer;
optimizer.optimize(root);





Thank you!

Cheers,
miroslav[code]

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





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


Re: [osg-users] question regarding attribute functor

2009-08-24 Thread Robert Osfield
Hi Tim,

On Sun, Aug 23, 2009 at 8:47 PM, Tim Allenosgfo...@tevs.eu wrote:
 What is the function  of osg::Drawable::AttributeFunctor class in osg.What 
 does it do??

It's a mechanism for getting access to drawable vertex attributes in a
generic way, i.e. decoupled from the actual Drawable subclass.  You
write your subclass of AttributeFunctor, and then pass an object of
this subclass to the drawable to call the appropriate virtual methods
using double dispatch a bit like the visitor pattern.

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


Re: [osg-users] adding new node/object to globe node (osgEarth)

2009-08-24 Thread Robert Osfield
Hi Miroslav,

I'm not sure where to start as I'm not sure what level of
understanding about the coordinate systems in play, it does look like
you are missing a few things as your transform certainly isn't
relevent to a Earth Center Earth Fixed (ECEF) coordinate system like
osgEarth sets up typically.

The best I can do is recommend you read up on the web about ECEF, and
have a look at the osgsimulation example as it places a loaded model
around a ECEF globe.

Robert.

On Mon, Aug 24, 2009 at 8:20 AM, miroslav
karpiskarpis_miros...@yahoo.com wrote:
 Hi,

 please can you help me with this? I have a node globe (from osgEarth). All I 
 want now is add a new model (for example helicopter) and place it on top of 
 the surface of the globe and set camera so that it points like from the 
 helicopter model.

 I have tried MatrixTransfrom, but most probably am not using it right...

 Here is what I made until now..(I'm not able to see both nodes together. only 
 globe, or helicopter...)


 Code:

 osg::Group* root = new osg::Group();
 osg::ref_ptrosg::Node globe = 
 osgDB::readNodeFile(multiple_heightfields.earth);
 osg::ref_ptrosg::Node heliNode = osgDB::readNodeFile(CH-146 Griffon.flt);

 osg::MatrixTransform* mNavTrans = new osg::MatrixTransform();

 root-addChild(globe.get());
 root-addChild(mNavTrans);

 double s = 100.0;

 osg::Quat rotation;
 osg::MatrixTransform* mModelTrans = new osg::MatrixTransform();
 mModelTrans-preMult(osg::Matrix::rotate(-90.0f, 1.0f, 0.0f, 40.0f));
 mModelTrans-setMatrix(osg::Matrixd::scale(s,s,s));// I have tried only with 
 scale but it didn't work

 mModelTrans-addChild(heliNode.get());
 mNavTrans-addChild(mModelTrans);

 osgUtil::Optimizer optimizer;
 optimizer.optimize(root);





 Thank you!

 Cheers,
 miroslav[code]

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





 ___
 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] FBOs without color or depth attachments/DrawBuffer/ReadBuffer

2009-08-24 Thread Wojciech Lewandowski

Hi again,

I realized there is gap in my argumentation in my former post. OSG user may 
chose to add camera-attach( MISSING_BUFFER, FORMAT) in their application, 
but OSG nodekits like osgShadow  have to be safe and prepared even for bad 
cases. So it looks like flags defining policy for forcing missing buffer 
attchments may be neccessary after all. So I must agree that adding buffer 
atttcahment flags to DisplaySetings sounds like the best approach.


Cheers,
Wojtek Lewandowski

- Original Message - 
From: Wojciech Lewandowski lewandow...@ai.com.pl

To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Sent: Friday, August 21, 2009 3:08 PM
Subject: Re: [osg-users] FBOs without color or depth 
attachments/DrawBuffer/ReadBuffer





Thanks, Robert

I tested the changes on Windows and NVidia GF 8800. osghadow -4 --lispsm 
looked correct on my system. But I understand other systems may be 
different.


I am curious if setting ShadowCamera-attach( COLOR_BUFFER,  GL_RGB ) 
would have the same effect as forcing COLOR_ATTACHMENT on ATI. I suppose 
it should. From the former discussion with J-S I come up with opinion that 
the best would be to not define OSG color/depth attachment policy but put 
the decision on application developers. If their application is run with 
troublesome drivers, programmers would explicitly attach missing buffer to 
be sure everything works on target platform. I think that adding a line: 
camera-attach( COLOR_BUFFER,  GL_RGB );  is as easy as changing 
DisplaySettings flags for FBO buffer attachment policy.


On the other hand, it will also work for me if OSG majority decides to 
introduce such FBO attachments policy and will use DisplaySettings for 
this task. I have not used .cfg files and DisplaySettings extensively yet 
(at least not under various OSes)  so I will leave question about 
DisplaySetting script format for more opinionated users ;-)


Cheers,
Wojtek

- Original Message - 
From: Robert Osfield robert.osfi...@gmail.com

To: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Sent: Friday, August 21, 2009 11:39 AM
Subject: Re: [osg-users] FBOs without color or depth 
attachments/DrawBuffer/ ReadBuffer




Hi Wojtek et. al,

I have just checked in the changes but to avoid regression on some
users systems I've temporarily reverted the disabling of the forcing
on of colour and depth buffer. But setting:

#define FORCE_COLOR_ATTACHMENT  1
#define FORCE_DEPTH_ATTACHMENT  1

At the top of src/osgUtil/RenderStage.  I say temporarily as I believe
we'll need to come up with a runtime override scheme that allows users
to set the defaults for the above at runtime, perhaps via the the
standard osg::DisplaySettings class that is used right now for various
global settings, with env vars available to customize the defaults.

It could be that we need to come up with a simple file format for
specifying these types defaults for various hardware/OS targets, and
make it possible to load this file at runtime to configure things.
This is a more general issue than just FBOs, but this FBO issue is
probably a good catlyst for getting some kind of solution.

Thoughts? Suggestions?
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 


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


[osg-users] dotosgwrapper

2009-08-24 Thread Eric Pouliquen
Hi all,

I'm trying to write a simple read/write acces to .osg files for my own class, 
using the REGISTER_DOTOSGWRAPPER macro, but nothing happens...

This is what I do:

in my IO.h:


Code:
#include MyClass.h

using namespace osgDB;

bool MyClass_readLocalData(osg::Object, osgDB::Input);
bool MyClass_writeLocalData(const osg::Object, osgDB::Output);

REGISTER_DOTOSGWRAPPER(MyClass)
(
new osgMyClass::MyClass,
MyClass,
Object Node Group MyClass,
MyClass_readLocalData,
MyClass_writeLocalData
);



and in IO.cpp:


Code:
#include IOPlanet.h

bool MyClass_readLocalData(osg::Object obj, osgDB::Input fr)
{
   std::cout  Hello in Read!  std::endl;
}

bool MyClass_writeLocalData(const osg::Object obj, osgDB::Output fout)
{
   std::cout  Hello in Write!  std::endl;
}



and the MyClass class is the simplest thing in the world:

#include iostream


Code:
namespace osgMyClass 
{

class MyClass: public osg::Group
{
public:

MyClass() { valeur = 1.0f; std::cout  Hello 
MyClass! std::endl; }
~MyClass() {}

public:

float value;
};

}



I'm generating a dll with the IO files, and I put it in the osgPlugins 
directory, but the Hello messages are never readable, trying this in the main 
of an app:


Code:
osgMyClass::MyClass* test= new osgMyClass::MyClass();

osgDB::writeNodeFile((osg::Node)*test, test.osg);
osgDB::writeObjectFile((osg::Object)*test, test2.osg);



So where is the mistake ? Does the name of the dll must be something like 
osgdb_osgMyClass ? Changing its name changes nothing... seems OSG doesn't 
find it.

I try before to read and write data using the osgPlugins scheme with :
REGISTER_OSGPLUGIN(plt, ReaderWriterPLT), and all works well. So I understand 
the process with plugins, but not with dotosgwrappers...

If someone can help me, it's seems to be a little thing missing at a little 
place :)

thanks a lot

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





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


Re: [osg-users] dotosgwrapper

2009-08-24 Thread Robert Osfield
Hi Eric,

You need to add some extra RTTI info to your custom class to enable
the .osg wrappers to fine your class.  Add:

   META_Node(osgMyClass,MyClass)

To your class definitions.  See include/osg/Group and other subclasses
of node to see this in action.

Robert.

On Mon, Aug 24, 2009 at 9:43 AM, Eric
Pouliquenepouliq...@silicon-worlds.fr wrote:
 Hi all,

 I'm trying to write a simple read/write acces to .osg files for my own class, 
 using the REGISTER_DOTOSGWRAPPER macro, but nothing happens...

 This is what I do:

 in my IO.h:


 Code:
 #include MyClass.h

 using namespace osgDB;

 bool MyClass_readLocalData(osg::Object, osgDB::Input);
 bool MyClass_writeLocalData(const osg::Object, osgDB::Output);

 REGISTER_DOTOSGWRAPPER(MyClass)
 (
    new osgMyClass::MyClass,
    MyClass,
    Object Node Group MyClass,
    MyClass_readLocalData,
    MyClass_writeLocalData
 );



 and in IO.cpp:


 Code:
 #include IOPlanet.h

 bool MyClass_readLocalData(osg::Object obj, osgDB::Input fr)
 {
   std::cout  Hello in Read!  std::endl;
 }

 bool MyClass_writeLocalData(const osg::Object obj, osgDB::Output fout)
 {
   std::cout  Hello in Write!  std::endl;
 }



 and the MyClass class is the simplest thing in the world:

 #include iostream


 Code:
 namespace osgMyClass
 {

        class MyClass: public osg::Group
        {
                public:

                        MyClass() { valeur = 1.0f; std::cout  Hello 
 MyClass! std::endl; }
                        ~MyClass() {}

                public:

                        float value;
        };

 }



 I'm generating a dll with the IO files, and I put it in the osgPlugins 
 directory, but the Hello messages are never readable, trying this in the 
 main of an app:


 Code:
 osgMyClass::MyClass* test= new osgMyClass::MyClass();

 osgDB::writeNodeFile((osg::Node)*test, test.osg);
 osgDB::writeObjectFile((osg::Object)*test, test2.osg);



 So where is the mistake ? Does the name of the dll must be something like 
 osgdb_osgMyClass ? Changing its name changes nothing... seems OSG doesn't 
 find it.

 I try before to read and write data using the osgPlugins scheme with :
 REGISTER_OSGPLUGIN(plt, ReaderWriterPLT), and all works well. So I understand 
 the process with plugins, but not with dotosgwrappers...

 If someone can help me, it's seems to be a little thing missing at a little 
 place :)

 thanks a lot

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





 ___
 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] dotosgwrapper

2009-08-24 Thread Eric Pouliquen
Hi Robert,

thanks for your answer, that works well now !

Just a little question about RegisterDotOsgWrapperProxy :
I don't really understand the first argument... A lot of examples are using a 
new on their custom class, but some of them uses NULL.

I try with both, and it works well in the two cases, but I notice (and it's 
logical indeed) that when using a new as first argument, we pass two times in 
my class constructor, but it is saved only one time.

So could you tell me the role of the new ?

Thinking about plugins and other things in OSG, maybe It could be very useful 
for community to write little HOWTO in the Wiki, isn't it ? In ever saw such 
base articles like we can see on the Ogre3D wiki. What do you think about that 
? I know we can find a lot of ressources in mailing list or forum, but maybe 
redondant methods like writing plugins, osgWrappers, doing RTT and so on could 
maybe be fixed in articles, modified by users who want to add details... i 
think this discussion has been done many and many times, so maybe nobody has 
time to write little HOWTOs or it is considered as not useful, I don't know.

Thanks for your support, saving hours of search ! :)

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





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


Re: [osg-users] dotosgwrapper

2009-08-24 Thread Robert Osfield
Hi Eric,

 So could you tell me the role of the new ?

The new provides the prototype of the class, this is than cloned
during the read process to provide the object of the appropriate type.

 Thinking about plugins and other things in OSG, maybe It could be very useful 
 for community to write little HOWTO in the Wiki, isn't it ? In ever saw such 
 base articles like we can see on the Ogre3D wiki. What do you think about 
 that ? I know we can find a lot of ressources in mailing list or forum, but 
 maybe redondant methods like writing plugins, osgWrappers, doing RTT and so 
 on could maybe be fixed in articles, modified by users who want to add 
 details... i think this discussion has been done many and many times, so 
 maybe nobody has time to write little HOWTOs or it is considered as not 
 useful, I don't know.

Feel free to write HOWTO's in the time you have available. And I'll
write HOWTO's in the time I have available after doing dev work and
support...

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


Re: [osg-users] dotosgwrapper

2009-08-24 Thread Eric Pouliquen
Ok, I'm going to study it during the reading process.

Thanks for your answers.

Hope you don't think I was saying that you should write HOWTOs, just because I 
think that you do amazing work with the support AND the dev ! 
I was just wondering why there isn't such articles, but I think I'm going to 
write some of them. Where do you think it is the best place to post it for 
comments ? Directly to you and then putting it on the website ?

Maybe I can start a topic on that to have viewpoints on subjects for HOWTOs...

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





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


Re: [osg-users] dotosgwrapper

2009-08-24 Thread Jean-Sébastien Guay

Hi Eric,


Where do you think it is the best place to post it for comments ? Directly to 
you and then putting it on the website ?
Maybe I can start a topic on that to have viewpoints on subjects for HOWTOs...


There's a reason why the main OSG web site is a wiki, it's exactly for 
this kind of evolving document. You can start a new page, post the link 
to it here and people (including Robert) can then improve it.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Textures swapping

2009-08-24 Thread Eric Pouliquen
Hi all,

I'm trying to swap textures on a node, based on event for exemple.
But let's see this simple code :


Code:
osg::Texture* tx1 = setTexture(test1.jpg);
osg::Texture* tx2 = setTexture(test2.jpg);

osg::Geode* sphereGeode = new osg::Geode;
osg::StateSet* state1 = sphereGeode1-getOrCreateStateSet();

state1-setTextureAttributeAndModes(0, tx1 );
state1-setTextureAttributeAndModes(0, tx2 );
state1-setTextureAttributeAndModes(0, tx1 );



This code crashes because modifying the content of tx1 when setting the tx2 
texture, so when re-applying tx1 in the third line, the tx1 pointer is 
corrupted!

So what is the way to manage multiple textures on the same node ? 
I don't want to use multiple textures indexes because I will probably swap on 
many and many textures...

Need I create a new StateSet per texture ?

Thanks

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





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


Re: [osg-users] adding new node/object to globe node (osgEarth)

2009-08-24 Thread Jason Beverage
Hi Miroslav,

I'd also recommend you check out the osgEarthUtil::ObjectPlacer class as it
is meant to help you position your models using lat/lon coordinates.

Thanks!

Jason

On Mon, Aug 24, 2009 at 3:54 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Miroslav,

 I'm not sure where to start as I'm not sure what level of
 understanding about the coordinate systems in play, it does look like
 you are missing a few things as your transform certainly isn't
 relevent to a Earth Center Earth Fixed (ECEF) coordinate system like
 osgEarth sets up typically.

 The best I can do is recommend you read up on the web about ECEF, and
 have a look at the osgsimulation example as it places a loaded model
 around a ECEF globe.

 Robert.

 On Mon, Aug 24, 2009 at 8:20 AM, miroslav
 karpiskarpis_miros...@yahoo.com wrote:
  Hi,
 
  please can you help me with this? I have a node globe (from osgEarth).
 All I want now is add a new model (for example helicopter) and place it on
 top of the surface of the globe and set camera so that it points like from
 the helicopter model.
 
  I have tried MatrixTransfrom, but most probably am not using it right...
 
  Here is what I made until now..(I'm not able to see both nodes together.
 only globe, or helicopter...)
 
 
  Code:
 
  osg::Group* root = new osg::Group();
  osg::ref_ptrosg::Node globe =
 osgDB::readNodeFile(multiple_heightfields.earth);
  osg::ref_ptrosg::Node heliNode = osgDB::readNodeFile(CH-146
 Griffon.flt);
 
  osg::MatrixTransform* mNavTrans = new osg::MatrixTransform();
 
  root-addChild(globe.get());
  root-addChild(mNavTrans);
 
  double s = 100.0;
 
  osg::Quat rotation;
  osg::MatrixTransform* mModelTrans = new osg::MatrixTransform();
  mModelTrans-preMult(osg::Matrix::rotate(-90.0f, 1.0f, 0.0f, 40.0f));
  mModelTrans-setMatrix(osg::Matrixd::scale(s,s,s));// I have tried only
 with scale but it didn't work
 
  mModelTrans-addChild(heliNode.get());
  mNavTrans-addChild(mModelTrans);
 
  osgUtil::Optimizer optimizer;
  optimizer.optimize(root);
 
 
 
 
 
  Thank you!
 
  Cheers,
  miroslav[code]
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=16625#16625
 
 
 
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


[osg-users] Can CMake generate mac os frameworks now?

2009-08-24 Thread Filip Wänström
Hello,
I just built osg trunk (as of today, 2009-08-24) on the mac
successfully after a series of problems with the ffmpeg plugin. I used
 Cmake to gen. regular makefiles and it works fine. (great even!)

Anyway, since I'm a mac person at heart and usually code in Xcode I
was curious if osg + xcode is a viable, first rate, option these days
so I tested to generate Xcode files from Cmake instead. By the look of
it it seems to be working but as I understand it we'll have to do with
regular .so libraries for the time being.

So, the questions:

1. can I generate an Xcode project file that will build frameworks
instead of regular .so dynamic libs?

2. A big reason for this is to get code-completion in Xcode, so if 1)
is not an option, are there other ways to get code completion for the
osg headers?

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


Re: [osg-users] Textures swapping

2009-08-24 Thread Robert Osfield
Hi Eric,

The OSG automatically reference counts objects, so when you do the
setTexture..(0, txt2) the tx1 will be unref'd automatically and if no
other references exist it'll delete - which is correct.  Your tx1
pointer is now a dangling pointer and when you assign to the stateset
it of course crashes.

The simple solution is the use ref_ptrosg::Texture instead of the C
pointer.

Robert.

On Mon, Aug 24, 2009 at 2:23 PM, Eric
Pouliquenepouliq...@silicon-worlds.fr wrote:
 Hi all,

 I'm trying to swap textures on a node, based on event for exemple.
 But let's see this simple code :


 Code:
 osg::Texture* tx1 = setTexture(test1.jpg);
 osg::Texture* tx2 = setTexture(test2.jpg);

 osg::Geode* sphereGeode = new osg::Geode;
 osg::StateSet* state1 = sphereGeode1-getOrCreateStateSet();

 state1-setTextureAttributeAndModes(0, tx1 );
 state1-setTextureAttributeAndModes(0, tx2 );
 state1-setTextureAttributeAndModes(0, tx1 );



 This code crashes because modifying the content of tx1 when setting the tx2 
 texture, so when re-applying tx1 in the third line, the tx1 pointer is 
 corrupted!

 So what is the way to manage multiple textures on the same node ?
 I don't want to use multiple textures indexes because I will probably swap on 
 many and many textures...

 Need I create a new StateSet per texture ?

 Thanks

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





 ___
 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] [vpb] Some questions about VPB and cloud of points

2009-08-24 Thread Andrea Martini
Hi to all,
i would like to create or use a software application ables to visualize a 
seaground (get from a cloud of points) 3d model inside earth 
model created by osgdem. I'm wondering if VPB, OsgEarth or osgGIS are the 
correct technologies to solve my problem.
Some questions :
1) Can i create a DEM file from a cloud of points (I have information about its 
coordinates) using osgdem?
2) How i can add the DEM file obtained from previous question (or a generic 3d 
model) to earth model created by osgdem?
3) I have created the earth model with osgdem using blu marble image from nasa 
web site. The best image resolution get from 
this website  is too far from the ground (i think that image was taken from 
about 900 km of quote). I would like to insert or ADD 3d model 
of my clouds of point (the seaground), in DEM format, and i would like to 
visualize this model only at a certain level 
(i.e. after the last level created by osgdem).
Hoping my questions could be enough clear ...

Thank you!

Cheers,
Andrea

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





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


[osg-users] Avoiding traversal on some nodes when saving in .osg

2009-08-24 Thread Eric Pouliquen
Hi all,

 I'm using the dotosgwrapper method (RegisterDotOsgWrapperProxy) on my custom 
class, which heritates of a osg::Group.

My problem is that I create a local scenegraph in my class, and my class 
instance is the local root of the scenegraph. But when I save the instance in a 
.osg file, how can I say to OSG to ignore some of the nodes in the local 
scenegraph to be saved in the file ?

For example :

My class is SuperGroup, based on osg::Group.
I create a scenegraph in the call code which is :


Code:

  SuperGroup
 |
  --
  |   |
   Node 1  Switch
 /\
   LightSourceNode 2 (test2.osg)




So when I save the SuperGroup instance in output.osg , I would like to have 
Node1, Switch, but not the LightSource and I would like to have a proxyNode of 
the Node2, but not all the osg code of the node 2 in my output.osg...

How do I manage this ?

thanks a lot

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





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


[osg-users] 0bit Stencil Buffer

2009-08-24 Thread Mathias Buhr

Hi everyone,

I'm trying to use the stencil buffer to render only parts of the final 
image through other graph-attached cameras. The app works fine on ATI 
hardware but NVIDIA fails. OpenGL reports that the stencil buffer has 
only 0 bits (which is 8 bits on ATI, via 
glGetInterv(GL_STENCIL_BUFFER_BITS) in a DrawCallback). I have tested 
this on various linux boxes (Ubuntu 9.04, Fedora 11) with recent 
hardware and recent drivers.
I'm pretty sure that a stencil buffer is available on this hardware 
because OSG seems to be able to utilize it (stereo-mode in 
osgUtil::SceneView uses stenciling and works fine). I'm pretty sure I've 
missed something. Is there anything special to do to get or enable a 
stencil buffer on Nvidia?


Thanks for your help and your time!
Nice greetings
Mathias Buhr
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shdows Problem o vista

2009-08-24 Thread Chris 'Xenon' Hanson
Danny Lesnik wrote:
 Hi,
 I'm using Visual Studio 2008 with osg 2.8.1. I have vary strange problem with 
 with shadows on my scene. On vista all shadows are moved chaoticaly (see 
 attached pictures ). However on XP everything is OK and I can see my shadows 
 casted by camera lights.

  Are they the same computer but different dual-booting OSes or are they 
different computers?

  It sounds to me like a deficient graphics card or driver on the Vista end of 
things. you
didn't state what card/driver you were using so it's hard to say.

-- 
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] Write UpdateCallbacks into an osg file ?

2009-08-24 Thread pp


The .osg file format is extensible via a plugin mechanism. See, for 
example, osgdb_osgText.


In order for standard osgviewer to load a file that contains custom 
callbacks, you will need to distribute a dynamic library containing 
your custom callback class, and also a dynamic plugin to support .osg 
I/O for your custom class, so two dynamic libraries total.


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




Hi Paul, thx for your answer.
I was not talking about a custom Callback ( unless any Callback is 
custom ). The Tutorial I was talking about is from your book, Listing 3-3.
By now I found out, that I need to use osgDB::writeObjectFile instead of 
writeNodeFile, which writes UpdateCallbacks{} into an osg file.
The Node.cpp file from osgPlugins/osg/ has an output fw.writeObject 
entry which takes the pointer to an UpdateCallback as argument.
I assume, that an UpdateCallback and derived knows what to write into 
the osg file UpdateCallback code block.
Which method of an Object ( UpdateCallback ) fills this  code block, and 
how ?


The purpose is to write osg files for osgAnimation and osganimationviwer.

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


Re: [osg-users] adding new node/object to globe node (osgEarth)

2009-08-24 Thread miroslav karpis
Hi All,   thank VERY much for the reply...will definitely come back with 
questions   ;) 

Cheers,
miroslav

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





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


[osg-users] nodemask or switch

2009-08-24 Thread Martin Beckett
New in a series of embarrassing newbie questions :-* 

When do I need a switch node if I have a nodemask?

Suppose I have a number of components to a model (wings/body/wheels etc) these 
are all children of a single parent node and each have a nodemask allowing them 
to be switched on/off individually.
The same functionality is achieved by inserting a switch node and setting the 
value for each child.

Why - is there extra functionality from the switch, is there a limitation of 
the nodemask?

thanks
Martin

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





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


Re: [osg-users] nodemask or switch

2009-08-24 Thread Jolley, Thomas P
Hi Martin,

Often times you can use either a nodemask or Switch node to do the same
thing.  I look at nodemasks as an encoding of a node state that is more
than just on or off.  For example, a nodemask can have one bit indicate
it is a shadow caster and another bit for shadow receiver.  When a
nodemask can have a state other than on/off and you want to turn nodes
on/off, it's often cleaner to use a Switch node than to keep track of
Node and nodemask pairs.


Tom Jolley
 

 From: Martin Beckett
 
 New in a series of embarrassing newbie questions :-* 
 
 When do I need a switch node if I have a nodemask?
 
 Suppose I have a number of components to a model 
 (wings/body/wheels etc) these are all children of a single 
 parent node and each have a nodemask allowing them to be 
 switched on/off individually.
 The same functionality is achieved by inserting a switch node 
 and setting the value for each child.
 
 Why - is there extra functionality from the switch, is there 
 a limitation of the nodemask?
 
 thanks
 Martin
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=16645#16645
 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [ANN] Job Opportunity - Flight Simulators

2009-08-24 Thread Ken Zimmerman
Job Opportunity: Image Generator (IG) (windows based) Developer for serious 
flight simulation

Merlin Simulation is looking for a programmer/engineer with strong 3D Graphics 
skills. This person will be responsible for enhancing our OSG image generator 
for use in our flight simulators as well as other programming tasks in support 
of flight simulation. See our website to gain a better understanding.

Required Experience

* Strong C++ skills (using Visual Studio)
* 3D Graphics Experience
* OpenSceneGraph Experience
* Experience designing and developing graphics algorithms 

Bonus Experience

* Microprocessor firmware proogramming
* Lua

U.S. citizenship required

* Url: http://www.merlinsimulation.com
* Contact: car...@merlinsimulation.com
* Duration: Permanent
* First posted: 22-August-2009

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





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


[osg-users] rendering to existing gtk window

2009-08-24 Thread Vinay Shah
Hello, 

I'm trying to port some code which worked in OpenSceneGraph 1.0 and used the 
old Producer's viewer.  

previously i had a statement which said: 


Code:
viewer.getCamera(0)-getRenderSurface()-setWindow(gtk_plug_id);  



I tried creating a graphics context and setting the inheritedWindowData traits 
as: 


Code:

traits-inheritedWindowData = new osgViewer::GraphicsWindowX11(gtk_pli_id);





I noticed that it does black out the appropriate window (so it seems like its 
doing something right) but then fails to render anything to that area.  Is 
there another step that I might be missing?  

thanks in advance, 

-vinay

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





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


Re: [osg-users] nodemask or switch

2009-08-24 Thread Martin Beckett
That was rather what was confusing me. The 'already included in every node' 
nodemask seemed to have more capability than the 'have to add it the scenegraph 
and manage it manually' switch.

The only advantage for a switch node I could see was the example in Paul's book 
where you have a number of different versions of a node and you want to use 
'one of n' rather than a bitmask worth.

I was just careful in case nodemask had some reserved functionality that I was 
going to break by using it's fields for my own nefarious purposes!

Cheers,
Martin

ps. Is nodemask still 32bit on 64bit builds of OSG?

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





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


[osg-users] Updating a texture(urgent)

2009-08-24 Thread Tim Allen
Hi,

I am trying to update a texture in one node and Im applying it in other 
node.The problem Im facing with this is only the update to the current frame is 
seen.The previous updates are not seen on the texture.If I want to update a 
texture and those updates need to be permanently applied to the texture 
image.Are there some settings for it ,If so any help please.Thanks in advance.

Thank you!

Cheers,
Tim

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





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


Re: [osg-users] nodemask or switch

2009-08-24 Thread Jason Daly

Martin Beckett wrote:

That was rather what was confusing me. The 'already included in every node' 
nodemask seemed to have more capability than the 'have to add it the scenegraph 
and manage it manually' switch.

The only advantage for a switch node I could see was the example in Paul's book 
where you have a number of different versions of a node and you want to use 
'one of n' rather than a bitmask worth.

I was just careful in case nodemask had some reserved functionality that I was 
going to break by using it's fields for my own nefarious purposes!

Cheers,
Martin

ps. Is nodemask still 32bit on 64bit builds of OSG?
  



It's an unsigned int, which is a 32-bit number on most architectures 
(including Linux x64 and Win64).


--J

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


Re: [osg-users] OSG 2.8.2 rpms for Centos 5 and RedHat 5

2009-08-24 Thread Eric Sokolowsky
Peter Bear wrote:
 Hi,
 results show:
 
 [r...@pciii pciii]# rpm -qa | grep curl
 libcurl-7.19.4-9.fc11.i586
 libcurl-7.19.4-9.fc11.x86_64
 curl-7.19.4-9.fc11.x86_64
 [r...@pciii pciii]#
 
 Cheers,
 Peter

It looks like you are using Fedora 11. The package I built is for RedHat
5/Centos 5, which is based on Fedora 6. Your curl is too new for my
package. If you did this command:

   rpm -q --filesbypkg curl | grep libcurl

You would probably find libcurl.so.4 instead of libcurl.so.3. Perhaps
you can find a Fedora 11 package for curl 7.15.5 which is the version I
have on my machine, or else you can try downloading the source rpm (the
one with .srpm suffix) and then issuing this command:

  RPM_BASE=/tmp rpmbuild --rebuild name_of_source_rpm_here.srpm

Let me know if you need more help.

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


Re: [osg-users] 0bit Stencil Buffer

2009-08-24 Thread Eric Sokolowsky
Mathias Buhr wrote:
 Hi everyone,
 
 I'm trying to use the stencil buffer to render only parts of the final
 image through other graph-attached cameras. The app works fine on ATI
 hardware but NVIDIA fails. OpenGL reports that the stencil buffer has
 only 0 bits (which is 8 bits on ATI, via
 glGetInterv(GL_STENCIL_BUFFER_BITS) in a DrawCallback). I have tested
 this on various linux boxes (Ubuntu 9.04, Fedora 11) with recent
 hardware and recent drivers.
 I'm pretty sure that a stencil buffer is available on this hardware
 because OSG seems to be able to utilize it (stereo-mode in
 osgUtil::SceneView uses stenciling and works fine). I'm pretty sure I've
 missed something. Is there anything special to do to get or enable a
 stencil buffer on Nvidia?

My OSG application uses a stencil buffer on Nvidia hardware, so it is
definitely possible. There should be a mechanism (depending on how you
create your context) to request a stencil-buffer-enabled context. I'm
using FLTK to create my OpenGL context, so my code's example might not
be useful to you.

It looks like osg/DisplaySettings has a method setMinimumNumStencilBits
that may be helpful to you. You could also look at the osgreflect demo.

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


Re: [osg-users] 0bit Stencil Buffer

2009-08-24 Thread Jason Daly

Eric Sokolowsky wrote:

Mathias Buhr wrote:
  

Hi everyone,

I'm trying to use the stencil buffer to render only parts of the final
image through other graph-attached cameras. The app works fine on ATI
hardware but NVIDIA fails. OpenGL reports that the stencil buffer has
only 0 bits (which is 8 bits on ATI, via
glGetInterv(GL_STENCIL_BUFFER_BITS) in a DrawCallback). I have tested
this on various linux boxes (Ubuntu 9.04, Fedora 11) with recent
hardware and recent drivers.
I'm pretty sure that a stencil buffer is available on this hardware
because OSG seems to be able to utilize it (stereo-mode in
osgUtil::SceneView uses stenciling and works fine). I'm pretty sure I've
missed something. Is there anything special to do to get or enable a
stencil buffer on Nvidia?



The stencil property of GraphicsContext::Traits is 0 by default.  Just 
set it to 8 before creating the GraphicsContext and it should work.  For 
example:


  osg::ref_ptrosg::GraphicsContext::Traits traits =
 new osg::GraphicsContext::Traits;
  traits-x = 100;
  traits-y = 100;
  traits-width = 640;
  traits-height = 480;
  traits-windowDecoration = true;
  traits-doubleBuffer = true;
  traits-red = 8;
  traits-green = 8;
  traits-blue = 8;
  traits-depth = 24;
  traits-stencil = 8;
  traits-sharedContext = 0;

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


--J

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


Re: [osg-users] [vpb] Some questions about VPB and cloud of points

2009-08-24 Thread Glenn Waldron
Andrea,

You could try doing this with osgEarth. This sample .earth file shows
how to incorporate a high-resolution inset into an existing osgdem
(VPB) model:

http://wush.net/trac/osgearth/browser/trunk/tests/vpb_with_inset.earth

In addition, osgEarth layers can take  min_level and max_level
attributes that direct the LOD at which the data should appear.


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



On Mon, Aug 24, 2009 at 9:52 AM, Andrea Martinimartini.and...@gmail.com wrote:
 Hi to all,
 i would like to create or use a software application ables to visualize a 
 seaground (get from a cloud of points) 3d model inside earth
 model created by osgdem. I'm wondering if VPB, OsgEarth or osgGIS are the 
 correct technologies to solve my problem.
 Some questions :
 1) Can i create a DEM file from a cloud of points (I have information about 
 its coordinates) using osgdem?
 2) How i can add the DEM file obtained from previous question (or a generic 
 3d model) to earth model created by osgdem?
 3) I have created the earth model with osgdem using blu marble image from 
 nasa web site. The best image resolution get from
 this website  is too far from the ground (i think that image was taken from 
 about 900 km of quote). I would like to insert or ADD 3d model
 of my clouds of point (the seaground), in DEM format, and i would like to 
 visualize this model only at a certain level
 (i.e. after the last level created by osgdem).
 Hoping my questions could be enough clear ...

 Thank you!

 Cheers,
 Andrea

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





 ___
 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] 0bit Stencil Buffer

2009-08-24 Thread Mathias
Eric Sokolowsky wrote:
 Mathias Buhr wrote:
   
 Hi everyone,

 I'm trying to use the stencil buffer to render only parts of the final
 image through other graph-attached cameras. The app works fine on ATI
 hardware but NVIDIA fails. OpenGL reports that the stencil buffer has
 only 0 bits (which is 8 bits on ATI, via
 glGetInterv(GL_STENCIL_BUFFER_BITS) in a DrawCallback). I have tested
 this on various linux boxes (Ubuntu 9.04, Fedora 11) with recent
 hardware and recent drivers.
 I'm pretty sure that a stencil buffer is available on this hardware
 because OSG seems to be able to utilize it (stereo-mode in
 osgUtil::SceneView uses stenciling and works fine). I'm pretty sure I've
 missed something. Is there anything special to do to get or enable a
 stencil buffer on Nvidia?
 

 My OSG application uses a stencil buffer on Nvidia hardware, so it is
 definitely possible. There should be a mechanism (depending on how you
 create your context) to request a stencil-buffer-enabled context. I'm
 using FLTK to create my OpenGL context, so my code's example might not
 be useful to you.

 It looks like osg/DisplaySettings has a method setMinimumNumStencilBits
 that may be helpful to you. You could also look at the osgreflect demo.

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

   
Thank you Eric but unfortunately I've already tried
setMinimumNumStencilBits and the osgreflect demo. But a look at the
context should be a useful hint.

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


Re: [osg-users] 0bit Stencil Buffer

2009-08-24 Thread Mathias
This looks interesting Jason. Thanks! I'll  try that tomorrow.

Nice greetings
Mathias Buhr

Jason Daly wrote:
 Eric Sokolowsky wrote:
 Mathias Buhr wrote:
  
 Hi everyone,

 I'm trying to use the stencil buffer to render only parts of the final
 image through other graph-attached cameras. The app works fine on ATI
 hardware but NVIDIA fails. OpenGL reports that the stencil buffer has
 only 0 bits (which is 8 bits on ATI, via
 glGetInterv(GL_STENCIL_BUFFER_BITS) in a DrawCallback). I have tested
 this on various linux boxes (Ubuntu 9.04, Fedora 11) with recent
 hardware and recent drivers.
 I'm pretty sure that a stencil buffer is available on this hardware
 because OSG seems to be able to utilize it (stereo-mode in
 osgUtil::SceneView uses stenciling and works fine). I'm pretty sure
 I've
 missed something. Is there anything special to do to get or enable a
 stencil buffer on Nvidia?
 

 The stencil property of GraphicsContext::Traits is 0 by default.  Just
 set it to 8 before creating the GraphicsContext and it should work. 
 For example:

   osg::ref_ptrosg::GraphicsContext::Traits traits =
  new osg::GraphicsContext::Traits;
   traits-x = 100;
   traits-y = 100;
   traits-width = 640;
   traits-height = 480;
   traits-windowDecoration = true;
   traits-doubleBuffer = true;
   traits-red = 8;
   traits-green = 8;
   traits-blue = 8;
   traits-depth = 24;
   traits-stencil = 8;
   traits-sharedContext = 0;

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


 --J

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


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


[osg-users] How to read big openscenegraph files?

2009-08-24 Thread Colli Bann
Hi,

i have a problem with big ( 5GigaBytes) flt Files: i can´t read them.  When i 
try to read it with the osgDB, i takes 30 minutes and then it finishes with 
bad alloc error, consuming more than 90% of the memory. Is there a way to 
read it, without having the whole file in memory? convert is not able to 
convert such a file in, say, smaller ive format.

It seems, like it is not possible to read such big databases?

Thank you!

Cheers,
Colli

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





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


[osg-users] How to handle multiple key press at once?

2009-08-24 Thread Davide Byron
Hi everybody,
I'm pretty sure the solution to my problem is simple, but i'm new to osg and 
i'm having a lot of troubles with this...
the problem is that i have to handle multiple key press at once, but for now my 
code takes care of just one at a time (the last key you pressed).
here's the code i'm using right now:


Code:
virtual bool handle(const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter 
aa, osg::Object* obj, osg::NodeVisitor* nv)
{ 
 
switch (ea.getEventType())
{
// Possible events we can handle
case osgGA::GUIEventAdapter::PUSH: break;
case osgGA::GUIEventAdapter::RELEASE: break;
case osgGA::GUIEventAdapter::MOVE: break;
case osgGA::GUIEventAdapter::DRAG: break;
case osgGA::GUIEventAdapter::SCROLL: break;
case osgGA::GUIEventAdapter::KEYUP: break;
// this one is really handled
case osgGA::GUIEventAdapter::KEYDOWN:
{
switch (ea.getKey())
{
case 'w': { // Rotate upwards 
for ROTATION degrees (and keep going forward)

localSpadTransform-preMult(osg::Matrix::rotate(osg::DegreesToRadians(-ROTATION),
 osg::X_AXIS));

localSpadTransform-preMult(osg::Matrix::translate(0, SPEED, 0));
return true;
  } break; // -- 
useless

case 's': { // Rotate downwards 
for ROTATION degrees (and keep going forward)

localSpadTransform-preMult(osg::Matrix::rotate(osg::DegreesToRadians(ROTATION),
 osg::X_AXIS));

localSpadTransform-preMult(osg::Matrix::translate(0, SPEED, 0));
return true;
  } break; // 
-- useless

case 'a': { // Rotate for 
ROTATION degrees on the left (and keep going forward)

localSpadTransform-preMult(osg::Matrix::rotate(osg::DegreesToRadians(ROTATION),
 osg::Y_AXIS));

localSpadTransform-preMult(osg::Matrix::translate(0, SPEED, 0));
return true;
  } break; // 
-- useless

case 'd': { // Rotate for 
ROTATION degrees on the right (and keep going forward)

localSpadTransform-preMult(osg::Matrix::rotate(osg::DegreesToRadians(-ROTATION),
 osg::Y_AXIS));

localSpadTransform-preMult(osg::Matrix::translate(0, SPEED, 0));
return true;
  } break; // 
-- useless




case 'i': { // Rotate upwards 
for ROTATION degrees (and keep going forward)

localFokkerTransform-preMult(osg::Matrix::rotate(osg::DegreesToRadians(-ROTATION),
 osg::X_AXIS));

localFokkerTransform-preMult(osg::Matrix::translate(0, SPEED, 0));
return true;
  } break; // -- 
useless

case 'k': { // Rotate downwards 
for ROTATION degrees (and keep going forward)

localFokkerTransform-preMult(osg::Matrix::rotate(osg::DegreesToRadians(ROTATION),
 osg::X_AXIS));

localFokkerTransform-preMult(osg::Matrix::translate(0, SPEED, 0));
return true;
  } break; // 
-- useless

case 'j': { // Rotate for 
ROTATION degrees on the left (and keep going forward)

localFokkerTransform-preMult(osg::Matrix::rotate(osg::DegreesToRadians(ROTATION),
 osg::Y_AXIS));

localFokkerTransform-preMult(osg::Matrix::translate(0, SPEED, 0));
return true;
 

Re: [osg-users] How to read big openscenegraph files?

2009-08-24 Thread Tomlinson, Gordon
Colli

On 32 bit windows your limited to around 1.83gb of addressable memory space 
with tricks and version you can get this up to around 2.2-3gb of addressable 
space
(On linux you can get a wee bit more around 3gb)

If the files you have are many then you can use a paging system to load them in 
and out like osgVPB/osgDEM uses,  ( Similar to the old Vega LADBM systems )

also you could look at doing your own paging system using  osg::PagedLOD

Even using a paging system your not going to get all that data in memory at once


Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Colli Bann
Sent: Monday, August 24, 2009 5:25 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] How to read big openscenegraph files?

Hi,

i have a problem with big ( 5GigaBytes) flt Files: i can´t read them.  When i 
try to read it with the osgDB, i takes 30 minutes and then it finishes with 
bad alloc error, consuming more than 90% of the memory. Is there a way to 
read it, without having the whole file in memory? convert is not able to 
convert such a file in, say, smaller ive format.

It seems, like it is not possible to read such big databases?

Thank you!

Cheers,
Colli

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





___
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] checking StateAttribute::OVERRIDE

2009-08-24 Thread Helbig, Yuen
Does anyone know how to check if the StateAttribute::OVERRIDE flag is
set on a StateSet?
 
Yuen Helbig
 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] checking StateAttribute::OVERRIDE

2009-08-24 Thread Thrall, Bryan
Helbig, Yuen wrote on Monday, August 24, 2009 5:37 PM:

 Does anyone know how to check if the StateAttribute::OVERRIDE flag is
set on
 a StateSet? 
 
 Yuen Helbig

Perhaps something like the following:

osg::StateAttribute::Type ssType = osg::StateAttribute::TEXTURE; // or
the type of whatever StateAttribute you want
if (0 != stateset-getAttributePair(ssType)-second 
StateAttribute::OVERRIDE)
{
   osg::notify(DEBUG_FP)  StateAttribute type   ssType   has
OVERRIDE set  std::endl;
}

-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] checking StateAttribute::OVERRIDE

2009-08-24 Thread Helbig, Yuen
Bryan Thrall,

That worked, thank you ^^

Yuen Helbig 

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Thrall,
Bryan
Sent: Monday, August 24, 2009 4:44 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] checking StateAttribute::OVERRIDE

Helbig, Yuen wrote on Monday, August 24, 2009 5:37 PM:

 Does anyone know how to check if the StateAttribute::OVERRIDE flag is
set on
 a StateSet? 
 
 Yuen Helbig

Perhaps something like the following:

osg::StateAttribute::Type ssType = osg::StateAttribute::TEXTURE; // or
the type of whatever StateAttribute you want if (0 !=
stateset-getAttributePair(ssType)-second 
StateAttribute::OVERRIDE)
{
   osg::notify(DEBUG_FP)  StateAttribute type   ssType   has
OVERRIDE set  std::endl; }

--
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Visual Studio 2005

2009-08-24 Thread Michael W. Hall
I have my environment variables setup.  However, linking the example I
get numerous unresolved external errors.  Not sure what is wrong.  No
compile errors.

Trying to figure if it is my osglibs that are bad or what.  Still trying
to figure it out.

Michael

On Sun, 2009-08-16 at 16:52 -0400, Jean-Sébastien Guay wrote:
 Hi Andrew, Michael,
 
  Here, follow this guide:
  
  http://www.macs.hw.ac.uk/modules/F24VS2/Labs/OpenSceneGraphTutorial.pdf
 
 No, please don't. It's horribly out of date.
 
 Please use the documentation on the OSG web site, which has gotten much 
 better, in particular:
 
 http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio
 
 This one is also good if you want to compile OSG from sources:
 
 http://www.skew-matrix.com/bb/viewtopic.php?f=8t=3
 
 Also, Paul Martz has published an OSG quick start guide, which is free 
 in PDF:
 
 http://www.osgbooks.com/
 
 Hope this helps,
 
 J-S

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


Re: [osg-users] CompositeViewer-addView/removeView problem

2009-08-24 Thread Jimmy Lin
Hi,

I just found out when I create graphic context, if I don't set 
inheritedWindowData for the trait, then everything is ok. but if I use window 
form control's handle as inheritedWindowData and repeatly addView/removeView 
20~30 times, then I start to have memory leak. problem.

Does anyone know why?

Thank you!

Cheers,
Jimmy

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





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