Re: [osg-users] Calling drawImplementation manually on aosgText::Text object

2007-08-28 Thread Robert Osfield
Hi John,

osgText::Text doesn't need an update traversal to sync itself after an
update, so it should be possible to update the text, draw the text,
update the text etc.  As to why this doesn't work in your case I do
not know, its hardly a part of design spec for osgText.

I would however suggest if you have multiple text entries on a single
then use multiple text objects.

Robert.

On 8/27/07, Argentieri, John-P63223 [EMAIL PROTECTED] wrote:
 Hi Robert.

 I got it to work a little bit better. I want our user to be able to call
 this multiple times on a single post-draw event. The way it is now, I am
 able to call the underlying osgText object's drawImplementation once and
 it looks correct. The next time I call it, however, all I get is a
 series of squares where my letters should be. I am guessing that this is
 because it must receive a visitor on the update traversal or something.
 Is there a way I can get around this too?

 Thanks for all of your help over the last several months!

 John

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Robert
 Osfield
 Sent: Monday, August 27, 2007 3:33 PM
 To: osg-users@lists.openscenegraph.org
 Subject: Re: [osg-users] Calling drawImplementation manually on
 aosgText::Text object

 Hi John,

 The closest code to what you are trying to achieve can be found in the
 osgProducer projects src/osgProducer/ViewerEventHandler.cpp where is
 sets up the and renders the stats and help.

 In 2.x and osgViewer's stats and help I just go ahead and use a full
 blown scene graph as it makes more things just more straight forward.

 Robert.

 On 8/27/07, Argentieri, John-P63223 [EMAIL PROTECTED] wrote:
 
 
 
  Hello all, and long time no see!
 
  I am trying to create an osgText::Text object and call
  drawImplementation on it manually. I think it is almost working. Here
  is how I am setting up the RenderInfo that I am passing in:
 
   spState = new osg::State();
   spViewState =
  spSceneView-getRenderInfo().getState();
   if( spViewState.valid() )
   {
  spState-setGraphicsContext(
  spViewState-getGraphicsContext() );
  spState-setContextID( spViewState-getContextID() );
   }
   renderInfo = osg::RenderInfo( spState.get(),
  spSceneView-getView() );
 
  The problem is, that the textures are being lost. Can anyone help me
  to accomplish this without adding the osgText::Text to the sceneview's

  scene data?
 
 
  Much appreciated!
  John
  ___
  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.or
 g
 ___
 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] Fitting Viewer's Camera To New Scene

2007-08-28 Thread Robert Osfield
HI Nick,

Try getting the camera manipulator to recompute its home position when
you change the scene via:

   viewer.getCameraManipulator()-computeHomePosition();

Or just set it manuual via:

   viewer.getCameraManipulator()-setHomePosition(...);



On 8/28/07, Nick Prudent [EMAIL PROTECTED] wrote:

 OK,

 I've tried redefining the manipulator directly and I tried with the main 
 camera. Both methods fail to actually update the trackball's center  radius.

 Ex:

 m_rpMainCamera-setViewMatrixAsLookAt( vnew_eye, vnew_center, vnew_up );

 or...

 m_rpTerrainManipulator-setHomePosition( vnew_eye,v new_center, vnew_up );

 What's the recommended way to do this?

 Thanks,

 - Nick -

 
  How can I make sure an object fits inside a camera view after loading a new 
  scene. All the examples load scenes and Viewer/Camera at startup. I want to 
  add nodes to an existing scene; not create a new one.
  My OSG tree looks like this:
 + File 1
 |
   + Scene + File 2
   ||
   |+ File ...
  Root +
   |
   + Grid
   |
   + Axis
   |
   + HUD Camera
  (Both Root and Scene are Switch groups, so I can selectively show/hide 
  their children)
  The problem is that whenever I load a new file/node, it doesn't always show 
  up on screen. My guess is that some objects are outside the view volume. I 
  could write a simple function to update Scene's bounds and make sure they 
  fall within the fustrum, but I'm sure there's an existing method to do 
  this...
  - Nick -

 _
 Connect to the next generation of MSN Messenger
 http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-ussource=wlmailtagline
 ___
 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] Max 9 Crashing

2007-08-28 Thread Robert Osfield
On 8/28/07, Serge Lages [EMAIL PROTECTED] wrote:
 Just an idea I had reading this : shouldn't be possible to host OSGExp on
 the osgforge ?

Yes it should be possible.  We'll need Jose to check for permission to
host another project on server as part of the osgforge.

In general I'd like to see the osgforge become a home for commonly
used adds onto to the OSG, so users can browse the forge and find the
various projects hosted in similar ways, so people don't have to go
relearn how each project is put together.

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


Re: [osg-users] Max OS X tutorial videos, broken links (was: RE: Tutorials)

2007-08-28 Thread Robert Osfield
Hi Eric,

On 8/28/07, E. Wing [EMAIL PROTECTED] wrote:
 I found my copies of the videos if you still need them. I experimented
 with uploading them to YouTube, but YouTube broadcasts in too low of a
 resolution which makes it impossible to read anything, so it's pretty
 much useless except for pointing people to the OSG site for higher
 quality videos.

Great to hear you've tracked the video down.  You could either just
attach them to the page on the wiki, or perhaps get them upload to the
downloads page.

Hopefully Jose will be reading this and can suggest a good method for
upload big amounts of data to directories like /downloads.

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


Re: [osg-users] Max 9 Crashing

2007-08-28 Thread David Callu
Hi all

osgDesigner is temporally suspended due to my end-study internship.
But it finishs at the end of august. (in 3 day)
The project is out of date and I am starting a new design
(osgIntrospection is immoderately used and interface is not really
intuitive).
So this will take a while before having a new release.

But I will be proud if osgDesigner was to be host on osgforge.

I could use it to develop the next release and to find contributors ...
:-)

Thoughts?

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


Re: [osg-users] Fitting Viewer's Camera To New Scene

2007-08-28 Thread Robert Osfield
Hi Nick,

Sorry forgot to mention, these calls just set the home position, they
don't actually move the camera to the home position.  To move the
camera to the home position simply do:

  viewer.home();

Robert.

On 8/28/07, Nick Prudent [EMAIL PROTECTED] wrote:

 Robert,

 This doesn't work. The view stays the same. Maybe I should destroy the 
 Terrain Manipulator and attach a new one the view...I've ran out of options.

 - Nick -


 
  Date: Tue, 28 Aug 2007 09:58:41 +0100
  From: [EMAIL PROTECTED]
  To: osg-users@lists.openscenegraph.org
  Subject: Re: [osg-users] Fitting Viewer's Camera To New Scene
 
  HI Nick,
 
  Try getting the camera manipulator to recompute its home position when
  you change the scene via:
 
 viewer.getCameraManipulator()-computeHomePosition();
 
  Or just set it manuual via:
 
 viewer.getCameraManipulator()-setHomePosition(...);
 
 
 
  On 8/28/07, Nick Prudent  wrote:
  
   OK,
  
   I've tried redefining the manipulator directly and I tried with the main 
   camera. Both methods fail to actually update the trackball's center  
   radius.
  
   Ex:
  
   m_rpMainCamera-setViewMatrixAsLookAt( vnew_eye, vnew_center, vnew_up );
  
   or...
  
   m_rpTerrainManipulator-setHomePosition( vnew_eye,v new_center, vnew_up );
  
   What's the recommended way to do this?
  
   Thanks,
  
   - Nick -
  
   
How can I make sure an object fits inside a camera view after loading a 
new scene. All the examples load scenes and Viewer/Camera at startup. I 
want to add nodes to an existing scene; not create a new one.
My OSG tree looks like this:
   + File 1
   |
 + Scene + File 2
 ||
 |+ File ...
Root +
 |
 + Grid
 |
 + Axis
 |
 + HUD Camera
(Both Root and Scene are Switch groups, so I can selectively show/hide 
their children)
The problem is that whenever I load a new file/node, it doesn't always 
show up on screen. My guess is that some objects are outside the view 
volume. I could write a simple function to update Scene's bounds and 
make sure they fall within the fustrum, but I'm sure there's an 
existing method to do this...
- Nick -
  
   _
   Connect to the next generation of MSN Messenger
   http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-ussource=wlmailtagline
   ___
   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

 _
 Discover the new Windows Vista
 http://search.msn.com/results.aspx?q=windows+vistamkt=en-USform=QBRE
 ___
 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] Fitting Viewer's Camera To New Scene

2007-08-28 Thread Nick Prudent

Found this recent thread on changing the camera position:

http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/15567/match=change+camera+position

The solution mentionned goes like this:

---

From: Matteo Campana 
Subject: Re: Change camera position
Newsgroups: gmane.comp.graphics.openscenegraph.user
Date: 2007-06-21 13:50:19 GMT (9 weeks, 4 days, 19 hours and 6 minutes ago)
Thank you for reply…
..now I can change the position of the camera.

I write here how I change the position…hope it can help:

ChangePosition (osg::Node *node){
const osg::BoundingSphere boundingSphere= node-getBound();
osg::Matrix myviewMatrix;
osg::Vec3 eye = boundingSphere._center+osg::Vec3( 0.0f,-3.5f * 
boundingSphere._radius, 0.0f);
osg::Vec3 center = boundingSphere._center;
osg::Vec3 up =  osg::Vec3(0.0f,0.0f,1.0f);
myviewMatrix.makeLookAt(eye,center,up);
this-GetViewer()-setView(myviewMatrix);
}

Thanks!!! 

Matteo

---

Needless to say, it didn't work either...For starter, there's no such thing as 
osg::Viewer::setView(). I can't be the first person wanting to reset the camera 
manipulators after loading a file...

- Nick -

 
 
 OK,
 
 I've tried redefining the manipulator directly and I tried with the main 
 camera. Both methods fail to actually update the trackball's center  radius.
 
 Ex:
 
 m_rpMainCamera-setViewMatrixAsLookAt( vnew_eye, vnew_center, vnew_up );
 
 or...
 
 m_rpTerrainManipulator-setHomePosition( vnew_eye,v new_center, vnew_up ); 
 
 What's the recommended way to do this?
 
 Thanks,
 
 - Nick -
 
  
  How can I make sure an object fits inside a camera view after loading a new 
  scene. All the examples load scenes and Viewer/Camera at startup. I want to 
  add nodes to an existing scene; not create a new one.
  My OSG tree looks like this:
 + File 1
 |
   + Scene + File 2
   ||
   |+ File ...
  Root +
   |
   + Grid
   |
   + Axis
   |
   + HUD Camera
  (Both Root and Scene are Switch groups, so I can selectively show/hide 
  their children)
  The problem is that whenever I load a new file/node, it doesn't always show 
  up on screen. My guess is that some objects are outside the view volume. I 
  could write a simple function to update Scene's bounds and make sure they 
  fall within the fustrum, but I'm sure there's an existing method to do 
  this...
  - Nick -
 
 _
 Connect to the next generation of MSN Messenger 
 http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-ussource=wlmailtagline
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+worldmkt=en-USform=QBRE
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Fitting Viewer's Camera To New Scene

2007-08-28 Thread Nick Prudent

Thanks Robert,

* Using setHomePosition(...) + home() did the trick.  Yes!

* Using computeHomePosition() + home() pointed somewhere in space...

I'm wondering if I can move from one place to the next on my terrain data using 
this technique...Trying it right now...

Regards,

- Nick -  

_
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Calling drawImplementation manually onaosgText::Text object

2007-08-28 Thread Argentieri, John-P63223
Robert,

If I have view frustum culling enabled, and I put the text on the screen
using native glOrtho() calls, but the text's transform only contains a
screen coordinate, would it get wiped out because of that? Should I be
using osg's transforms to make the HUD text? I think maybe it is being
culled when in fact it is being drawn on the screen using OpenGL
transforms. Does this sound feasible?

John 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Tuesday, August 28, 2007 4:48 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Calling drawImplementation manually
onaosgText::Text object

Hi John,

osgText::Text doesn't need an update traversal to sync itself after an
update, so it should be possible to update the text, draw the text,
update the text etc.  As to why this doesn't work in your case I do not
know, its hardly a part of design spec for osgText.

I would however suggest if you have multiple text entries on a single
then use multiple text objects.

Robert.

On 8/27/07, Argentieri, John-P63223 [EMAIL PROTECTED] wrote:
 Hi Robert.

 I got it to work a little bit better. I want our user to be able to 
 call this multiple times on a single post-draw event. The way it is 
 now, I am able to call the underlying osgText object's 
 drawImplementation once and it looks correct. The next time I call it,

 however, all I get is a series of squares where my letters should be. 
 I am guessing that this is because it must receive a visitor on the
update traversal or something.
 Is there a way I can get around this too?

 Thanks for all of your help over the last several months!

 John

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Robert Osfield
 Sent: Monday, August 27, 2007 3:33 PM
 To: osg-users@lists.openscenegraph.org
 Subject: Re: [osg-users] Calling drawImplementation manually on 
 aosgText::Text object

 Hi John,

 The closest code to what you are trying to achieve can be found in the

 osgProducer projects src/osgProducer/ViewerEventHandler.cpp where is 
 sets up the and renders the stats and help.

 In 2.x and osgViewer's stats and help I just go ahead and use a full 
 blown scene graph as it makes more things just more straight forward.

 Robert.

 On 8/27/07, Argentieri, John-P63223 [EMAIL PROTECTED] wrote:
 
 
 
  Hello all, and long time no see!
 
  I am trying to create an osgText::Text object and call 
  drawImplementation on it manually. I think it is almost working. 
  Here is how I am setting up the RenderInfo that I am passing in:
 
   spState = new osg::State();
   spViewState =
  spSceneView-getRenderInfo().getState();
   if( spViewState.valid() )
   {
  spState-setGraphicsContext(
  spViewState-getGraphicsContext() );
  spState-setContextID( spViewState-getContextID() );
   }
   renderInfo = osg::RenderInfo( spState.get(),
  spSceneView-getView() );
 
  The problem is, that the textures are being lost. Can anyone help me

  to accomplish this without adding the osgText::Text to the 
  sceneview's

  scene data?
 
 
  Much appreciated!
  John
  ___
  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.
 or
 g
 ___
 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.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Calling drawImplementation manually onaosgText::Text object

2007-08-28 Thread Robert Osfield
Hi John,

I'm afraid I don't follow.  Please have a look at examples like
osghud, or the way that HUDs are done for the stats/help handlers.

Robert.

On 8/28/07, Argentieri, John-P63223 [EMAIL PROTECTED] wrote:
 Robert,

 If I have view frustum culling enabled, and I put the text on the screen
 using native glOrtho() calls, but the text's transform only contains a
 screen coordinate, would it get wiped out because of that? Should I be
 using osg's transforms to make the HUD text? I think maybe it is being
 culled when in fact it is being drawn on the screen using OpenGL
 transforms. Does this sound feasible?

 John

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Robert
 Osfield
 Sent: Tuesday, August 28, 2007 4:48 AM
 To: osg-users@lists.openscenegraph.org
 Subject: Re: [osg-users] Calling drawImplementation manually
 onaosgText::Text object

 Hi John,

 osgText::Text doesn't need an update traversal to sync itself after an
 update, so it should be possible to update the text, draw the text,
 update the text etc.  As to why this doesn't work in your case I do not
 know, its hardly a part of design spec for osgText.

 I would however suggest if you have multiple text entries on a single
 then use multiple text objects.

 Robert.

 On 8/27/07, Argentieri, John-P63223 [EMAIL PROTECTED] wrote:
  Hi Robert.
 
  I got it to work a little bit better. I want our user to be able to
  call this multiple times on a single post-draw event. The way it is
  now, I am able to call the underlying osgText object's
  drawImplementation once and it looks correct. The next time I call it,

  however, all I get is a series of squares where my letters should be.
  I am guessing that this is because it must receive a visitor on the
 update traversal or something.
  Is there a way I can get around this too?
 
  Thanks for all of your help over the last several months!
 
  John
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
  Robert Osfield
  Sent: Monday, August 27, 2007 3:33 PM
  To: osg-users@lists.openscenegraph.org
  Subject: Re: [osg-users] Calling drawImplementation manually on
  aosgText::Text object
 
  Hi John,
 
  The closest code to what you are trying to achieve can be found in the

  osgProducer projects src/osgProducer/ViewerEventHandler.cpp where is
  sets up the and renders the stats and help.
 
  In 2.x and osgViewer's stats and help I just go ahead and use a full
  blown scene graph as it makes more things just more straight forward.
 
  Robert.
 
  On 8/27/07, Argentieri, John-P63223 [EMAIL PROTECTED] wrote:
  
  
  
   Hello all, and long time no see!
  
   I am trying to create an osgText::Text object and call
   drawImplementation on it manually. I think it is almost working.
   Here is how I am setting up the RenderInfo that I am passing in:
  
spState = new osg::State();
spViewState =
   spSceneView-getRenderInfo().getState();
if( spViewState.valid() )
{
   spState-setGraphicsContext(
   spViewState-getGraphicsContext() );
   spState-setContextID( spViewState-getContextID() );
}
renderInfo = osg::RenderInfo( spState.get(),
   spSceneView-getView() );
  
   The problem is, that the textures are being lost. Can anyone help me

   to accomplish this without adding the osgText::Text to the
   sceneview's
 
   scene data?
  
  
   Much appreciated!
   John
   ___
   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.
  or
  g
  ___
  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.or
 g
 ___
 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] add JobRequest section on the wiki

2007-08-28 Thread Robert Osfield
Hi David,

On 8/28/07, David Callu [EMAIL PROTECTED] wrote:
 I would like to create a new section on OSG wiki.

 As well the JobOffers section, it could be interesting
 to create a JobRequests section allowing young graduates (like me),
 who like and use OpenSceneGraph, to find a job in their areas of
 expertise.

 Thought ?

Feel free to do this.  Don't forget to add things to the new wiki not
the old pmwiki one ;-)

Just go to http://www.openscenegraph.org and it'll direct you to the
right place.

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


Re: [osg-users] Callbacks....

2007-08-28 Thread Paul Martz
You should read Design Patterns and familiarize yourself with the callback
pattern.
 
OSG calls operator()() as part of the callback process. You insert code into
that method to do whatever you need to do in your callback.
   -Paul
 
 
  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Renan
Mendes
Sent: Tuesday, August 28, 2007 6:24 AM
To: OSG Mailing List
Subject: [osg-users] Callbacks



Hello, everyone.

As usual, I'm going to ask some very basic questions.

I've been reading a source code set as an example, which was made to teach
callbacks, but I couldn't find out exactly what each method does. I'm
ataching the code so you can answer my most serious doubts: 

- What does operator () (...) does?
- What is the intention on multiplying matrices osg::Matrix::rotate(...) *
osg::Matrix::translate?

Thank you.

Renan M Z Mendes


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


[osg-users] Problem with CulCallBack And Muti Cameras

2007-08-28 Thread wangmiao
Hello every one:
 I meet's a problem when using CullCallback with muti cameras. I use 
cullcallback to custom the cull traversal .
Is it possible to know which camera is currently been travrse in 
cull(osg::NodeVisitor* nv, osg::Drawable* drawable, osg::State* s)const 
implenment? 
With this infomation I can enable the cullcallback for main camera an disable 
it for others.
  Thank you for any sugestions .

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


Re: [osg-users] Is text thread safe in 2.0.0?

2007-08-28 Thread Robert Osfield
Hi Uwe,

Submissions via osg-user run the risk of being missing, the right
place to submit is via osg-submissions.

In this instance I've reviewed your changes but have held back from
merging as I want to establish exactly what parts are breaking before
see changes applied.  I also note that your Font.cpp is rather out of
date relative to the one in SVN.

Robert.

On 8/27/07, Uwe Woessner [EMAIL PROTECTED] wrote:
 Hello Robert

 you might try out the modification to font.cpp which I submitted a while
 ago to this list. (see attachment font.zip)
 The node you are modifying might not be rendered but the font it uses
 is modified during rendering of other text nodes which use the same font.
 I added a scope lock to addGlyph. The file might have changed since then
   so only copy the scope lock.
 addGlyph is only called when characters are rendered for the first time
 so it should not be too much of a performance issue, right?

   Uwe

   Osfield wrote:
  Hi Robert,
 
  On 8/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  We are trying to port an osg 1.2 app to 2.0, and we
  frequently get crashes when one thread (which is
  building an osg scene that is not yet being rendered)
  tries to access fonts while the rendering thread is
  rendering text.
 
  Another user recently reported problems with loading text in a
  background thread, which fits your problem too.  This was recently and
  with the SVN version of the OSG so it looks like the problem persists.
 
  I suspect the problem is either in src/osgText/Font.cpp or the
  freetype plugin, or freetype itself.  If we can pinpoint where the
  problem it should be easy to fix - something like adding a mutex to
  serialize the freetype API access.
 
  I don't have an app that recreates this problem with rather limits my
  ability to reproduce and fix it.  So I either need an example that
  reproduces the problem or for others to dig into the relevant code and
  fix it.
 
  Also, on a possibly related note, what happened to
  viewer.sync() in osg 2.0?  There doesn't seem to be
  anything to replace it.  Is it no longer necessary?
 
  viewer.sync() is no longer required.  The sync is effectively done
  inside the Viewer::renderingTraversals() method which is dispatched by
  Viewer:frame().  The updateTraversal() is also could from within
  frame() as well so one needn't call this either unless you want to
  replace frame() call by it consitient parts.
 
  Robert.
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 


 --

 \\\|/// *HLRS, High Performance Computing Center Stuttgart*
   _I_   ( o o )*Visualization/VR* _I_
 ([EMAIL 
 PROTECTED])--oo0O--(_)--O0oo--([EMAIL 
 PROTECTED])
   | |Uwe Woessner [EMAIL PROTECTED]| |
   | |   .ooo0   http://www.hlrs.de/people/woessner/   | |
   |_|   (   )  Oooo. Phone: +49-711-6856-5790 or ...-5970 |_|
 ([EMAIL PROTECTED])---\ (---(   
 )-([EMAIL PROTECTED])
I  \_)   ) /I
(_/

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

2007-08-28 Thread Brad Colbert
I think I found it on andesengineering.com.  I hope it's the correct
version.

-B
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brad
Colbert
Sent: Tuesday, August 28, 2007 8:31 AM
To: [EMAIL PROTECTED]
Subject: [osg-users] osgEphemeris

Hi Folks,

I guess this goes out to Don Burns.  How do I get the most recent
version of osgEphemeris.  CVS is reporting that it can't connect to the
address on your site.  I also have a few things to contribute.

Thanks,

-B

---
Brad Colbert
Renaissance Sciences Corporation
W: 480 290-3997
F: 425 675-8044


___
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] Is text thread safe in 2.0.0?

2007-08-28 Thread Robert Osfield
To help in the process of isolating and fixing the osgText threading
issues users have seen I have modified the osgtext example to do text
creation in a background thread.  You can now run it via:

  osgtext --mt

What you will see on screen is a box with text strings randomly
appearing/disappearing in the box.

As yet I haven't see any crashes due to the font glyphs being queried
at the same time the text is being updated - which was the point of
the example code...  These are the ones Ewe's changes look like they
might address.

I have also added the stats handler into the example to allow us to
see the performance, but also by coincidence it adds a failure mode -
when you enable stats freetype errors start appearing.  These errors
look to be down to freetype being based around a state model where one
of threads is setting the sizes and current fonts to one thing and the
other thread is try at the same time to set them to another.
Freetype itself might not be thread safe either, but my current feel
is that we might need more than just serializing access to freetype,
we'll need to group several operations at once and serialize these
batches.

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


Re: [osg-users] Problem with CulCallBack And Muti Cameras

2007-08-28 Thread Robert Osfield
HI Wangmio,

I'm not really sure what you are after, could you explain at a higher
level what you are trying to achieve with cull callbacks.

Robert.

On 8/28/07, wangmiao [EMAIL PROTECTED] wrote:
 Hello every one:
  I meet's a problem when using CullCallback with muti cameras. I use 
 cullcallback to custom the cull traversal .
 Is it possible to know which camera is currently been travrse in 
 cull(osg::NodeVisitor* nv, osg::Drawable* drawable, osg::State* s)const 
 implenment?
 With this infomation I can enable the cullcallback for main camera an disable 
 it for others.
   Thank you for any sugestions .
   
Wangmiao
 ___
 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] Max 9 Crashing

2007-08-28 Thread André Rocha Tomasi
Farshid, thanks a lot! You really saved me a hell lot of time, now I can
continue the project.

Thanks again,

[ ]´s

André

2007/8/27, Farshid Lashkari [EMAIL PROTECTED]:

 On 8/24/07, André Rocha Tomasi [EMAIL PROTECTED] wrote:
  Anyone using 3D Max 9 has been suffering with crashes when using the
  openscenegraph commands? Like trying to create a sequence helper,
 crashes
  Max 3 out of 4 tries. Same for creating billboards and other items.

 I also experienced the same problem here. I submitted a patch to the
 OSGExp sourceforge page that fixed the issue. You can get it there and
 rebuild the exporter. You can also download   a windows installer
 which already contains the fix here:

 http://www.worldviz.com/download/files/OSGExp0.9.3Install.exe

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




-- 
André Rocha Tomasi
GRV - Virtual Reality Group
PUCRS - Projeto Aeromóvel
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Review: osgDB::DatabasePager

2007-08-28 Thread Robert Osfield
Hi Adrian,

W.r.t ATI's and VetexArrays (VA) vs DisplayLists (DL), rather than
OSX, I'm certainly open to this change, but... one awkward aspect is
that one doesn't know the graphics  hardware available until you have
a valid graphics context.  Potentially you might even have several
cards form different vendors!   The choice of whether to use VA or DL
would have to be done by the viewer, rather than the constructor of
DatabasePager.  This should relatively straight forward to do,
something that could be done in somewhere like Viewer::realize().

W.r.t using a std::map rather than conventional list to speed up the
file request lookup.  One sticking point is the the lists are
currently sorted by priority and this is key to the pagers ability to
make sure the most important tiles get merged first.  So to do an
efficient lookup one would have to create a separate
mapstd::string,DatabaseRequest*, this will complicate some of the
code, but I guess it should still be possible to do this would too
many intrusive changes.

Robert.

On 8/28/07, Adrian Egli [EMAIL PROTECTED] wrote:
 i did a review of osgDB::DatabasePager and got some questions, or
 remarks

 ***
  ../src/osgDB/DatabasePager.cpp @ Ln72

 #if __APPLE__
 // OSX really doesn't like compiling display lists, and performs poorly
 when they are used,
 // so apply this hack to make up for its short comings.
 _drawablePolicy = USE_VERTEX_ARRAYS;
 #else
 _drawablePolicy = DO_NOT_MODIFY_DRAWABLE_SETTINGS;
 #endif


 I don't believe that this is just an __APPLE__ performance problem. The
 problem is that on ATI Cards,
 most of APPLE OS/X computers are based on ATI, nowadays latest MacBooks Pro
 have NVIDIA, but most Apple
 Computers are based on ATI cards. And as we know, that on ATI DisplayList
 compiling is really poorly
 implemented, i propose to read vendors back from the graphics card, and if
 we were working on ATI based
 graphic system, we switch directly to vertex arrays.

 glVender.string.has(ATI) = vertex arrays

 ***
 ../src/osgDB/DatabasePager.cpp @ Ln290



 OpenThreads::ScopedLockOpenThreads::Mutex
 lock(_dataToCompileListMutex);

 for(DatabaseRequestList::iterator litr =
 _dataToCompileList.begin();
 litr != _dataToCompileList.end()  !foundEntry;
 ++litr)
 {
 if ((*litr)-_fileName==fileName)
 {
 foundEntry = true;
 (*litr)-_frameNumberLastRequest =
 frameNumber;
 (*litr)-_timestampLastRequest = timestamp;
 (*litr)-_priorityLastRequest = priority;
 ++((*litr)-_numOfRequests);
 }
 }

 ...


 if we have a huge database with many level of request, once had more than
 200(!) requests per frame [calls of requestNodeFile].
 then we have to walk trough the database say sum of i from 1:x = (x*(x+1) )/
 2, instead of log(x), i propse to use a
 std::map or a std::multimap instead of a std::list of database request. of
 course we will use more memory, but the performance can be increased.
 (called in each cull pass / at each frame ) = Time Critical
 ***



 /adegli


 ___
 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] osgviewerMFC example crash in 2.1.8

2007-08-28 Thread Ricko 3D
I'm still finding my way around OSG so I wanted to find out if this issue is
mine before I continue pulling my hair out. 

 

I downloaded and built OSG 2.1.8. I took the code from one of the examples
to test, prior to integrating OSG into my app. This is on WinXP SP2 x86 and
the dev env is VC++ in VS8.

 

- I created a new project using the code from the osgViewerMFC example. 

- It compiled fine in both release and debug and it launches with no issues.

- When I use the open command (from menu or toolbar) and direct it to any
test osg file, it crashes with both debug and release builds.

- I used the VS debugger to walk through and find the crash in the debug
build.

- Line 143 of optimizer.cpp caused an unhandled exception because node was
a NULL point.

- I walked up the call stack back into the osgViewerMFC code and found the
cause is that mModel in cOSG::InitSceneGraph (MFC_OSG.cpp) is also NULL.

- It turns out osgDB::readNodeFile, earlier in InitSceneGraph, returned a
NULL mModel even though the filename passed was valid.

 

To verify it wasn't my settings when creating the example project from
scratch I chose another example, specifically osgShadow example. I created a
new project added the source, compiled, and both debug and release work
perfectly.

 

Is this a known issue with osgViewerMFC? If not any suggestion on what might
be causing it?

 

Thanks!

Ricko

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


[osg-users] Alpha Transparency control

2007-08-28 Thread Robert Balfour
I want to put a stateset on top of a model subgraph to override the
alpha values of all its vertices, in order to have global control of the
model transparency. What's the appropriate way to set this up using
BlendFunc, BlendEquation, etc.?  Or is the only way to traverse the
subgraph and change all the alpha values of each vertex individually?

Thanks.


Bob.
-- 
Robert E. Balfour, Ph.D.
Exec. V.P.  CTO,  BALFOUR Technologies LLC
960 South Broadway, Suite 108, Hicksville NY 11801
Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgviewerMFC example crash in 2.1.8

2007-08-28 Thread Nick Prudent

I'm a newbie too and have had the same problem applying the MFC example to my 
own app. The problem was that wasn't giving a complete path. Use szPathName 
instead of szFilename from the MFC file dialog. 

Another way is to have the directory containning your data in your PATH 
environment variable.  This, however is not very elegant.

- Nick -



 From: [EMAIL PROTECTED]
 To: osg-users@lists.openscenegraph.org
 Date: Tue, 28 Aug 2007 13:18:52 -0400
 Subject: [osg-users] osgviewerMFC example crash in 2.1.8
 
 I’m still finding my way around OSG so I wanted to find out if this issue is 
 mine before I continue pulling my hair out.
 I downloaded and built OSG 2.1.8. I took the code from one of the examples to 
 test, prior to integrating OSG into my app. This is on WinXP SP2 x86 and the 
 dev env is VC++ in VS8.
 - I created a new project using the code from the “osgViewerMFC” example.
 - It compiled fine in both release and debug and it launches with no issues.
 - When I use the open command (from menu or toolbar) and direct it to any 
 test osg file, it crashes with both debug and release builds.
 - I used the VS debugger to walk through and find the crash in the debug 
 build.
 - Line 143 of “optimizer.cpp” caused an unhandled exception because node was 
 a NULL point.
 - I walked up the call stack back into the osgViewerMFC code and found the 
 cause is that mModel in cOSG::InitSceneGraph (“MFC_OSG.cpp”) is also NULL.
 - It turns out osgDB::readNodeFile, earlier in InitSceneGraph, returned a 
 NULL mModel even though the filename passed was valid.
 To verify it wasn’t my settings when creating the example project from 
 scratch I chose another example, specifically osgShadow example. I created a 
 new project added the source, compiled, and both debug and release work 
 perfectly.
 Is this a known issue with osgViewerMFC? If not any suggestion on what might 
 be causing it?
 Thanks!
 Ricko

_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Alpha Transparency control

2007-08-28 Thread Paul Martz
Take a look at glBlendColor in the blue book. In OSG, the BlendColor
StateAttribute provides glBlendColor support.
   -Paul


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Robert Balfour
 Sent: Tuesday, August 28, 2007 9:42 AM
 To: osg-users@lists.openscenegraph.org
 Subject: [osg-users] Alpha Transparency control
 
 I want to put a stateset on top of a model subgraph to 
 override the alpha values of all its vertices, in order to 
 have global control of the model transparency. What's the 
 appropriate way to set this up using BlendFunc, 
 BlendEquation, etc.?  Or is the only way to traverse the 
 subgraph and change all the alpha values of each vertex individually?
 
 Thanks.
 
 
 Bob.
 --
 Robert E. Balfour, Ph.D.
 Exec. V.P.  CTO,  BALFOUR Technologies LLC 960 South 
 Broadway, Suite 108, Hicksville NY 11801
 Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED] 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org

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


[osg-users] camera/cameraview questions

2007-08-28 Thread Carsten Scharfe
hi there,

do i understand the functionality of the cameraview node correct?

i assume, that cameraview is used to position the camera (and animate, of 
course)
within the scene, without having to manipulate view matrices directly.

but then how do i retrieve the actual viewing matrix, if the camera is 
positioned
by a cameraview?

what happens if geometry is attached as a child of a camera node?

maybe someone can help me out?

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


Re: [osg-users] IntersectVisitor question

2007-08-28 Thread Dave Pugmire
Wow, so this is odd. I found a way to fix this.
I was using a linesegment length of 2.0, as I had a 2 ft stick attached 
to the wand. But, if I make the linesegment longer, to a length of 
200.0, the intersection works like a charm.
Is this the intended behavior?

Dave Pugmire wrote:
 Hi,
 I'm scratching my head on this one.
 I have a line segment, that is aligned to the tracked wand. I'm trying 
 to intersect it with the scene, which is composed of a single box.
 However, the intersections that I get are not making sense.
 
 Here is the line segment, made from two points:
 p1 = ( -.24, 5.5, .033 ) p2 = (-.24 5.5 -1.96)
 Note that this is a line of constant Y=5.5
 Length of 2 along the -Z direction.
 
 The box is cenetered at 0, 4.5, -1, and has unit dimensions.
 The bounding box of the box is:
 xyzMin = [-.5, 4, -1.5]  xyzMax = [.5, 5, -.5]
 The box has no transformations above it, it's a direct child of the 
 scene root.
 
 When I run IntersectVisitor on the graph, it detects an intersection 
 with the box at:  [-.17, 4.0, -.88]
 Which is NOT on the LineSegment.
 I'm confused.  Here is the code that I'm using.
 m_wandP1 and m_wandP2 are the two points mentioned above.
 
 
 Thanks,
 -dave
 
 
 void CWand::UpdateIntersect( osg::Group *pSceneRoot )
 {
  osg::Vec3 wandDir = m_wandP2 - m_wandP1;
 
  //Create a line segment for the wand end points.
 
  osg::ref_ptrosg::LineSegment wandStick = new osg::LineSegment( 
 m_wandP2, -wandDir );
 
  //Intersect with the scene graph.
  osgUtil::IntersectVisitor intersectVisitor;
  intersectVisitor.setLODSelectionMode( 
 osgUtil::IntersectVisitor::USE_HIGHEST_LEVEL_OF_DETAIL );
  intersectVisitor.addLineSegment( wandStick.get() );
  pSceneRoot-accept( intersectVisitor );
 
  if ( m_bPrintUpdate )
   printf( Poke: P0 %f %f %f P1 %f %f %f Dir:[%f %f %f]\n\n,
   m_wandP1[0],m_wandP1[1],m_wandP1[2], 
 m_wandP2[0],m_wandP2[1],m_wandP2[2],
   wandDir[0],wandDir[1],wandDir[2] );
 
  osgUtil:: IntersectVisitor::HitList htl = 
 intersectVisitor.getHitList( wandStick.get() );
  vectorosg::Geode* geodeHits;
  int numHits = 0;
  if ( htl.size()  0 ) // We always hit the wand, so only consider 
 additional hits.
  {
   for ( int i = 0; i  htl.size(); i++ )
   {
   osg::Vec3 pt = htl[i].getWorldIntersectPoint();
   osg::Vec3 n = htl[i].getWorldIntersectNormal();
   osg::NodePath np = htl[i].getNodePath();
   //osg::Vec3 pt = htl[i].getLocalIntersectPoint();
   osg::Vec3 dir = m_wandP1-pt;
 
   if ( true )
  {
   numHits++;
   geodeHits.push_back( htl[i].getGeode() );
 
   if ( m_bPrintUpdate )
   {
   printf( \tIsect[%d]: %s D=%f [%f %f %f] Pt=%f %f %f N%f 
 %f 
 %f\n, numHits,
   htl[i].getGeode()-getName().c_str(),
   dir.length(), 
 dir[0],dir[1],dir[2],pt[0],pt[1],pt[2], 
 n[0],n[1],n[2] );
   osg::BoundingBox bb = htl[i].getGeode()-getBoundingBox();
   printf( \tBBOX: [%f %f %f] [%f %f %f]\n,
   bb.xMin(),bb.yMin(),bb.zMin(),
   bb.xMax(),bb.yMax(),bb.zMax() );
   printf( \t Node path:\n );
   for ( int j = 0; j  np.size(); j++ )
   {
   osg::Node *node = np[j];
   printf( \t%d: %s\n, j, node-className() );
 
   osg::MatrixTransform *pMT = 
 dynamic_castosg::MatrixTransform*(node);
   osg::PositionAttitudeTransform *pPAT = 
 dynamic_castosg::PositionAttitudeTransform*(node);
   if ( pMT != NULL ) //node-className() == 
 MatrixTransform )
   {
   osg::MatrixTransform *pMtx = (osg::MatrixTransform 
 *) node;
   osg::Matrix mtx = pMtx-getMatrix();
   printf( \t T[%f %f %f] [%f %f %f] [%f %f %f] [%f 
 %f %f]\n,
   mtx(3,0),mtx(3,1),mtx(3,2),
   mtx(0,0),mtx(0,1),mtx(0,2),
   mtx(1,0),mtx(1,1),mtx(1,2),
   mtx(2,0),mtx(2,1),mtx(2,2) );
   }
   else if ( pPAT != NULL )
   {
   osg::Vec3 p = pPAT-getPosition();
   osg::Quat Q = pPAT-getAttitude();
   osg::Vec4 q = Q.asVec4();
   printf( \t T[ %f %f %f] Q[%f %f %f %f]\n,
   p[0],p[1],p[2], q[0],q[1],q[2],q[3] );
   }
   else
   printf( ??\n );
   }
   
   //osg::Matrix *mtx = (osg::Matrix*)htl[i].getMatrix();
   //printf( 

[osg-users] Qt include dir problem

2007-08-28 Thread Michele Bosi
Hello,
I am trying to compile OSG 2.0 with the Qt example under Linux Ubuntu 7 + Qt
4.2. The compilation goes well until it reaches osgviewerQT.cpp. The
problem seems to be the fact that cmake doesn't detect the correct QT 4
include directory during the configuration. If I assign (from ccmake) to
QT_INCLUDE_DIR the value /usr/local/Trolltech/Qt-4.2.2/ after the
configuration (c key) the same variable gets updated to
QT_INCLUDE_DIR-NOTFOUND. Is interesting the fact that all the other
QT-related variable are automatically set to the right values (QT_*_DIR =
/usr/local/Trolltech/Qt-4.2.2/*).
Does anyone have any clues?
Thanks,
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgviewerMFC example crash in 2.1.8

2007-08-28 Thread Ricko 3D
Thanks Nick and Michael for the quick response. The problem was mine. I
didn't realize opening the native OSG file required a plug-in. I was
skipping a build step to make sure I understood what every component did
(helps me learn).

When I built the required plug-in for loading the basic OSG file it worked
fine.

I have to tip the hat to the error response system in OSG. I'm impressed.
Walking through with a debugger I noticed the ReaderWriter::ReadResult
returned from readNode gave me exactly what the root cause of the null model
was...

ERROR_IN_READING_FILE
Warning: Could not find plugin to read objects from file

I'm spoiled now. Well done.

Thanks!




 From: [EMAIL PROTECTED]
 To: osg-users@lists.openscenegraph.org
 Date: Tue, 28 Aug 2007 13:18:52 -0400
 Subject: [osg-users] osgviewerMFC example crash in 2.1.8
 
 I'm still finding my way around OSG so I wanted to find out if this issue
is mine before I continue pulling my hair out.
 I downloaded and built OSG 2.1.8. I took the code from one of the examples
to test, prior to integrating OSG into my app. This is on WinXP SP2 x86 and
the dev env is VC++ in VS8.
 - I created a new project using the code from the osgViewerMFC example.
 - It compiled fine in both release and debug and it launches with no
issues.
 - When I use the open command (from menu or toolbar) and direct it to any
test osg file, it crashes with both debug and release builds.
 - I used the VS debugger to walk through and find the crash in the debug
build.
 - Line 143 of optimizer.cpp caused an unhandled exception because node
was a NULL point.
 - I walked up the call stack back into the osgViewerMFC code and found the
cause is that mModel in cOSG::InitSceneGraph (MFC_OSG.cpp) is also NULL.
 - It turns out osgDB::readNodeFile, earlier in InitSceneGraph, returned a
NULL mModel even though the filename passed was valid.
 To verify it wasn't my settings when creating the example project from
scratch I chose another example, specifically osgShadow example. I created a
new project added the source, compiled, and both debug and release work
perfectly.
 Is this a known issue with osgViewerMFC? If not any suggestion on what
might be causing it?
 Thanks!
 Ricko


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


[osg-users] Flipping the normals

2007-08-28 Thread Michele Bosi
Hello,
I've a relatively easy task to accomplish, that is to render a mesh both
from inside and outside.
To do this i put the mesh under two different Geodes, in one i set the front
face to clock wise on the other I set the front face to counter clock
wise turning on the backface culling (or putting the object into a single
Geode turning off the backface culling). The problem is that in one case
(when I render the interior of the mesh) the polygons are not lit since
the normals are (of course) not flipped, that is they remain oriented
outward.
My question is: how can I flip the normals? should I create two distinct
meshes, one with the original normals and the other with inverted normals
(modifying manually the normal buffers, and doubling the memory usage) or
there is a more elegant way to do that, for example a node/state like
GL_PLEASE_FLIP_MY_NORMALS that can take care of this task automatically?
Cheers,
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Flipping the normals

2007-08-28 Thread Mike Wittman
Hi Mike,

 

Take a look at OpenGL's two-sided lighting support via
glLightModel/GL_LIGHT_MODEL_TWO_SIDE (and exposed in OSG with
osg::LightModel).  I think that's the more elegant solution your looking
for.

 

 

Mike Wittman

[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 

___

Seismic Micro-Technology, Inc.

8584 Katy Freeway, Suite 400 / Houston, Texas 77024

Tel.  +1 (713) 464-6188

Fax. +1 (713) 464-6440

Web:  www.seismicmicro.com
blocked::blocked::http://www.seismicmicro.com 

___

Seismic through Simulation with KINGDOM, (RC)2, and SURE! - CONTACT US
TODAY for more information.

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michele
Bosi
Sent: Tuesday, August 28, 2007 4:45 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Flipping the normals

 

Hello,
I've a relatively easy task to accomplish, that is to render a mesh both
from inside and outside. 
To do this i put the mesh under two different Geodes, in one i set the
front face to clock wise on the other I set the front face to counter
clock wise turning on the backface culling (or putting the object into
a single Geode turning off the backface culling). The problem is that in
one case (when I render the interior of the mesh) the polygons are not
lit since the normals are (of course) not flipped, that is they remain
oriented outward. 
My question is: how can I flip the normals? should I create two distinct
meshes, one with the original normals and the other with inverted
normals (modifying manually the normal buffers, and doubling the memory
usage) or there is a more elegant way to do that, for example a
node/state like GL_PLEASE_FLIP_MY_NORMALS that can take care of this
task automatically? 
Cheers,
Mike

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


Re: [osg-users] Flipping the normals

2007-08-28 Thread Gerrick Bivins
Sounds like you want something like:

osg::ref_ptrosg::LightModel lightModel = new osg::LightModel;
lightModel-setTwoSided(true);
myTwoSidedGeode-getOrCreateStateSet()-setAttribuiteAndModes(lightModel.get
()*);*
**
Might not be the exact syntax but pretty close.


On 8/28/07, Michele Bosi [EMAIL PROTECTED] wrote:

 Hello,
 I've a relatively easy task to accomplish, that is to render a mesh both
 from inside and outside.
 To do this i put the mesh under two different Geodes, in one i set the
 front face to clock wise on the other I set the front face to counter
 clock wise turning on the backface culling (or putting the object into a
 single Geode turning off the backface culling). The problem is that in one
 case (when I render the interior of the mesh) the polygons are not lit
 since the normals are (of course) not flipped, that is they remain oriented
 outward.
 My question is: how can I flip the normals? should I create two distinct
 meshes, one with the original normals and the other with inverted normals
 (modifying manually the normal buffers, and doubling the memory usage) or
 there is a more elegant way to do that, for example a node/state like
 GL_PLEASE_FLIP_MY_NORMALS that can take care of this task automatically?
 Cheers,
 Mike

 ___
 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] Flipping the normals

2007-08-28 Thread Michele Bosi
Thanks very much guys, osg::LightModel/GL_LIGHT_MODEL_TWO_SIDE seems
exactly what I needed.
Thankyou,
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Flipping the normals

2007-08-28 Thread Paul Martz
 Thanks very much guys, 
 osg::LightModel/GL_LIGHT_MODEL_TWO_SIDE seems exactly what I needed.
 Thankyou,
 Mike

In case it's not obvious, with two-sided lighting you do not need to
re-parent your mesh to two Geodes with different face culling. You should be
able to use a single Geode, face culling disabled, and two-sided lighting
enabled.
   -Paul

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


Re: [osg-users] Flipping the normals

2007-08-28 Thread Michele Bosi
Thanks Paul,
just wanted o add that I am very glad that when it comes to render
states OSG remains so close to OpenGL and doesn't abstract too much
from it, as this case proves, this lets users to reuse their prior
knowledge of OpenGL and makes the library really flexible,
long life to OSG! :)
Mike
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Qt include dir problem

2007-08-28 Thread [EMAIL PROTECTED]
Just wanted to add that I cannot compile osgviewerQT example not
even from Windows XP (MinGW configuration) for the very same reason.
Is anyone able to compile osgviewerQT?
-Mike

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


[osg-users] the global data structure in ossimPlanet

2007-08-28 Thread qianyi_0409
Dear sir   Can you tell me what is the globale data structure in ossimPlanet? 
Is it a mix global data structure based on QTM and voronoi.I really want to 
know that.   When I read the code of ossimPlant.I find the triangles betweem 
-45 to 45 are different from triangles between 45 to 90. Can you tell me how  
they code ,Are they Quarternary Triangular  Mesh?  Dear sir, do you  have some 
articles about this aspect.I really want to know that.  I really want to  know 
why code the grid  as this and how to code.Can you help me?Thank you, Thank you 
very much!!!
Regard
韩阳
 ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Color transparency/opacity

2007-08-28 Thread Nicholas Yue
Hi,

  I tried to modify and existing sample tet6.osg so that the 4th color
component is lesser than 1.0.

  I was expecting to see some transparency in the tetrahedron but the color
looks solid.

Regards

8--8--8--8--8--8--8--8--

Geode {
  UniqueID Geode_0
  DataVariance DYNAMIC
  nodeMask 0x
  cullingActive TRUE
  num_drawables 1
  Geometry {
DataVariance DYNAMIC
useDisplayList TRUE
useVertexBufferObjects FALSE
PrimitiveSets 1
{
  DrawElementsUInt TRIANGLES 12
  {
0 1 2 3 4 5 6 7 8 9
10 11
  }
}
VertexArray Vec3Array 12
{
  1 0 0
  0 1 0
  0 0 1
  0 0 0
  0 0 1
  0 1 0
  0 0 0
  1 0 0
  0 0 1
  0 0 0
  0 1 0
  1 0 0
}
NormalBinding PER_VERTEX
NormalArray Vec3Array 4
{
  0.57735 0.57735 0.57735
  -1 0 0
  0 -1 0
  0 0 -1
}
NormalIndices UIntArray 12 {
  0 0 0 1 1 1 2 2 2 3
  3 3
}
ColorBinding PER_VERTEX
ColorArray Vec4Array 4
{
  1 1 1 0.1
  1 0 0 0.1
  0 1 0 0.1
  0 0 1 0.1
}
ColorIndices UIntArray 12 {
  0 0 0 1 1 1 2 2 2 3
  3 3
}
  }
}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org