Re: [osg-users] light Callback

2008-08-08 Thread Vincent Bourdier
Hi Paul,

thanks a lot you're right ! adding a stateattribute made my callback beeing
traversed...

just one last question : my callback is a structure, and there is no
traverse() method to call... is it a problem ?
Thanks

Regards,
   Vincent.

2008/8/7 Paul Melis [EMAIL PROTECTED]

 Hi,

 Try adding your osg::Light to a StateSet, i.e. (pseudocode)

 group = osg::Group()
 lightsource = osg::LightSource()
 light = osg::Light()
 light.setLightNum(0)
 
 lightsource.setLight(light)
 group.addChild(lightsource)
 group.getOrCreateStateSet().setAttribute(light, osg::StateAttribute::ON)

 viewer.setSceneData(group)

 It seems StateAttribute callbacks are only called when the attribute is set
 on a StateSet.
 Setting the light as state attribute on lightsource does not seem to
 work, which is a bit surprising as a osg::LightSource is a Group and
 therefore also has a StateSet.
 Actually, I find the whole Light / LightSource (which is a Group) / Light
 set as a StateAttribute a bit confusing.

 Paul


 Vincent Bourdier wrote:

 Hi,

 I just need to move a light, and for that I try to use a callback.
 So I implement a simple class lightMoveCallback : public
 osg::StateAttribute::Callback

 with virtual void operator()(osg::StateAttribute* ss, osg::NodeVisitor*
 nv);

 but the callback is never called...

 I use :
 light-setUpdateCallback(new lightMoveCallback())
 thanks for help,

 Regards,
 Vincent.
 

 ___
 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] I have a question about osgParticle::Particle.

2008-08-08 Thread GMD GammerMaxyandex.ru
Hi, I have a question about osgParticle::Particle.

I get code from example osgParticle. It works, but there is one problem:
after adding particles into scene group (root) I lost ability to change some
properties - methods setLifeTime, setSizeRange, setAlphaRange, setColorRange, 
setRadius don't work. Nevertheless, osgParticle::ParticleSystem 
(setDefaultAttributes)
and osgParticle::RandomRateCounter (setRateRange) works (I see result in 
screen).

So, why can't I change properties of osgParticle::Particle after adding it in 
scene
or how should I do that right?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Anybody got wxPack (wxWidgets) + OSG working?

2008-08-08 Thread Kimmo Kotajärvi
I think I got it working... I compiled wx myself and then osgviewerWX. 
Strangely, it exits on startup and refuses to print anything to console. 
Stepping through it with a debugger I could see it wasn't able to load any 
models, while any other program can.
However, I created a dummy scenegraph in the code and finally got a nice blue 
osg screen.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Group::getNumChildren()

2008-08-08 Thread Jakob Ruhe
You can insert an explicit cast to unsigned int if you really need to
remove the warning. If an int is defined as 32 bit in your 64 bit
system you are safe as long as you keep number of children for one
group node less than 4 194 304..
The alternative would of course be to change the return type of
Group::getNumChildren to vector::size_type which I believe is defined
as size_t and is probably a 64 bit long long integer but I am quite
sure you will have many more warnings to remove if you try this.

/Jakob Ruhe

2008/8/7 Andy Skinner [EMAIL PROTECTED]:
 This method returns an unsigned int.  It calls size() on the vector, which 
 returns size_type.

 In our builds of software using OSG, we're getting warnings about a 
 conversion of a 64 bit value to unsigned int.

 Has the OSG project had to change the type of common methods like this?  Does 
 it go well?  I haven't had time to do any compiling of OSG for a long time 
 (since we got 2.4.0 built and integrated).  In this case, I'm adding a new 
 file that gives this warning, and we've got structure in place to make it 
 difficult to add files with warnings in compilation.

 I don't think it is likely to be a problem.  One possibility is to cast it in 
 the method.  Is that what should be done?

 thanks
 andy

 ___
 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] problem to delete an object from the screen

2008-08-08 Thread Sébastien Champmartin
Hi,
the following code displays a grid when we enter in the 'if' part, but if i 
press the key which displayed the grid before the else doen't delete this 
object.
How can i do ?
 
void GmlOsgObject::createGrid()
{
osg::ref_ptr osg::PositionAttitudeTransform root = 
CameraManager::getSingletonPtr()-getRoot();
osg::ref_ptr osg::Geode gridGeode = new osg::Geode();
osg::ref_ptr osg::Geometry gridGeometryV = new osg::Geometry();
osg::ref_ptr osg::Geometry gridGeometryH = new osg::Geometry();
if(/*!gridGeodePtr*/gridDisplayed==false )
{


root-addChild(gridGeode.get());

gridGeode-addDrawable(gridGeometryV.get());
gridGeode-addDrawable(gridGeometryH.get());

osg::Vec3Array* gridVerticesVertical = new osg::Vec3Array;
osg::Vec3Array* gridVerticesHorizontal = new osg::Vec3Array;
long int iterationNumber = 0 ;

for( int i = -100 ; i = 100 ; i =i++ )
{
gridVerticesVertical-push_back(osg::Vec3(i*10, -1000, 0));
gridVerticesHorizontal-push_back(osg::Vec3(-1000, i*10, 0));
iterationNumber++ ;
}
for( int i = -100 ; i = 100 ; i =i++ )
{
gridVerticesVertical-push_back(osg::Vec3(i*10, 1000, 0));
gridVerticesHorizontal-push_back(osg::Vec3(1000, i*10, 0));
iterationNumber++ ;
}
gridGeometryV-setVertexArray(gridVerticesVertical);
gridGeometryH-setVertexArray(gridVerticesHorizontal);
osg::DrawElementsUInt* horizontalLines = new 
osg::DrawElementsUInt(osg::PrimitiveSet::LINES, 0);
osg::DrawElementsUInt* verticalLines = new 
osg::DrawElementsUInt(osg::PrimitiveSet::LINES, 0);

for(int i = (iterationNumber - 1) ; i  (iterationNumber/2) ; i--) 
{
verticalLines-push_back(i);
verticalLines-push_back(i-(iterationNumber/2));
horizontalLines-push_back(i);
horizontalLines-push_back(i-(iterationNumber/2));
}
gridGeometryV-addPrimitiveSet(verticalLines);
gridGeometryH-addPrimitiveSet(horizontalLines);
gridGeode-setNodeMask(1);
gridDisplayed=true ;
//gridGeodePtr = gridGeode ;
}
else
{ 
//gridGeometryV-releaseGLObjects();
//gridGeometryH-releaseGLObjects();
gridGeode-setNodeMask(0);
root-removeChild(gridGeode.get());
//gridGeode-deleteUsingDeleteHandler();
//gridGeode.release();
gridDisplayed=false ;
/*gridGeodePtr = NULL ;*/
}
}
_
Retouchez, classez et partagez vos photos gratuitement avec le logiciel Galerie 
de Photos !
http://www.windowslive.fr/galerie/___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] problem to delete an object from the screen

2008-08-08 Thread Ulrich Hertlein

Hi Sébastien,

Sébastien Champmartin wrote:

void GmlOsgObject::createGrid()
{
osg::ref_ptr osg::PositionAttitudeTransform root = 
CameraManager::getSingletonPtr()-getRoot();

osg::ref_ptr osg::Geode gridGeode = new osg::Geode();
if(/*!gridGeodePtr*/gridDisplayed==false )
{
root-addChild(gridGeode.get());
 gridGeode-addDrawable(gridGeometryV.get());
gridGeode-addDrawable(gridGeometryH.get());
... 
}

else
{
gridGeode-setNodeMask(0);
root-removeChild(gridGeode.get());
gridDisplayed=false ;
}
}


You're creating 'gridGeode' every time the function is called.  So for the first call you 
create a 'gridGeode' and add it to 'root'.  For the next call you're creating *another* 
'gridGeode' and try to remove that from the 'root'.


Make 'gridGeode' a member of your object and make sure you only create it once.
To make the grid invisible it's actually enough to call 'gridGeode-setNodeMask(0)' (as 
you're already doing) to make it invisible and call 'setNodeMask(~0)' to make it visible 
again.


Cheers,
/ulrich

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


[osg-users] Render capability checking, is this a good way?

2008-08-08 Thread Viggo Løvli

Hi,
 
I need to automatically check the rendering capabilities of the current 
hardware and chose rendering techniques from that. I want to find the best 
practical way to do this.
 
I have looked into the OSGShaderTerrain example.
It uses a osg::GraphicsOperation class to do actual capability checking.
 
My application creates a osgViewer::CompositeViewer instance.
Basically this is the initialization in pseudocode:
 
viewer = new osgViewer::CompositeViewer();
view = new osgViewer::View;
viewer-addView( view );
view-setSceneData( myRootNode );
view-setUpViewInWindow( 100, 100, 1024, 768 );
viewer-run();
 
Now say that I have 3 different levels of rendering techniques:
2 = Complex 
1 = Normal   
0 = Simple
 
If I shall use the same method as done in the OSGShaderTerrain example, then I 
would write the code like this:
 
level = 3
while( level-- )
{
viewer = new osgViewer::CompositeViewer();
capabilityChecker = new myTestSupportOperationClass( level );  // 
myTestSupportOperationClass is a specialized version of osg::GraphicsOperation.
viewer-setRealizeOperation( capabilityChecker );
view = new osgViewer::View;
viewer-addView( view );
view-setSceneData( myRootNode );
view-setUpViewInWindow( 100, 100, 1024, 768 );
viewer-realize();
if( !capabilityChecker-_supported )
{
..cleanup so we are ready to initialize again...
continue; // Check one lower level...
}
viewer-run();
break; // We did manage to run, so break the loop
}
 
I wonder if this is a good way to organize the capability testing?
Is there other ways I should explore?
 
 
QITODMWTAM-section (Questions I think OSG developers may want to ask me):
--
Q: What capabilities are you trying to check?
A: 
I want to check if the current hardware can run shaders.
I would also check basic stuff like how many texture units I can use.
I would also check if I can render to an offscreen surface.
I plan to give each special-effect that I write a capability checking function 
which I should be able to call from my specialization of the 
osg::GraphicsOperation class. Each piece of code I have that require checking 
will then be able to stop the system from using them if the capability needs 
are not met.
 
Cheers,
Viggo
 
_
Få Windows Live Messenger på mobilen.
http://windowslivemobile.msn.com/Homepage.aspx?lang=nb-noocid=30032___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] problem to delete an object from the screen

2008-08-08 Thread Sébastien Champmartin
Hi,
I tried this (with osg variables as class member) but it doen't display the 
grid :
 
if(/*!gridGeodePtr*/gridDisplayed==false )
{

gridGeode-addDrawable(gridGeometryV.get());
gridGeode-addDrawable(gridGeometryH.get());
root = CameraManager::getSingletonPtr()-getRoot(); 
root-addChild(gridGeode.get());
/*root-addChild(gridGeode.get());

gridGeode-addDrawable(gridGeometryV.get());
gridGeode-addDrawable(gridGeometryH.get());*/


long int iterationNumber = 0 ;

for( int i = -100 ; i = 100 ; i =i++ )
{
gridVerticesVertical-push_back(osg::Vec3(i*10, -1000, 0));
gridVerticesHorizontal-push_back(osg::Vec3(-1000, i*10, 0));
iterationNumber++ ;
}
for( int i = -100 ; i = 100 ; i =i++ )
{
gridVerticesVertical-push_back(osg::Vec3(i*10, 1000, 0));
gridVerticesHorizontal-push_back(osg::Vec3(1000, i*10, 0));
iterationNumber++ ;
}
gridGeometryV-setVertexArray(gridVerticesVertical);
gridGeometryH-setVertexArray(gridVerticesHorizontal);
osg::DrawElementsUInt* horizontalLines = new 
osg::DrawElementsUInt(osg::PrimitiveSet::LINES, 0);
osg::DrawElementsUInt* verticalLines = new 
osg::DrawElementsUInt(osg::PrimitiveSet::LINES, 0);

for(int i = (iterationNumber - 1) ; i  (iterationNumber/2) ; i--) 
{
verticalLines-push_back(i);
verticalLines-push_back(i-(iterationNumber/2));
horizontalLines-push_back(i);
horizontalLines-push_back(i-(iterationNumber/2));
}
gridGeometryV-addPrimitiveSet(verticalLines);
gridGeometryH-addPrimitiveSet(horizontalLines);
gridGeode-setNodeMask(1);
gridDisplayed=true ;
//gridGeodePtr = gridGeode ;
}
else
{ 
//gridGeometryV-releaseGLObjects();
//gridGeometryH-releaseGLObjects();
gridGeode-setNodeMask(0);
//root-removeChild(gridGeode.get());
//gridGeode-deleteUsingDeleteHandler();
//gridGeode.release();
gridDisplayed=false ;
/*gridGeodePtr = NULL ;*/
}
 



 Date: Fri, 8 Aug 2008 20:11:57 +1000 From: [EMAIL PROTECTED] To: 
 osg-users@lists.openscenegraph.org Subject: Re: [osg-users] problem to 
 delete an object from the screen  Hi Sébastien,  Sébastien Champmartin 
 wrote:  void GmlOsgObject::createGrid()  {  osg::ref_ptr 
 osg::PositionAttitudeTransform root =   
 CameraManager::getSingletonPtr()-getRoot();  osg::ref_ptr osg::Geode 
 gridGeode = new osg::Geode();  if(/*!gridGeodePtr*/gridDisplayed==false ) 
  {  root-addChild(gridGeode.get());   
 gridGeode-addDrawable(gridGeometryV.get());  
 gridGeode-addDrawable(gridGeometryH.get()); ...   }  else  {  
 gridGeode-setNodeMask(0);  root-removeChild(gridGeode.get());  
 gridDisplayed=false ;  }  }  You're creating 'gridGeode' every time the 
 function is called. So for the first call you  create a 'gridGeode' and add 
 it to 'root'. For the next call you're creating *another*  'gridGeode' and 
 try to remove that from the 'root'.  Make 'gridGeode' a member of your 
 object and make sure you only create it once. To make the grid invisible 
 it's actually enough to call 'gridGeode-setNodeMask(0)' (as  you're already 
 doing) to make it invisible and call 'setNodeMask(~0)' to make it visible  
 again.  Cheers, /ulrich  
 ___ osg-users mailing list 
 osg-users@lists.openscenegraph.org 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_
Retouchez, classez et partagez vos photos gratuitement avec le logiciel Galerie 
de Photos !
http://www.windowslive.fr/galerie/___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 回复: Re: About viewer.ad dEventHandler(new PickHandler())?

2008-08-08 Thread Jean-Sébastien Guay

Hello YangXiao,

2. I  have another question, when viewer.frame()  which thread 
listening windows message(example mouse clicked,keyboard down ,up etc) 
,and when 
i update my scene node in updatecallback,How threads guarantee sequence?


To avoid threading problems I suggest you use an EventHandler to do this.

For example:

class MyEventHandler : public osgGA::GUIEventHandler
{
public:

MyEventHandler() {}

~MyEventHandler() {}

bool handle(const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter aa)
{
switch(ea.getEventType())
{
// Mouse button press
case(osgGA::GUIEventAdapter::PUSH):
{
// ... do what you want here
return false;
}
// Mouse button release
case(osgGA::GUIEventAdapter::RELEASE):
{
// ... do what you want here
return false;
}
default:
return false;
}
}
};

Then add this handler to the viewer:

viewer.addEventHandler(new MyEventHandler);

See the osgpick example for an example of a mouse event handler, and the 
osgkeyboard example for a keyboard event handler - of course you can 
combine both if you want (the same handle() method can be used for mouse 
and keyboard events). See the docs for the return values of 
ea.getEventType().


I suggest you read the OSG Quick Start Guide (free from 
http://www.osgbooks.com/) and then go around the reference docs 
(http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/) 
and the many included examples in the OSG source tree to get a feel for 
things. These are pretty basic questions that you could answer yourself 
by reading a bit (not that we don't want to answer them, but you'll wait 
longer for an answer).


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] CG for Simulation BOF at Siggraph

2008-08-08 Thread Jean-Sébastien Guay

Hello John,


Lastly, I will bring chocolate to the BOF.


All that AND chocolate? :-)

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] light Callback

2008-08-08 Thread Jean-Sébastien Guay

Hi Vincent,

just one last question : my callback is a structure, and there is no 
traverse() method to call... is it a problem ?


It overrides a base class which has a traverse() method, so just call that.

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] Examples osgviewerMFC resize artefact

2008-08-08 Thread Jean-Sébastien Guay

Hi all,


Here is what to do :
1) Launch osgviewerMFC sample
2) open a model
3) reduce window size (not maximised)
4) open an other different model
5) reduce second window size (not maximised)
6) close first window
7) try to resize second window


This is also reproducible with stock osgviewer on Win32 when using 2 
screens.


1. osgviewer cow.osg (make sure it starts on both screens, fullscreen)
2. press 'f' to go out of fullscreen mode. you will get 2 windows, one 
on each screen.

3. resize one of the windows (make it bigger), it works fine.
4. close one of the windows.
5. resize the remaining window (make it bigger), and you get the same 
artifact as in the attachment in the OP.


I'm not a win32 programming expert so I can't really see what would 
cause this. The cow still rotates if you try, so the update loop is 
still being executed... I can't see why the viewport would not be 
updated to the new window size if one of the windows was closed... 
Perhaps someone more knowledgeable than me can trace through the code.


And I can't test right now if the same happens on other platforms, but I 
suspect not.


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] Siggraph Web3D and related technologies BOFs at a glance

2008-08-08 Thread Jean-Sébastien Guay

Hi John,


Open Scengraph is
sort of the Open Inventor functional clone that has a totally free 
license and is a Web3D technology

[hope this assessment is reasonably correct].


For that last part, I think I saw someone doing a web browser plugin 
that uses OSG to display objects/environments in a web page, streaming 
the content over the net. I can't remember who or find a link though. 
Perhaps someone else will be able to refresh my memory.


But other than that, OSG can read some Web3D formats, and perhaps more 
in the future (if the new OpenVRML library is integrated).


I do have a “pocket universe” with 29 hours per day 
for those that have to attend more BOF’s.


I like your sense of humor. :-) If only that were possible... When 
making my Siggraph schedule I had a massive 4-way conflict on Wednesday, 
and another smaller conflict on Thursday. It was a hard choice to make. 
So much to see, and I can't clone myself...


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] Mac / X-Code build problem

2008-08-08 Thread Eric Sokolowsky

James Turner wrote:


On 6 Aug 2008, at 22:22, James Turner wrote:

Anyway, thanks for pointing this out. I will go and try a CMake build 
now.


With a Cmake based build of 2.6.0, I can build OSG fine, but again at 
runtime things don't seem at all happy. (In a different way to the 
problems I encountered with the Xcode projects, though - no crazy 
crashes, so far)


For example, trying to view one of the sample data files with 
osgviewer, I get: (with OSG_NOTIFY_LEVEL=DEBUG)


MacPro:Release jmt$ ./osgviewer 
/Users/jmt/Code/OSG/OpenSceneGraph-Data/cow.osg

GraphicsContext::setWindowingSystemInterface() 0x70a5b00x620c48
CullSettings::readEnvironmentalVariables()
4 repeats
DriveManipulator::_height set to ==1.5
CullSettings::readEnvironmentalVariables()
9 repeats
itr='/Users/jmt/Library/Application Support/OpenSceneGraph/PlugIns'
FindFileInPath() : trying /Users/jmt/Library/Application 
Support/OpenSceneGraph/PlugIns/osgPlugins-2.6.0/osgdb_osg.so ...

itr='/Library/Application Support/OpenSceneGraph/PlugIns'
FindFileInPath() : trying /usr/local/lib/osgPlugins-2.6.0/osgdb_osg.so 
...

FindFileInPath() : USING /usr/local/lib/osgPlugins-2.6.0/osgdb_osg.so
CullSettings::readEnvironmentalVariables()
CullSettings::readEnvironmentalVariables()
Opened DynamicLibrary osgPlugins-2.6.0/osgdb_osg.so
Warning: Could not find plugin to read objects from file 
/Users/jmt/Code/OSG/OpenSceneGraph-Data/cow.osg.

./osgviewer: No data loaded

And the same happens with any other example - plugins are found and 
'opened' fine, but that's immediately followed by an error message 
indicating that no suitable plugin could be found.


As far as I know, I've followed the instructions in the README - 
unpack the zip, use the Cmake gui, build with Xcode, install to 
/usr/local


So I come back to, I must have screwed something up, but I'm unclear 
what.
Hmm. This is very strange. I do not get this problem. The only thing 
that I do differently is that I don't install into /usr/local. Can you 
try running osgviewer from the directory where it is built? You may need 
to set OSG_LIBRARY_PATH to point to your plugins directory. Can you also 
show the results of otool -L /path/to/osgviewer?


You can also set your OSG_FILE_PATH to point to the OpenSceneGraph-Data 
directory if you don't want to keep typing that path.


-Eric

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


Re: [osg-users] light Callback

2008-08-08 Thread Vincent Bourdier
Right

Thanks a lot for your help.

Regards,
Vincent

2008/8/8 Jean-Sébastien Guay [EMAIL PROTECTED]

 Hi Vincent,

  just one last question : my callback is a structure, and there is no
 traverse() method to call... is it a problem ?


 It overrides a base class which has a traverse() method, so just call that.

 J-S
 --
 __
 Jean-Sebastien Guay[EMAIL PROTECTED]
   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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Mac / X-Code build problem

2008-08-08 Thread James Turner


On 8 Aug 2008, at 14:43, Eric Sokolowsky wrote:

Hmm. This is very strange. I do not get this problem. The only thing  
that I do differently is that I don't install into /usr/local. Can  
you try running osgviewer from the directory where it is built? You  
may need to set OSG_LIBRARY_PATH to point to your plugins directory.  
Can you also show the results of otool -L /path/to/osgviewer?


Tried using the 'uninstalled' versions, same result.

otool -L gives the following, which all looks sane to me:

MacPro:Release jmt$ otool -L osgviewer
osgviewer:
	/Users/jmt/Code/OSG/build-release/lib/Release/libosgViewer.dylib  
(compatibility version 1.0.0, current version 1.0.0)
	/Users/jmt/Code/OSG/build-release/lib/Release/libosgGA.dylib  
(compatibility version 1.0.0, current version 1.0.0)
	/Users/jmt/Code/OSG/build-release/lib/Release/libosgText.dylib  
(compatibility version 1.0.0, current version 1.0.0)
	/Users/jmt/Code/OSG/build-release/lib/Release/libosgDB.dylib  
(compatibility version 1.0.0, current version 1.0.0)
	/Users/jmt/Code/OSG/build-release/lib/Release/libosgUtil.dylib  
(compatibility version 1.0.0, current version 1.0.0)
	/Users/jmt/Code/OSG/build-release/lib/Release/libosg.dylib  
(compatibility version 1.0.0, current version 1.0.0)
	/Users/jmt/Code/OSG/build-release/lib/Release/libOpenThreads.dylib  
(compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
version 111.1.1)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon  
(compatibility version 2.0.0, current version 136.0.0)
	/System/Library/Frameworks/AGL.framework/Versions/A/AGL  
(compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL  
(compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current  
version 7.4.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current  
version 1.0.0)


You can also set your OSG_FILE_PATH to point to the OpenSceneGraph- 
Data directory if you don't want to keep typing that path.


Yep,. had actually done that, hadn't realised it worked for command  
line args as well.


So, bit of a mystery. I guess I'll build debug, see if I get the same  
issue, then step through the osgDB plugin loading code.


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


[osg-users] 3d Ocean and Wave Library

2008-08-08 Thread O'Malley, James
Does anyone know of a good 3d ocean and wave library that is either
opensource or has a nominal liscense fee?

 

Thanks

 

Kevin O'Malley

 

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


Re: [osg-users] osg sequence timing

2008-08-08 Thread Preece, Andy (GE EntSol, Intelligent Platforms)
Hi Max,

 

I don't know if this is related but take a look at the attached email.

There appears to be quite a few issues with the osg::Sequence class and
you are probably encountering one of them.

Please try my suggested fix as it seems to work for me.

 

Regards,

Andy

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Max
Bandazian
Sent: 07 August 2008 18:26
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] osg sequence timing

 

Hi,
I am experiencing some buggy behavior relating to loaded openflight
files containing sequences, and I would appreciate any suggestions. When
such a file is loaded after the viewer has been running for a bit, the
animation runs at the wrong speed. Here's some sample code that
illustrates the problem:

  osg::ref_ptrosg::Group rootNode = new osg::Group;

  osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer;
  viewer-setUpViewOnSingleScreen(0);
  viewer-setSceneData(rootNode.get());
  viewer-setCameraManipulator(new osgGA::TrackballManipulator());

  viewer-realize();
  
  while(!viewer-done()  viewer-getFrameStamp()-getFrameNumber()
 500)
  {
 viewer-frame();
  }

  osg::ref_ptrosg::Node modelNode =
osgDB::readNodeFile(some_animation.flt);
  rootNode-addChild(modelNode.get());

  while(!viewer-done())
  {
 viewer-frame();
  }

When the animation gets loaded in the above code, it runs much faster
than it ought to for around 5 seconds, and then runs at the normal rate.
It appears to be catching up with the frame time. Sending a visitor
down every loaded flt file and setting sync to true on all sequences
seems to fix the problem, but it seems like this should not be
necessary.

Thanks,
Max Bandazian

---BeginMessage---
Hi All,

 

I have found a possible bug in osg::Sequence. Can anyone confirm this
and/or let me know if it is fixed in a newer release than 2.4?

 

To reproduce the bug:

1.  Create a template osg::Sequence node (and underlying geometry)
but do not attach the node to the current active scenegraph.
2.  At some point during the rendering loop (perhaps on a keystroke)
clone the sequence node (I use the call:

   dynamic_castosg::Node*(templateNode - clone( osg::CopyOp(
(osg::CopyOp::CopyFlags)osg::CopyOp::DEEP_COPY_NODES ) ) )

3.  Set the cloned sequence node duration to a value that makes the
animation run slower (i.e. 2.0).
4.  Start the cloned sequence (using setMode()).
5.  Repeat steps 2 - 4 and observe that the cloned sequences do not
run slow but run as fast, appearing to ignore the duration that has been
set on them.

 

Looking at the 'good documentation' (2.4 source code), I see that _start
is being set to _now (osg::Sequence::setMode(), line 192). Should this
not _start not be set to -1.0?

 

PS: It is also interesting to note that when loading OpenFlight file
with the frameTime set to 0.0, setting duration will have no effect.
Perhaps the OpenFlight loader should provide a very small default
frameTime value if the incoming value from the OpenFlight file is 0.0.

 

PS2: It also looks like the _nrepRemain value is not being reset when
setMode( START ) is called. To reset the value you must call setDuration
again.

 

Regards,

Andy

 

Business Development Manager

Embedded Simulation Group

GE Fanuc Intelligent Platforms

Applied Image Processing (formally Octec)

The Western Centre, Western Rd, Bracknell

Berkshire, England, RG12 1RW

Tel:  +44 (0)1344 464908

Fax: +44 (0)1344 465201

Web: http://www.octec.com

GE Fanuc Intelligent Platforms (Bracknell) Ltd, registered in England
and Wales (2393111) at 100 Barbirolli Square, Manchester, M2 3AB, VAT GB
530 094 183

This email is private and confidential and for the addressee only. If
misdirected, please notify us by telephone and confirm that it has been
deleted from your system and any hard copies destroyed. You are strictly
prohibited from using, printing, distributing or disseminating it or any
information contained in it save to the intended recipient.

 

 

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


Re: [osg-users] Mac / X-Code build problem

2008-08-08 Thread Eric Sokolowsky

James Turner wrote:


On 8 Aug 2008, at 14:43, Eric Sokolowsky wrote:

Hmm. This is very strange. I do not get this problem. The only thing 
that I do differently is that I don't install into /usr/local. Can 
you try running osgviewer from the directory where it is built? You 
may need to set OSG_LIBRARY_PATH to point to your plugins directory. 
Can you also show the results of otool -L /path/to/osgviewer?


Tried using the 'uninstalled' versions, same result.

otool -L gives the following, which all looks sane to me:

MacPro:Release jmt$ otool -L osgviewer
osgviewer:
/Users/jmt/Code/OSG/build-release/lib/Release/libosgViewer.dylib 
(compatibility version 1.0.0, current version 1.0.0)
/Users/jmt/Code/OSG/build-release/lib/Release/libosgGA.dylib 
(compatibility version 1.0.0, current version 1.0.0)
/Users/jmt/Code/OSG/build-release/lib/Release/libosgText.dylib 
(compatibility version 1.0.0, current version 1.0.0)
/Users/jmt/Code/OSG/build-release/lib/Release/libosgDB.dylib 
(compatibility version 1.0.0, current version 1.0.0)
/Users/jmt/Code/OSG/build-release/lib/Release/libosgUtil.dylib 
(compatibility version 1.0.0, current version 1.0.0)
/Users/jmt/Code/OSG/build-release/lib/Release/libosg.dylib 
(compatibility version 1.0.0, current version 1.0.0)
/Users/jmt/Code/OSG/build-release/lib/Release/libOpenThreads.dylib 
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 111.1.1)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon 
(compatibility version 2.0.0, current version 136.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL 
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL 
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current 
version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current 
version 1.0.0)


You can also set your OSG_FILE_PATH to point to the 
OpenSceneGraph-Data directory if you don't want to keep typing that 
path.


Yep,. had actually done that, hadn't realised it worked for command 
line args as well.


So, bit of a mystery. I guess I'll build debug, see if I get the same 
issue, then step through the osgDB plugin loading code.
Yes, strange. Let me know what you find. It bothers me that it's not 
Just Working (TM). Are you using Carbon or X11 for OSG_WINDOWING_SYSTEM? 
What is CMAKE_OSX_ARCHITECTURES set to?


Has anyone else tried building and using the recent release on OSX?

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


Re: [osg-users] Coordinate system mapping from WTK to OSG...

2008-08-08 Thread Jason Daly

[EMAIL PROTECTED] wrote:

So, if anyone out there has experience of mapping from WTK to OSG, specifically 
in regards to what should happen to rotation angles, and quarternians, I would 
be most grateful - and perhaps my wall could then be repainted beige instead of 
red ;-(
  


I don't know about OSG to WTK specifically, but I might have a suggestion.

When translating an orientation (or more specifically,  a rotation) from 
one coordinate system to another, the correct procedure is to first 
convert from your target coordinate system to your original coordinate 
system, then apply the rotation, then convert back.  So


 -1
R' = M * R * M


Where R' is the desired rotation in OSG coordinates, R is the rotation 
in WTK coordinates, and M is the conversion matrix (or quat) from WTK 
coordinates to OSG coordinates.


Now, usually when I explain this, I get the ordering wrong, so if it 
doesn't work first try, just try reversing the order  :-)


Hope this helps!

--J

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


[osg-users] Has something changed regarding some of the plugin builds (the net plugin in particular) that might affect a Cygwin/Windows build

2008-08-08 Thread Brian Keener
I have good news as far as Cygwin and OSG.  Cygwin has been doing a lot 
of work on max file name lengths and the like and with a recent cvs 
update of Cygwin and a recent svn of OSG it appears the hangs at the 
termination of some of the examples has gone away.  They appear to be 
closing normally now.  I am not sure what else has changed but I had 
read some on Cygwin and socket use and found an article on their forums 
about mixing Windows winsock libs with Cygwin sockets which attempt to 
emulate unix sockets I believe and I will say right here I do not 
understand a lot about sockets but was beginning to wonder from what I 
read if this might be an issue.  Actually I do believe that whether it 
be sockets or something else I do believe it may be that the hangs were 
related to something being mixed from the Windows world vs the Unix 
world since Cygwin sort of lives in both.

That said I had commented the line in CMakeLists.txt that set 
OSG_SOCKET_LIB (wsock32)  and that was when I realized that the 
examples were terminating normally and I realized that libs like the 
net plugin had not been built and the line I commented is even 
mentioned in CMakeLists.txt in relation to the net plugin so I assumed 
they were related.  So to test a theory it was socket problem I put the 
line back and rebuilt - still no hang - examples terminate normal and 
still no net plugin - plus others.  So now I wonder if something else 
change in OSG that would keep these from building or what setting(s) 
might have something to do with why they would not build.

Sometimes I can't leave well enough alone - can't be glad it is fixed 
now I have to know how to break it again or what might have fixed it 
permanent.

bk



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


Re: [osg-users] Has something changed regarding some of the plugin builds (the net plugin in particular) that might affect a Cygwin/Windows build

2008-08-08 Thread Jean-Sébastien Guay

Hi Brian,

So to test a theory it was socket problem I put the 
line back and rebuilt - still no hang - examples terminate normal and 
still no net plugin - plus others.  So now I wonder if something else 
change in OSG that would keep these from building or what setting(s) 
might have something to do with why they would not build.


I believe the net plugin has been deprecated in favor of the curl 
plugin. Correct me if I'm wrong.


If you have libcurl, then you might just have built a curl plugin. In 
that case, try to load a file from the net 
(http://example.com/whatever.osg) and see if that works.


Other than that, I don't know, since I don't use cygwin myself. What 
other plugins are missing?


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] X model files

2008-08-08 Thread Franclin Foping
Dear All,
 I would like to know if it is possible to convert a 3Ds model to the X 
counterpart with the osgDB library.
 My first attempt is as follows:
 1 - Load the model with the readNodeFile(nameofthemodel.3ds) method
 2 - Create the X model file with the writeNodeFile(*node, nameostheXmodel.x) 
method
But it doesn't work for X files, although the same program works very well if I 
want to create an OBJ file. So I suspect it has something to do with X files. 
 Does anyone have a clue of what is going on?
 Waiting for your reply as usual.
 Franclin.
   
-
 Envoyé avec Yahoo! Mail.
Une boite mail plus intelligente. ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg4web, Virtual Rome and Siggraph

2008-08-08 Thread sofia pescarin
 Here is to announce the first release of *osg4web project*.

OSG4web is the result of a CINECA and CNR ITABC effort to provide a
framework for in-browser opengl-based application wrapping.
The framework allow the development of Opengl and OSG based applications tha
open windows within the browsers, allowing javascript bidirectional
interaction with surrounding page elements. Currently the supported browsers
are Firefox and IE and  OS platform is Windows XP-Vista. Nevertheless, most
part of the code is OS neutral.

The name derive from the history of the project that tried to revive osgax
activeX wrapping.
The projects started to fill the need of web-enabled 3d terrain and
geo-spatial data abrowsing in a pre-google-Earth time.

The project is still in progress but it seems enough solid to be worth to be
exposed to  the community.

One of the main goal of this release is the de-coupling of the application
specific (and even rendering engine specific) code from the browser related
code.

This release of the plugin allow  run-time loading of different application
cores at the web page opening, so allowing the same installed plugin to
brows pages that require completely different application codes.

In the CVS repository there are few osg and opengl example cores that can be
browsed independently.

The main plugin (shell) provide functions to runtime downloadind and sign
checking (SHA or MD5) application cores

Currently the main demo application is a landscape model of part of Rome
both actual and roman age.
VirtualRome project is still in progress.

*More info at http://www.virtualrome.itabc.cnr.it
*
* The code is available at*  cvs -d
:pserver:[EMAIL PROTECTED]/cvsroot/unigrids co
projects/osg/cineca/web/osg4web_r2

The code is released as GPL for the part (shell) that links with the
browsers code and LGPL for the cores that link against OSG This kind of
licensing should allow anyone to use for developing Open or Closed source
web app (cores) that can be dynamically loaded by the common open source
Browser plugin (shell).
The GPL licensing of this component is intended to promote sharing of the
infrastructure code.

If someone is attending Siggraph, we can arrange for a meeting at poster
session, where we are presenting the Virualrome project

We will be also attend at OSG Bof

For any commnets or questions contact:

Luigi Calori
[EMAIL 
PROTECTED]https://webmail.sic.rm.cnr.it/horde/imp/message.php?index=88297#
Carlo Camporesi   [EMAIL PROTECTED]
Sofia Pescarin  [EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] 回复: Re: ���澶� �?Re: About viewer.addEventHandler(new PickHandler( ))?

2008-08-08 Thread YangXiao
Thanks!   Jean-Sebastien I   write originally code as you descripe.But 
   
  case(osgGA::GUIEventAdapter::PUSH):
{
// ... do what you want here
  I modify  my scene  node example , node-removechild(1);
   node-addchild(new node);
  
return false;
}
// Mouse button release
case(osgGA::GUIEventAdapter::RELEASE):
{
// ... do what you want here
   
  node-removechild(1);
  node-addchild(new node);
  
return false;
}

  But this code sometimes success,sometimes fail! I means code run sequence:
  1: PickHandler's pick() code;
  2: draw scene code;
  or they run parallel?
   
  Thanks again.

Jean-Sébastien Guay [EMAIL PROTECTED] 写道:
  Hello YangXiao,

 2. I have another question, when viewer.frame() which thread 
 listening windows message(example mouse clicked,keyboard down ,up etc) 
 ,and when 
 i update my scene node in updatecallback,How threads guarantee sequence?

To avoid threading problems I suggest you use an EventHandler to do this.

For example:

class MyEventHandler : public osgGA::GUIEventHandler
{
public:

MyEventHandler() {}

~MyEventHandler() {}

bool handle(const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter aa)
{
switch(ea.getEventType())
{
// Mouse button press
case(osgGA::GUIEventAdapter::PUSH):
{
// ... do what you want here
return false;
}
// Mouse button release
case(osgGA::GUIEventAdapter::RELEASE):
{
// ... do what you want here
return false;
}
default:
return false;
}
}
};

Then add this handler to the viewer:

viewer.addEventHandler(new MyEventHandler);

See the osgpick example for an example of a mouse event handler, and the 
osgkeyboard example for a keyboard event handler - of course you can 
combine both if you want (the same handle() method can be used for mouse 
and keyboard events). See the docs for the return values of 
ea.getEventType().

I suggest you read the OSG Quick Start Guide (free from 
http://www.osgbooks.com/) and then go around the reference docs 
(http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/) 
and the many included examples in the OSG source tree to get a feel for 
things. These are pretty basic questions that you could answer yourself 
by reading a bit (not that we don't want to answer them, but you'll wait 
longer for an answer).

J-S
-- 
__
Jean-Sebastien Guay [EMAIL PROTECTED]
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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Siggraph Web3D and related technologies BOFs at a glance

2008-08-08 Thread John F. Richardson
Hello,

I'll bring the CTK (cloning toolkit) to Siggraph.

John F. Richardson

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jean-Sébastien Guay
Sent: Friday, August 08, 2008 6:21 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Siggraph Web3D and related technologies BOFs at a
glance

Hi John,

 Open Scengraph is
 sort of the Open Inventor functional clone that has a totally free 
 license and is a Web3D technology
 [hope this assessment is reasonably correct].

For that last part, I think I saw someone doing a web browser plugin 
that uses OSG to display objects/environments in a web page, streaming 
the content over the net. I can't remember who or find a link though. 
Perhaps someone else will be able to refresh my memory.

But other than that, OSG can read some Web3D formats, and perhaps more 
in the future (if the new OpenVRML library is integrated).

 I do have a “pocket universe” with 29 hours per day 
 for those that have to attend more BOF’s.

I like your sense of humor. :-) If only that were possible... When 
making my Siggraph schedule I had a massive 4-way conflict on Wednesday, 
and another smaller conflict on Thursday. It was a hard choice to make. 
So much to see, and I can't clone myself...

J-S
-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 回复: Re: 鍥炲�?Re : About viewer.addEventHandler(new PickHandler()) ?

2008-08-08 Thread Jean-Sébastien Guay

Hello YangXiao,


But this code sometimes success,sometimes fail! I means code run sequence:
1: PickHandler's pick() code;
2: draw scene code;
or they run parallel?


Yes indeed, they may run in parallel depending on your threading model. 
What you can do is set your node's datavariance to DYNAMIC. That will 
prevent that specific node's update/cull/draw to happen while another 
thread is doing things too.


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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