Re: [osg-users] problem in camera rotation

2009-09-08 Thread J.P. Delport

Hi,

Akilan Thangamani wrote:

Hi,


Yes. I changed the  way I was doing. I set geometry under a matrix transform 
node and trying to rotate the geometry 90 degree over Z-axis.   It s getting 
translated too. I want to know  how  much unit I have to translate it back and  
If I want to rotate on other than Z-axis,  what initial matrix I have to set to 
MT?

  osg::Camera* g_camera=new osg::Camera;
  g_camera->setProjectionMatrixAsOrtho2D(0,1,0,1);
  g_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
  g_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
  g_camera->setRenderOrder(osg::Camera::POST_RENDER);
  osg::ref_ptr MT=new osg::MatrixTransform; 
  osg::Matrix mat(osg::Matrix::identity());

  
mat.makeRotate(osg::DegreesToRadians(90.),osg::Vec3f(0.0,0.0,1.0));
  MT->setMatrix(mat);
  MT->addChild(create_geom());
  g_camera->addChild(MT.get());
  
 osgViewer::Viewer viewer;  
 viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);  viewer.setCameraManipulator( new osgGA::TrackballManipulator() );   
viewer.setSceneData(g_camera);

viewer.realize();
while(!viewer.done())
{
viewer.frame();
}
Look @ the file attached. In that, figure (1) is what my actual geometry and 
figure (2) is what I wanted to result.


The geometry would rotate about its own 0 point, so if your 0 point is 
not in the center, it would appear that the geometry is translating and 
rotating. So, what you want to do is move your geometry first so that 
the point you want to rotate around is where you want it (I don't know 
the exact numbers, you will have to look in your geometry) and then do 
the rotation. You can link matrixtransforms under each other, e.g. say 
your geometry center is at (1,1,0) you can do


root->Rotate(90 about Z)->translate(-1,-1,0)->geom

Have a look at the Red Book here:

http://www.glprogramming.com/red/chapter03.html

especially the section:
Viewing and Modeling Transformations

jp





Thank you!

Cheers,
Akilan

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







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


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


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


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


Re: [osg-users] Problem with a program in osg qsg

2009-09-08 Thread J.P. Delport

Hi,

Brett Thomas Lee wrote:

Hi,



Thank you! very much.I also have an another question.What is attach in

mPreRenderCamera->attach(osg::Camera::COLOR_BUFFER,img.get()); code.If I attach an image to color buffer whenever I update the camera scene does 
the image gets automatically updated??or Do I need to attach it every 
frame??


attach only once, see osgprerender example.

jp





Cheers,
Brett

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





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



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


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


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


Re: [osg-users] version cross reference table

2009-09-08 Thread J.P. Delport

Hi,

also have a look at what

osgViewer::WindowSizeHandler

does in e.g. osgviewer, you can switch between full screen and windowed.

jp

Clay, Bruce wrote:

Thanks Jason, I’ll dig down that path

 


Bruce

 

 




*From:* osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Jason 
Daly

*Sent:* Tuesday, September 08, 2009 5:02 PM
*To:* OpenSceneGraph Users
*Subject:* Re: [osg-users] version cross reference table

 


Clay, Bruce wrote:

Is there a cross reference table anywhere that identifies the changes 
from one version of OSG to the next?


 

I am trying to update some OSG based applications I wrote 2 or 3 years 
ago and am running into problems finding the new classes to do the old 
function.


 

For example, I used RenderSurface to find the screen size and I believe 
to toggle to and from full screen mode.  What is the current recommend 
method to work with the screen size since RenderSurface is no longer 
available?




Welcome back, Bruce  :-)


Short answer:

osg::GraphicsContext::WindowingSystemInterface *wsi;
int width, height;

wsi = osg::GraphicsContext::getWindowingSystemInterface();
wsi->getScreenResolution(&width, &height);


The window size and decorations settings (as well as many other 
parameters) are handled through the Traits structure in 
osg::GraphicsContext.   Note that the osg::GraphicsContext API is 
implemented by several classes in the osgViewer/api directory 
(GraphicsWindowX11, for example).



Long answer:

The newer classes to look at are osg::Camera, osg::GraphicsContext, 
osg::View, and all the classes in osgViewer.  The functionality you're 
missing is probably in one of those.  osgUtil::SceneView is still in use 
as well, but it's now considered an internal implementation detail.


--"J"


This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.





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


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


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


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


[osg-users] [build] Performant handling of lots of changing objects

2009-09-08 Thread Michael Reichel
Hi,

first of all: I am new to OSG!
I like to programm a diplay for scientific purposes. I want to display lots 
(lets say 500 - 10.000.000) Boxes. At each time cycle (100ms) ist can be 500 - 
10.000.000 Boxes. 
All examples I read so far contained a allocation of memeory for all of those 
Boxes in the init. Problem: The amount of boxes varies a lot between two time 
cycles and the boxes from two different time cycles are not connected (there is 
no ID or somewhat that matches two boxes of two different time slots). Thats 
why I do not want to change existing boxes in the osg. I rather want to biuld a 
new graph each time.

But: If I would do so - I had to allocate up to 10.000.000 Boxes each time. 
That is not performant. Is there a way to allocate memory / instiate 10.000.000 
boxes at the beginning of the programm without to connect them to the osg. And 
then - to connect just those Boxes that should be displayed? And then to clean 
the osg without destroying the box instances?

If anyone has an answer to such a problem - please state som code especially of 
how to instantiate (new) the boxes and how to clean the osg.

And one more question: In all your examples - how do you ensure that the memory 
of the with new allocated drawables will be freed?




Thank you!

Cheers,
Michael

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





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


Re: [osg-users] Quicktime and movie size

2009-09-08 Thread Pierre BOURDIN
Hi Stephan,
I was looking for this kind of explanations...
I've tried the ffmmeg plugin but was first a little de-concerted by the lack
of audio support without sdl and then by the latency when you want to
control a sequence with sound...
I'll give it a try on Windows.
Thanks.
Pierre.

2009/9/8 Stephan Huber 

> Hi Pieree,
>
> Pierre Bourdin (gmail) schrieb:
> > Hi Serge,
> > Le mardi 08 septembre 2009 à 09:27 +0200, Serge Lages a écrit :
> >> Thank you Stephan, we've confirmed with our customer that it's a codec
> >> problem and not in our side, so it's OK. As a side note, the QuickTime
> >> plugin is really working like a charm compared to the other solutions
> >> like FFmpeg, it's a real pleasure.
>
> > Can you share a little bit more about the QuickTime Plugin ?
> > Do you have some recommendation for using it ?
>
> What do you want to know? It works - when compiled - out of the box, it
> can handle various codecs (you can even play all codec ffmpeg can play
> if you install Perian on Mac OS X)
>
> > What is the *best* codec to use ?
>
> Depends on your needs. If you want straight-forward playback then I
> would recommend MP4, Sorenson or similar codecs.
>
> If you want to have accurate frames for fast seeking, or play the movie
> reverse then I would recommend FotoJPEG which is frame-accurate.
>
> There are even some loss-less-codeecs from apple.
>
> > Does it work well with mpg format (mpgv for vidéo, mpga  for audio) ?
>
> AFAIK they work well, I don't know on windows, but on Mac, yes. With the
> quicktime plugin you should be able to play every movie, the
> quicktime-player can open and display.
> >
> > On which plate-form are you using it ?
>
> I am using it on Mac OS X and Windows.
>
> > I think it is not available on Linux ?
>
> No, there's no Linux-version.
>
>
> HTH,
> Stephan
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to compute speed?

2009-09-08 Thread Shiina Ringo
Hi,

Now just a question have troubled me: is that, an object is moving, using the 
osgAnimation library, here I want to compute the speed of that object's 
movement, and if using the "V=S/t" to compute the speed, then I donot kown how 
to get the Distance"S", even the Time"t". Anyone could give me a good idea for 
this? 


Thank you very much!

Cheers,
Shiina

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





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


Re: [osg-users] Problem with a program in osg qsg

2009-09-08 Thread Thrall, Bryan
Brett Thomas Lee wrote on Tuesday, September 08, 2009 4:51 PM:

> Hi,
> 
> Similar to Mr Paul I tried to modify my scene by calling update like
this
> 
> viewer.realize();
> while(!viewer.done())
> {
>   viewer.advance();
>   viewer.eventTraversal();
> 
>   //viewer.updateTraversal();
>   mtLeft->setUpdateCallback( new RotateCB );
>   viewer.renderingTraversals();
>   viewer.setCameraManipulator(new osgGA::TrackballManipulator());
> }
> 
> But nothing happened!!

If you comment out the update traversal, no update callbacks will be
executed. What Paul was suggesting is doing whatever RotateCB does in
while(!viewer.done()), like so:

 viewer.realize();
 while(!viewer.done())
 {
viewer.advance();
viewer.eventTraversal();
 
//viewer.updateTraversal();
doRotateCBStuff();
viewer.renderingTraversals();
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
 }

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


Re: [osg-users] version cross reference table

2009-09-08 Thread Jason Daly

Clay, Bruce wrote:


Thanks Jason, I’ll dig down that path

 


Bruce

 

 




*From:* osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] *On Behalf Of 
*Jason Daly

*Sent:* Tuesday, September 08, 2009 5:02 PM
*To:* OpenSceneGraph Users
*Subject:* Re: [osg-users] version cross reference table

 


Clay, Bruce wrote:

Is there a cross reference table anywhere that identifies the changes 
from one version of OSG to the next?


 

I am trying to update some OSG based applications I wrote 2 or 3 years 
ago and am running into problems finding the new classes to do the old 
function.


 

For example, I used RenderSurface to find the screen size and I 
believe to toggle to and from full screen mode.  What is the current 
recommend method to work with the screen size since RenderSurface is 
no longer available?




Welcome back, Bruce  :-)


Short answer:

osg::GraphicsContext::WindowingSystemInterface *wsi;
int width, height;

wsi = osg::GraphicsContext::getWindowingSystemInterface();
wsi->getScreenResolution(&width, &height);



Oops.  Just realized I missed the ScreenIdentifier parameter in the code 
above.  You get the idea, though.


--"J"


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


Re: [osg-users] version cross reference table

2009-09-08 Thread Clay, Bruce
Thanks Jason, I'll dig down that path

 

Bruce

 

 



From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason
Daly
Sent: Tuesday, September 08, 2009 5:02 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] version cross reference table

 

Clay, Bruce wrote: 

Is there a cross reference table anywhere that identifies the changes
from one version of OSG to the next?

 

I am trying to update some OSG based applications I wrote 2 or 3 years
ago and am running into problems finding the new classes to do the old
function.

 

For example, I used RenderSurface to find the screen size and I believe
to toggle to and from full screen mode.  What is the current recommend
method to work with the screen size since RenderSurface is no longer
available?



Welcome back, Bruce  :-)


Short answer:

osg::GraphicsContext::WindowingSystemInterface *wsi;
int width, height;

wsi = osg::GraphicsContext::getWindowingSystemInterface();
wsi->getScreenResolution(&width, &height);


The window size and decorations settings (as well as many other
parameters) are handled through the Traits structure in
osg::GraphicsContext.   Note that the osg::GraphicsContext API is
implemented by several classes in the osgViewer/api directory
(GraphicsWindowX11, for example).


Long answer:

The newer classes to look at are osg::Camera, osg::GraphicsContext,
osg::View, and all the classes in osgViewer.  The functionality you're
missing is probably in one of those.  osgUtil::SceneView is still in use
as well, but it's now considered an internal implementation detail.

--"J"




This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this 
 
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] version cross reference table

2009-09-08 Thread Jason Daly

Clay, Bruce wrote:


Is there a cross reference table anywhere that identifies the changes 
from one version of OSG to the next?


 

I am trying to update some OSG based applications I wrote 2 or 3 years 
ago and am running into problems finding the new classes to do the old 
function.


 

For example, I used RenderSurface to find the screen size and I 
believe to toggle to and from full screen mode.  What is the current 
recommend method to work with the screen size since RenderSurface is 
no longer available?





Welcome back, Bruce  :-)


Short answer:

osg::GraphicsContext::WindowingSystemInterface *wsi;
int width, height;

wsi = osg::GraphicsContext::getWindowingSystemInterface();
wsi->getScreenResolution(&width, &height);


The window size and decorations settings (as well as many other 
parameters) are handled through the Traits structure in 
osg::GraphicsContext.   Note that the osg::GraphicsContext API is 
implemented by several classes in the osgViewer/api directory 
(GraphicsWindowX11, for example).



Long answer:

The newer classes to look at are osg::Camera, osg::GraphicsContext, 
osg::View, and all the classes in osgViewer.  The functionality you're 
missing is probably in one of those.  osgUtil::SceneView is still in use 
as well, but it's now considered an internal implementation detail.


--"J"

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


[osg-users] version cross reference table

2009-09-08 Thread Clay, Bruce
Is there a cross reference table anywhere that identifies the changes
from one version of OSG to the next?

 

I am trying to update some OSG based applications I wrote 2 or 3 years
ago and am running into problems finding the new classes to do the old
function.

 

For example, I used RenderSurface to find the screen size and I believe
to toggle to and from full screen mode.  What is the current recommend
method to work with the screen size since RenderSurface is no longer
available?

 

Bruce

 




This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this 
 
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Excluding a Geode from Small Feature Culling

2009-09-08 Thread Per Fahlberg

Hi Andrew,

I was trying to accomplish exactly the same and finally found a 
solution, if you search the mailing list for "Disabling small feature 
culling for a subgraph" you will find the email thread when I discussed 
this with Robert. I've pasted the final solution below for your convinienc.


Regards
/Per

Hi,

For the record I've found a way to get things working the way I want it, 
by changing the culling mask of the culling set at the back of the 
projection culling stack, small feature culling can now be both enabled 
and disabled for subgraphs. The code for my callback looks like this now 
(the code is for enabling small feature culling, change the "|" to "& ~" 
to disable small feature culling):


virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
{
  osgUtil::CullVisitor *cv = dynamic_cast(nv);
  if(cv){
osg::CullStack::CullingStack &projCullStack = 
cv->getProjectionCullingStack();

if(!projCullStack.empty()){
  osg::CullingSet& cullingSet = projCullStack.back();
  osg::CullingSet::Mask cullingSetMask = cullingSet.getCullingMask();
  cullingSet.setCullingMask(cullingSetMask | 
osg::CullSettings::SMALL_FEATURE_CULLING);


  traverse(node,nv);
cullingSet.setCullingMask(cullingSetMask);
}else
  // Do not really now what to do if it is empty
  traverse(node,nv);
  }else
traverse(node,nv);
}

Andrew Thompson wrote:
Hi there, and thanks for your response, 

well I am using small feature culling in my application to improve performance. Its a CAD-style app and I have hundreds of thousands of Geodes on the screen at any one time. Many are really small so I am throttling small-feature culling to maintain a decent framerate when moving around. When static the scene re-draws everything. 

But - there are certain objects, markers around the scene, I'd like to exclude from the small feature cull if possible. 

If its not possible, no matter, just was hoping there was a simple solution to this. 

Thank you, 
Andrew


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





___
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] Excluding a Geode from Small Feature Culling

2009-09-08 Thread Andrew Thompson
Hi there, and thanks for your response, 

well I am using small feature culling in my application to improve performance. 
Its a CAD-style app and I have hundreds of thousands of Geodes on the screen at 
any one time. Many are really small so I am throttling small-feature culling to 
maintain a decent framerate when moving around. When static the scene re-draws 
everything. 

But - there are certain objects, markers around the scene, I'd like to exclude 
from the small feature cull if possible. 

If its not possible, no matter, just was hoping there was a simple solution to 
this. 

Thank you, 
Andrew

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





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


Re: [osg-users] Quicktime and movie size

2009-09-08 Thread Stephan Huber
Hi Pieree,

Pierre Bourdin (gmail) schrieb:
> Hi Serge,
> Le mardi 08 septembre 2009 à 09:27 +0200, Serge Lages a écrit :
>> Thank you Stephan, we've confirmed with our customer that it's a codec
>> problem and not in our side, so it's OK. As a side note, the QuickTime
>> plugin is really working like a charm compared to the other solutions
>> like FFmpeg, it's a real pleasure.

> Can you share a little bit more about the QuickTime Plugin ?
> Do you have some recommendation for using it ?

What do you want to know? It works - when compiled - out of the box, it
can handle various codecs (you can even play all codec ffmpeg can play
if you install Perian on Mac OS X)

> What is the *best* codec to use ? 

Depends on your needs. If you want straight-forward playback then I
would recommend MP4, Sorenson or similar codecs.

If you want to have accurate frames for fast seeking, or play the movie
reverse then I would recommend FotoJPEG which is frame-accurate.

There are even some loss-less-codeecs from apple.

> Does it work well with mpg format (mpgv for vidéo, mpga  for audio) ?

AFAIK they work well, I don't know on windows, but on Mac, yes. With the
quicktime plugin you should be able to play every movie, the
quicktime-player can open and display.
> 
> On which plate-form are you using it ?

I am using it on Mac OS X and Windows.

> I think it is not available on Linux ?

No, there's no Linux-version.


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


Re: [osg-users] Excluding a Geode from Small Feature Culling

2009-09-08 Thread Chris 'Xenon' Hanson
Andrew Thompson wrote:
> Hi there, 
> a quick question for you guys, is it possible for a Geode to be excluded from 
> SMALL_FEATURE_CULLING?

  Not as far as I know. And, i think you'd have to do it for all parent objects 
as well,
as I think SF-culling is done at all levels of the hierarchy. What are you 
trying to do?

> Thank you!
> Andrew

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


Re: [osg-users] Updating a scene using OSG and VRJuggler

2009-09-08 Thread Tim Allen
Hi,

Thank you  very much for the help.So I need to call 
scene->accept(updateVisitor);  every frame instead of using updatetraversal or 
update right??By the way I am updating a scene for a prerender camera.

Thank you!

Cheers,
Tim

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





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


[osg-users] Excluding a Geode from Small Feature Culling

2009-09-08 Thread Andrew Thompson
Hi there, 

a quick question for you guys, is it possible for a Geode to be excluded from 
SMALL_FEATURE_CULLING?


Thank you!

Andrew

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





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


[osg-users] [3rdparty] Blender3d & osgAnimation

2009-09-08 Thread Russell Morris
Hey everyone,
I've been out of the loop for quite a while but I have picked back up a project 
of mine. I have some models in blender that I want to animate for use in my app 
but when I export them using the newest OSG exporter (thanks to Cedric!) I 
don't get the results I'd hoped for using osganimationviewer. It almost appears 
as though the animation was exported with different coordinates. 

I'm using Blender 2.49b (latest) and I took a mercurial clone of 
http://hg.plopbyte.net/osgexport last night. 

Thanks in advance!

Russell

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





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


[osg-users] Problems building Plugins dicom

2009-09-08 Thread Jason Jerald
Hello everyone. I built DCMTK 3.5.4 successfully but am having problems 
building Plugins Dicom. I am using Visual Studio 2005 on Windows Vista. 
Has anybody built Plugins dicom successfully with Visual Studio on 
Window Vista?


I believe the following might(?) be issues in building Plugins dicom


*** /MD versus /MT ***
When making DCMTK with CMake the CMAKE_CXX_FLAGS have /MD which is the 
same for OSG. However, when I look at the projects in Visual Studio, the 
flags are /MT. Is this a problem? If so, why is CMake not setting it 
correctly and how can I fix it?


*** iostream.h versus iostream ***
OSG uses iostream. I am not convinced the file ofstream in DCMTK is 
configured to use iostream correctly. I tried hardcoding the use of 
iostream without getting plugin dicom to build successfully.


*** other library conflicts? 
I tried the \NoDefaultLib option and tried ignoring some other libraries 
with no success.


*** other problems ***
I might be completely missing something. Could there be some other 
problem?   Any ideas what I am doing wrong?  The output is below.


Thanks!

Jason









Error 72 error LNK2005: "public: __thiscall 
std::basic_string,class 
std::allocator >::~basic_stringstd::char_traits,class std::allocator >(void)" 
(??1?$basic_str...@du?$char_traits@d...@std@@v?$alloca...@d@2@@std@@q...@xz) 
already defined in dcmimgle.lib(dcmimage.obj) msvcprtd.lib
Error 73 error LNK2005: "public: __thiscall 
std::basic_string,class 
std::allocator >::basic_stringstd::char_traits,class std::allocator >(char const *)" 
(??0?$basic_str...@du?$char_traits@d...@std@@v?$alloca...@d@2@@std@@q...@pbd@Z) 
already defined in dcmimgle.lib(dcmimage.obj) msvcprtd.lib
Error 74 error LNK2005: "public: class std::basic_ostreamstd::char_traits > & __thiscall std::basic_ostreamstd::char_traits >::operator<<(class 
std::basic_ostream > & 
(__cdecl*)(class std::basic_ostream > 
&))" 
(??6?$basic_ostr...@du?$char_traits@d...@std@@@std@@qaeaa...@p6aaav01@AAV01@@z...@z) 
already defined in dcmimgle.lib(dcmimage.obj) msvcprtd.lib
Error 75 error LNK2005: "class std::basic_ostreamstd::char_traits > & __cdecl std::endl(class 
std::basic_ostream > &)" 
(?e...@std@@yaaav?$basic_ostr...@du?$char_traits@d...@std@@@1...@aav21@@Z) 
already defined in dcmimgle.lib(dcmimage.obj) msvcprtd.lib
Error 76 error LNK2005: "public: class std::basic_ostreamstd::char_traits > & __thiscall std::basic_ostreamstd::char_traits >::operator<<(double)" 
(??6?$basic_ostr...@du?$char_traits@d...@std@@@std@@qaeaa...@n@Z) already 
defined in dcmimgle.lib(diimage.obj) msvcprtd.lib
Error 77 error LNK2005: "public: class std::basic_ostreamstd::char_traits > & __thiscall std::basic_ostreamstd::char_traits >::operator<<(unsigned int)" 
(??6?$basic_ostr...@du?$char_traits@d...@std@@@std@@qaeaa...@i@Z) already 
defined in dcmdata.lib(dchashdi.obj) msvcprtd.lib
Error 78 error LNK2005: "public: class std::basic_ostreamstd::char_traits > & __thiscall std::basic_ostreamstd::char_traits >::operator<<(class std::ios_base & 
(__cdecl*)(class std::ios_base &))" 
(??6?$basic_ostr...@du?$char_traits@d...@std@@@std@@qaeaa...@p6aaavios_base@1...@aav21@@z...@z) 
already defined in dcmdata.lib(dcfilefo.obj) msvcprtd.lib
Error 79 error LNK2005: "public: class std::basic_ostreamstd::char_traits > & __thiscall std::basic_ostreamstd::char_traits >::operator<<(int)" 
(??6?$basic_ostr...@du?$char_traits@d...@std@@@std@@qaeaa...@h@Z) already 
defined in dcmimgle.lib(dimoimg.obj) msvcprtd.lib
Error 80 error LNK2005: "public: class std::basic_ostreamstd::char_traits > & __thiscall std::basic_ostreamstd::char_traits >::operator<<(unsigned short)" 
(??6?$basic_ostr...@du?$char_traits@d...@std@@@std@@qaeaa...@g@Z) already 
defined in dcmimgle.lib(dimoimg.obj) msvcprtd.lib
Error 81 error LNK2005: "public: class std::basic_ostreamstd::char_traits > & __thiscall std::basic_ostreamstd::char_traits >::operator<<(unsigned long)" 
(??6?$basic_ostr...@du?$char_traits@d...@std@@@std@@qaeaa...@k@Z) already 
defined in dcmimgle.lib(dimoimg.obj) msvcprtd.lib
Error 82 error LNK2005: "public: char const * __thiscall 
std::basic_string,class 
std::allocator >::c_str(void)const " 
(?c_...@?$basic_string@du?$char_tra...@d@std@@v?$alloca...@d@2@@std@@QBEPBDXZ) 
already defined in dcmimgle.lib(dcmimage.obj) msvcprtd.lib
Error 83 error LNK2005: "public: __thiscall 
std::basic_string,class 
std::allocator >::basic_stringstd::char_traits,class std::allocator >(class 
std::basic_string,class 
std::allocator > const &)" 
(??0?$basic_str...@du?$char_traits@d...@std@@v?$alloca...@d@2@@std@@q...@abv01@@Z) 
already defined in dcmimgle.lib(dcmimage.obj) msvcprtd.lib
Error 84 error LNK2005: "public: int __thiscall 
std::ios_base::setf(int,int)" (?s...@ios_base@std@@qae...@z) already 
defined in dcmimgle.lib(digsdlut.obj) msvcprtd.lib
Error 85 error LNK2005: "public: void __thiscall 
std::basic_ios >::setstate(int,bool)" 
(?setst...@?$basic_ios@du?$char_tra...@d@std@@@std@@qaex...@z) already 
defined in d

Re: [osg-users] Restarting a canceled thread

2009-09-08 Thread Michael Guerrero
So to clarify exactly where the exception is thrown here is the call stack:

ot11-OpenThreadsd.dll!OpenThreads::cooperativeWait(void * waitHandle=0x00b0,
unsigned long timeout=4294967295)  Line 53  C++
ot11-OpenThreadsd.dll!OpenThreads::Win32ConditionPrivateData::broadcast()  Line
73 + 0x15 bytes C++
ot11-OpenThreadsd.dll!OpenThreads::Condition::broadcast()  Line 100 C++
ot11-OpenThreadsd.dll!OpenThreads::Block::release()  Line 69 + 0x13 bytes   
C++
ot11-OpenThreadsd.dll!OpenThreads::ThreadPrivateActions::StartThread(void *
data=0x00b62860)  Line 112  C++
msvcr90d.dll!_callthreadstartex()  Line 348 + 0xf bytes C
msvcr90d.dll!_threadstartex(void * ptd=0x00b67008)  Line 331C

This happens after the second call to start and after the thread is actually
started the second time as can be seen from the call stack.


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


Re: [osg-users] Problem with a program in osg qsg

2009-09-08 Thread Paul Martz
Hi Tim -- In place of viewer.updateTraversal(), simply modify your scene 
graph.


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



Tim Allen wrote:

Hi,



Thank you very much for the reply.I also have an another question , in this code

while(!viewer.done())
{
viewer.advance();
viewer.eventTraversal();
viewer.updateTraversal();
viewer.renderingTraversals();
} 
if I remove viewer.updateTraversal(); and Is there a way to update  the scene without using viewer.updateTraversal??If so how can this be done??

Cheers,
Tim


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


Re: [osg-users] Restarting a canceled thread

2009-09-08 Thread Paul Martz
Thanks for the info on join(), but I guess I prefer the "manual control" 
feeling I get by waiting in my own loop. Good to know about join() though.


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



Thibault Genessay wrote:

Hi folks

I've tested the code (latest SVN) and get also get a crash when
start() is called the scond time.
Recreating the thread object indeed solves the problem, so it looks
like there is actually something going wrong when a cancelled thread
is restarted.

Slightly OT w.r.t. Paul's remark, I fail to see how waiting in a loop
can be "better" than joining, the latter being based on a
synchronization primitive that should, imho, be more efficient than
polling the thread for its isRunning flag. I always use join() to make
sure workers are finished and never saw an issue with this. Of course,
you can sometimes have a worker thread that does not testCancel() and
thus, do something like:

void cancelWithTimeOut(OpenThreads::Thread* thread, unsigned int timeout)
{
  thread->cancel();
  unsigned int timer = 0;
  while (thread->isRunning() && timer < timeout)
  {
OpenThreads::Thread::microSleep(1);
timer += 1;
  }
  if (thread->isRunning())
  {
thread->setCancelModeAsynchronous();
thread->cancel();
  }
}

And instead of:

mythread->start();
mythread->cancel(); // Assume that the thread is polite and will terminate ASAP
mythread->join();

do:

mythread->start();
cancelWithTimeOut(mythread, 300); // Assume that the thread is
probably not willing to terminate on its own
mythread->join();

to kill the thread after 3 seconds, whatever the data loss/corruption
that may occur.
My 2 cents.

I'll investigate further if the "Restarting a cancelled thread causes
crash" thing is a bug in OpenThreads.

Cheers

Thibault

On Mon, Sep 7, 2009 at 11:47 PM, Michael Guerrero wrote:

Thanks for the reply Paul.  I was calling join because i wanted the main calling
thread to block until myThread was finished.  I know it doesn't make much sense
to do it that way in this contrived example but in my actual application it
would be nice to do this between scenario teardown and setup/restart.

Per your suggestion I modified my main to this:
void main()
{
  OpenThreadObject* myThread = new OpenThreadObject;
  myThread->start();
  myThread->cancel();

  // I assume the "!" in your example was an error?
  while (myThread ->isRunning())
  {
 OpenThreads::Thread::microSleep(100);
  }

  myThread->start();

  while (myThread->isRunning())
  {
 OpenThreads::Thread::microSleep(100);
  }
}

Unfortunately it dies the same as before.  One around this that I've found is
not use "cancel()" at all but to create my own cancel mechanise like this (from
my actual app):

void DatabaseThread::TerminateThread()
{
  if (OpenThreads::Thread::CurrentThread() != this)
  {
 // Block until the thread is canceled
 if (isRunning())
 {
// mShouldTerminate is an atomic var that is checked
// periodically inside run() to know when to bail out

++mShouldTerminate;
join();
--mShouldTerminate;

// Cleaning up personal data
mPublicActorList.clear();
mPrivateActorList.clear();
 }
  }
  else
  {
 LOG_ERROR("Trying to terminate self.");
  }
}

I would prefer to do this the "right" way whatever that may be.

Thanks,
Michael

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


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



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


Re: [osg-users] Updating a scene using OSG and VRJuggler

2009-09-08 Thread Paul Martz
Hi Tim -- Yes, the UpdateVisitor executes the update callbacks you have 
attached to your nodes. That is the sole purpose of the UpdateVisitor: 
Walk the scene graph, look for update callbacks, and call into them. It 
works the same way regardless of whether it is launched by VRJ, 
osgViewer, SceneView, or even manually by your own app.


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



Tim Allen wrote:

Hi,

 I will explain what I didnt understand in the code.Does calling 
scene->accept(updateVisitor); everyframe will automatically call the 
updatecallbacks and update the scene.Because here no viewer.updateTraversal() or 
sceneview->update() methods are not called to update the scene.

Thank you!

Cheers,
Tim


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


Re: [osg-users] Navigation control

2009-09-08 Thread Akilan Thangamani
Hi,

That s fine. But I wanted to know  about the type of GUI
component has been used for navigation. osgWidget is what I have to choose
for such design? What type of file is that??

Thank you!

Cheers,
Akilan

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





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


Re: [osg-users] problem in camera rotation

2009-09-08 Thread J.P. Delport

Hi,

Akilan Thangamani wrote:

Hi,

Actually, I would like to simulate a navigation control  for north
orientation as available in google earth. I wanted to rotate the
control along the X-axis(+/-) that will get reflected on geocentric
virtual earth. I set the camera to the geometry(navigation control).
What I thought was  that rotating the camera would give the feel of
geometry rotation.  Is it the correct way to do?


It's all relative, so you can make a camera rotation plus translation 
look like a geometry rotation, but I would just rotate the geometry. Put 
your geometry under a matrixtransform node.


jp



Thank you!

Cheers, Akilan

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






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


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


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


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


Re: [osg-users] Quicktime and movie size

2009-09-08 Thread Pierre Bourdin (gmail)
Hi Serge,
Le mardi 08 septembre 2009 à 09:27 +0200, Serge Lages a écrit :
> Thank you Stephan, we've confirmed with our customer that it's a codec
> problem and not in our side, so it's OK. As a side note, the QuickTime
> plugin is really working like a charm compared to the other solutions
> like FFmpeg, it's a real pleasure.
Can you share a little bit more about the QuickTime Plugin ?
Do you have some recommendation for using it ?

What is the *best* codec to use ? 
Does it work well with mpg format (mpgv for vidéo, mpga  for audio) ?

On which plate-form are you using it ? 
I think it is not available on Linux ?

Thanks, 

Pierre.
> 
> On Tue, Sep 8, 2009 at 12:15 AM, Stephan Huber
>  wrote:
> Hi Serge,
> 
> Serge Lages schrieb:
> 
> > Thanks for your reply, it seems to be an export problem
> instead of a problem
> > on the plugin side. But it's still weird that the size on
> the QuickTime
> > player and in the plugin is different.
> 
> 
> I think it has something to do with the codec. DVCPro is
> convenient for
> editing movies/ capturing from video-cameras. I'd use Foto
> JPEG or MP4
> for OSG.
> 
> Safari shows the same error: if you open the movie with it, it
> will
> display at 1920x1080, so it's not isolated to the
> quicktime-plugin.
> 
> 
> cheers,
> Stephan
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
> 
> 
> 
> -- 
> Serge Lages
> http://www.tharsis-software.com
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Pierre BOURDIN
I.M.E.R.I.R.
Av. Pascot BP 90443
66004 PERPIGNAN
tél: 04 68 56 84 95
fax: 04 68 55 03 86
email: bour...@imerir.com


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


Re: [osg-users] problem in camera rotation

2009-09-08 Thread Akilan Thangamani
Hi,

Actually, I would like to simulate a navigation control  for north orientation 
as available in google earth. I wanted to rotate the control along the 
X-axis(+/-) that will get reflected on geocentric virtual earth. I set the 
camera to the geometry(navigation control). What I thought was  that rotating 
the camera would give the feel of geometry rotation.  Is it the correct way to 
do?  

Thank you!

Cheers,
Akilan

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





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


[osg-users] multi render pass with different materials

2009-09-08 Thread Sebastien Nerig
Hi,

Here is my problem, I use 2 passes to render a frame.
On the 1st pass, I render the whole scenegraph into a texture with a material A 
on a node N.
On the 2nd pass, I render the whole scene graph again and I use the texture 
from the 1st pass into a shader to render same node N with a material B.
As you can see, the node N must have a material A on the 1st pass and another 
material B on the 2nd pass; and I do not know how to do this.

All the rendering to texture and multiple pass rendering is done, but I do not 
know how to use a material A for my node N for the 1st pass, then to use a 
material B for the same node N on the 2nd pass.

One first and ulgy solution may be to duplicate the scenegraph, and to assign a 
material A on my node N on the 1st copy of the scenegraph and to assign a 
material B on my node N on the 2nd copy of the scenegraph.
But it is really ugly...

Another better solution is - I think - to use a switch node. this switch node 
may be have 2 children, the 1st child may hold the material A and the 2nd child 
may hold the material B. These 2 children may have my node N as a child. But I 
don't know how to activate the 1st swith's child on the 1st pass and the 2nd 
switch's child for the 2nd pass.

Does anyone of you have any ideas ? I think I may have to use render callback 
then to activate the correct switch's child for the correct pass, but I do not 
know OSG well and I don't know which callbacl to use and how to get the render 
pass number.

Thank you

Cheers,
Sebastien

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





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


Re: [osg-users] osgIntrospection / gen_wrapper - How to use ist?

2009-09-08 Thread Torben Dannhauer
Hello Robert,

thank you for the introduction.
I've postponed the scripting engine due to some other urgent aspectes, but I'll 
continue to try in some days. and will come back on this topic.

Thank you so far,

Torben

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





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



Re: [osg-users] Restarting a canceled thread

2009-09-08 Thread Ulrich Hertlein

Hi Michael,

On 7/09/09 10:58 PM, Michael Guerrero wrote:

...
void main()
{
OpenThreadObject* myThread = new OpenThreadObject;
myThread->start();
myThread->cancel();
myThread->join();
myThread->start();
myThread->join();
}

Are canceled threads allowed to be restarted?


Can you verify if the exception is thrown from the second 'start()' call?

Not that I'm too familiar with the Win32 API but I've experienced this before and I 
believe there is a bug in the win32 implementation.


'cancel()' sets cancelEvent.  This is checked in 'testCancel()' but also in 
cooperativeWait(), which is where the exception is apparently thrown.


I believe the cancelEvent should be reset on each 'start()', otherwise it will still be in 
the flagged cancelled state.


You could try to put a 'ResetEvent(pd->cancelEvent.get());' in Win32Thread.cpp: 
Thread::start() before the call to '_beginthreadex'.


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


Re: [osg-users] Restarting a canceled thread

2009-09-08 Thread Thibault Genessay
Hi folks

I've tested the code (latest SVN) and get also get a crash when
start() is called the scond time.
Recreating the thread object indeed solves the problem, so it looks
like there is actually something going wrong when a cancelled thread
is restarted.

Slightly OT w.r.t. Paul's remark, I fail to see how waiting in a loop
can be "better" than joining, the latter being based on a
synchronization primitive that should, imho, be more efficient than
polling the thread for its isRunning flag. I always use join() to make
sure workers are finished and never saw an issue with this. Of course,
you can sometimes have a worker thread that does not testCancel() and
thus, do something like:

void cancelWithTimeOut(OpenThreads::Thread* thread, unsigned int timeout)
{
  thread->cancel();
  unsigned int timer = 0;
  while (thread->isRunning() && timer < timeout)
  {
OpenThreads::Thread::microSleep(1);
timer += 1;
  }
  if (thread->isRunning())
  {
thread->setCancelModeAsynchronous();
thread->cancel();
  }
}

And instead of:

mythread->start();
mythread->cancel(); // Assume that the thread is polite and will terminate ASAP
mythread->join();

do:

mythread->start();
cancelWithTimeOut(mythread, 300); // Assume that the thread is
probably not willing to terminate on its own
mythread->join();

to kill the thread after 3 seconds, whatever the data loss/corruption
that may occur.
My 2 cents.

I'll investigate further if the "Restarting a cancelled thread causes
crash" thing is a bug in OpenThreads.

Cheers

Thibault

On Mon, Sep 7, 2009 at 11:47 PM, Michael Guerrero wrote:
> Thanks for the reply Paul.  I was calling join because i wanted the main 
> calling
> thread to block until myThread was finished.  I know it doesn't make much 
> sense
> to do it that way in this contrived example but in my actual application it
> would be nice to do this between scenario teardown and setup/restart.
>
> Per your suggestion I modified my main to this:
> void main()
> {
>   OpenThreadObject* myThread = new OpenThreadObject;
>   myThread->start();
>   myThread->cancel();
>
>   // I assume the "!" in your example was an error?
>   while (myThread ->isRunning())
>   {
>      OpenThreads::Thread::microSleep(100);
>   }
>
>   myThread->start();
>
>   while (myThread->isRunning())
>   {
>      OpenThreads::Thread::microSleep(100);
>   }
> }
>
> Unfortunately it dies the same as before.  One around this that I've found is
> not use "cancel()" at all but to create my own cancel mechanise like this 
> (from
> my actual app):
>
> void DatabaseThread::TerminateThread()
> {
>   if (OpenThreads::Thread::CurrentThread() != this)
>   {
>      // Block until the thread is canceled
>      if (isRunning())
>      {
>         // mShouldTerminate is an atomic var that is checked
>         // periodically inside run() to know when to bail out
>
>         ++mShouldTerminate;
>         join();
>         --mShouldTerminate;
>
>         // Cleaning up personal data
>         mPublicActorList.clear();
>         mPrivateActorList.clear();
>      }
>   }
>   else
>   {
>      LOG_ERROR("Trying to terminate self.");
>   }
> }
>
> I would prefer to do this the "right" way whatever that may be.
>
> Thanks,
> Michael
>
> ___
> 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] crash if using osgDB::readNodeFile from a thread different of update

2009-09-08 Thread Robert Osfield
Hi Cedric,

On Tue, Sep 8, 2009 at 9:24 AM, Cedric Pinson wrote:
> Hi Robert,
>
> Here the time frame where i have a problem:
> a thread A do
> osg::Object* obj = osgDB::readObjectFile(url);
> the obj is returned from cache, and later i do
>

Could you try using:

 osg::ref_ptr obj = osgDB::readRefObjectFile(url);

As this will ensure that ref_ptr<>'s are used throughout the read, as
it sounds like in your case in the readObjectFile method the reference
is being reset to before your thread is getting a chance to increment
the reference.

Inside osgDB::DatabasePager it actually uses the Ref versions of
read*File() to avoid this issue.

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


Re: [osg-users] crash if using osgDB::readNodeFile from a thread different of update

2009-09-08 Thread Cedric Pinson
Hi Robert,

Here the time frame where i have a problem:
a thread A do 
osg::Object* obj = osgDB::readObjectFile(url);
the obj is returned from cache, and later i do


a the same time the main thread execute (just after the execution of the
readObject of the thread A)
osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExternalReferences(*getFrameStamp());
 
osgDB::Registry::instance()->removeExpiredObjectsInCache(*getFrameStamp());

because obj is not reference counted yet, the main thread will see the 
reference count to 1, 
then it will not update the frame stamp of the data in cache. If the data is 
valid to expire,
then the data will be deleted while in another thread i will reference it.

That's the behavior i have in my application, i understand that if i
ref_ptr the data in cache forever everything will be fine (because the
time stamp will be updated ...).

Cheers,
Cedric

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


On Tue, 2009-09-08 at 06:34 +0100, Robert Osfield wrote:
> Hi Cedric,
> 
> I wouldn't have though my change will have introduced a new threading
> issue, perhaps just revealed on old one though.  I've just done a
> review of the Registry methods that access the cache and I can't find
> any points where the Registr::_objectCacheMutex isn't locked before
> access of the Registr::_objectCache map.
> 
> This leaves me without a lead w.r.t looking at how the viewer might be
> reading from the cache at the same time as it's being cleared.   Could
> you explain at what point this problem is occurring?
> 
> Robert.
> 
> On Mon, Sep 7, 2009 at 6:18 PM, Cedric Pinson 
> wrote:
> > Hi Robert,
> >
> > I had a crash in my application because i use osgDB::readFile from
> > another thread than Viewer.
> > In fact there is a short window if the cache is cleared while another
> > thread reference the data.
> > osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExternalReferences(*getFrameStamp());
> > osgDB::Registry::instance()->removeExpiredObjectsInCache(*getFrameStamp());
> >
> > Here the revision and the diff code on the link.
> > [svn r10520] Moved the updating and expiry of the Registry object cache
> > from DatabasePager into osgViewer::Viewer/CompositeViewer
> > http://hg.plopbyte.net/osg-trunk/diff/85a3231b7b00/src/osgViewer/Viewer.cpp
> >
> >
> > It's possible i had the problem before this commit, but i would just
> > want to put it on the mailing list if other people have similar problem.
> >
> > For explanation this how i use it:
> > for each player (10)
> > I fetch the url http://a.com/node.osg -> the first time it will be
> > downloaded then for other i will use the value in the cache registry
> > (throw the readNodeFile).
> > I clone the data in cache because i have to setup specific stuff by
> > player so i can't modify the original data fetched in cache, i want to
> > keep the data in cache clean.
> >
> >
> > The reference count is 1 except when i get the pointer and clone it, so
> > the
> > osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExternalReferences(*getFrameStamp());
> > does not update the timestamp and finally will delete the value in
> > cache.
> >
> > I changed the expiry time to a very big value, but i would prefer to
> > have a consistent fix. I guess i should keep the pointer on a kind of
> > registry in my application.
> >
> >
> > Cheers,
> > Cedric
> >
> > -
> > +33 659 598 614  Cedric Pinson mailto:cedric.pin...@plopbyte.net
> > http://www.plopbyte.net
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> 


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


Re: [osg-users] Quicktime and movie size

2009-09-08 Thread Serge Lages
Thank you Stephan, we've confirmed with our customer that it's a codec
problem and not in our side, so it's OK. As a side note, the QuickTime
plugin is really working like a charm compared to the other solutions like
FFmpeg, it's a real pleasure.

On Tue, Sep 8, 2009 at 12:15 AM, Stephan Huber wrote:

> Hi Serge,
>
> Serge Lages schrieb:
> > Thanks for your reply, it seems to be an export problem instead of a
> problem
> > on the plugin side. But it's still weird that the size on the QuickTime
> > player and in the plugin is different.
>
> I think it has something to do with the codec. DVCPro is convenient for
> editing movies/ capturing from video-cameras. I'd use Foto JPEG or MP4
> for OSG.
>
> Safari shows the same error: if you open the movie with it, it will
> display at 1920x1080, so it's not isolated to the quicktime-plugin.
>
> cheers,
> Stephan
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] problem in camera rotation

2009-09-08 Thread J.P. Delport

Hi,

Akilan Thangamani wrote:

Hi,

I understand that this  problem has already been discussed . But as I was not 
able
to understand clearly I post my simple camera rotation problem., I written a 
code

osg::ref g_camera=new  osg:::camera;
g_camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
g_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
g_camera->setViewMatrix(osg::Matrix::Identity());
g_camera->setClearMask(GL_DEPTH_BUFFER_BIT);
g_camera->setRenderOrder(osg::camera::POST_RENDER);
g_camera->setAllowEventFocus(true);
g_camera->addChild(create_geometry()); //create_geometry() fn will return  a 
geode with //a drawable added
..
..
...
osgViewer::Viewer viewer;
viewer.setSceneData(g_camera.get());
.
while(!viewer.done())
{
if(isKey_R_pressed){

..
osg::Matrixd vmat=g_camera->getViewMatrix(); //here i get the camera thru 
traversal
vmat.makeRotate(osg::DegreesToRadians(45.),osg::osg::Vec3f(1.,0.,0.));
g_camera->setViewMatrix(vmat);

.}
viewer.frame();
}
}
I dont understand how  my geometry is not getting rotated? 
Do you want to rotate the camera or the geometry you are looking at? The 
camera with identity view matrix looks along -z axis, you are rotating 
about x.



What is the problem in this?
I don't know what you want to do, so I cannot say. Try to explain what 
you expect. What are you currently getting?


jp




}
}




Thank you!

Cheers,
Akilan

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





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


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


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


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