Re: [osg-users] ReadImageFile fails open video

2014-03-28 Thread Robert Osfield
Hi Petr,

Is there any chance that your video is corrupted or uses a codec that
ffmpeg doesn't support?

Could you post a link to the video so others can see what happens when they
attempt to view it with osgmovie and 3rd party movie programs?

Robert.


On 27 March 2014 21:58, Petr Svoboda  wrote:

>
> robertosfield wrote:
> > Hi Petr,
> > On 27 March 2014 09:15, Petr Svoboda < ()> wrote:
> >
> > > Hi,
> > >
> > > So I found that if I type
> > >
> > > Code:
> > > osgmovie -e ffmpeg a.mp4
> > >
> > >
> > > everything works fine, because it opens dynamic library in
> osgPlugins-3.0.1/osgdb_ffmpeg.so in usr/lib.
> > >
> > > And that is strange because I use latest osg 3.2.1rc2 and my plugin
> folder is in usr/local/lib64
> > >
> > > So, how should I remove that old version?
> > >
> >
> >
> > The OSG by default will search for osgPlugins-version/osgdb_ffmpeg.so so
> it shouldn't matter if you have a 3.0.x version installed.  However, if you
> have explicitly added the osgPlugins-version directory to your paths then
> it can find the wrong version, but this won't be binary compatible so would
> likely result in linking errors.
> >
> >
> > When setting up paths to your OSG libraries just set the path to the
> where the libraries are, you don't need to explicitly add the osgPlugins
> directory as the osgPlugins-version path will automatically be appended to
> the libraries path when looking for plugins.
> >
> >
> > If you do still need to remove the old plugins you can use, and you
> install from source then use
> >
> >
> > sudo make uninstall
> >
> >
> > If you install from apt-get or associated GUI tools then just uninstall
> from there.
> >
> >
> > Robert.
> >
> >
> >
> >
> >  --
> > Post generated by Mail2Forum
>
>
>
> Thank you Robert for your help so far.
>
> I found out:
>
> 1) Using OSG 3.2.1rc2 gives me error ->
> FFmpegImageStream::open : avcodec_find_decoder() failed
>
> 2) Using OSG 3.0.1 which I get with
> sudo apt-get install libopenscenegraph-dev openscenegraph
> It works fine, video loads and plays
>
> 3) Using OSG 3.3.1 developer release
> Plugin will loads fine, ImageStream in NOT null, but the osg::Geometry I
> render to is black and to console is written
> "AVC: nal size -570163200
> AVC: nal size -570163200
> no frame!
> av_read_frame() returned End of file
> FFmpegImageStream::run : av_read_frame() failed"
>
> or just
> "AVC: nal size -570163200
> AVC: nal size -570163200
> no frame!"
>
> What does the 3) mean?
>
>
> 1) 2) 3) are just different OSG library linking/ including, everything
> else is the same
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=58749#58749
>
>
>
>
>
> ___
> 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] Set Viewport background color as transparent

2014-03-28 Thread John Moore
Hi Vishwa,

today when I was updating my OSG I just realized that I was using a modified 
version of GraphicsWindowIOS... that's why transparency was working with that 
code.

You can achieve the same result with the original GraphicsWindowIOS by calling 
this code before setting the traits:


Code:

osg::ref_ptr windowData = new 
osgViewer::GraphicsWindowIOS::WindowData(self.renderView, 
osgViewer::GraphicsWindowIOS::WindowData::ALL_ORIENTATIONS);
windowData->setCreateTransparentView(true);
// Init the Windata Variable that holds the handle for the Window to 
display OSG in.
osg::ref_ptr windata = windowData;






I know it's 2 years... but I hope it helps someone to know how to do it...

Cheers,
John

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





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


[osg-users] osgViewer stand alone window problem with 3.1.0.`2

2014-03-28 Thread David Cofer
I am trying to get my osg project running on Ubuntu 12.04. I originally had it 
working with OSG 2.8.3, but I am trying to upgrade to OSG 3.0.1.2. I installed 
the following packages using Synaptics.

libopenscenegraph-dev
libopenscenegraph80
openscenegraph
openscenegraph-doc
openscenegraph-examples
libopenthreads-dev
libopenthreads14
 
I can run the osg examples fine. My application attempts to create a standalone 
window using the following code. 

Code:

void OsgSimulationWindow::InitStandalone(Simulator *lpSim, OsgSimulator 
*lpVsSim)
{
  m_osgViewer = new osgViewer::Viewer;
  m_osgManip = new OsgCameraManipulator(lpSim, m_osgViewer.get());
  m_osgViewer->setCameraManipulator(m_osgManip.get());

  osgGA::GUIEventHandler *lpHandler = new OsgDraggerHandler(lpSim, 
m_osgViewer.get());
  m_osgViewer->addEventHandler(lpHandler);

  // Create the window and run the threads.
  m_osgViewer->setUpViewInWindow(m_ptPosition.x, m_ptPosition.y, m_ptSize.x, 
m_ptSize.y);

  CStdColor *vColor = lpSim->BackgroundColor();
  m_osgViewer->getCamera()->setClearColor(osg::Vec4(vColor->r(), vColor->g(), 
vColor->b(), vColor->a()));
  m_osgViewer->setSceneData(lpVsSim->OSGRoot());

  int inheritanceMask = 
  (osgUtil::SceneView::VariablesMask::ALL_VARIABLES &
  ~osgUtil::SceneView::VariablesMask::CULL_MASK);

  // set mask for upper camera
  m_osgViewer->getCamera()->setInheritanceMask(inheritanceMask);
  m_osgViewer->getCamera()->setCullMask(0x1);

  m_osgViewer->realize();
}





This worked in 2.8.3. However, when I run it with the 3.1 I get a window that 
shows up in the task bar with a big question mark and it does not actually 
display anything. I set the osg logging level to DEBUG_INFO, but I am not 
seeing any errors are warnings in it. I then tried create a full screen window 
by commenting out the setupViewInWindow method call, and this worked. The scene 
rendered correctly in full screen mode. So my osg is working, it is just 
something with starting in a stand-alone screen that is the problem.

I then started looking through the examples and I found the osgkeyboardmouse 
example that opens a screen like I want. I was able to run the example that is 
installed in the deb package. However, when I downloaded the example .cpp and 
compiled it myself it produces the same result as my simulation. A window with 
a ? that does not display. Here are the commands I am using to compile the 
example.

 
Code:

g++  -MMD "/home/david/AnimatLabSDK/Test/osgkeyboardmouse/osgkeyboardmouse.cpp" 
-g -O0 -DDEBUG -DMONODEVELOP 
-I"/home/david/AnimatLabSDK/Test/osgkeyboardmouse/.prec/Debug"  -c -o 
"/home/david/AnimatLabSDK/Test/osgkeyboardmouse/bin/Debug/osgkeyboardmouse.o"

Generating binary "osgkeyboardmouse" from object files
g++ -o 
"/home/david/AnimatLabSDK/Test/osgkeyboardmouse/bin/Debug/osgkeyboardmouse" 
"/home/david/AnimatLabSDK/Test/osgkeyboardmouse/bin/Debug/osgkeyboardmouse.o"  
-l"osg" -l"osgDB" -l"osgFX" -l"osgGA" -l"osgManipulator" -l"osgParticle" 
-l"osgShadow" -l"osgSim" -l"osgTerrain" -l"osgText" -l"osgUtil" -l"osgViewer" 
-l"osgVolume" -l"osgWidget" 




I am kind of stumped. It seems like the example should be working, but it is 
not. I was hoping someone might have some suggestions on what I could be doing 
wrong?

Thanks,
David

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





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


Re: [osg-users] Unable to place model on vpb terrain. How To ?

2014-03-28 Thread lawrence bertoldi
Hi,
Shayne, 
so I've been trying your solution for HAT and am having little luck.
I've worked through a few things to be sure that I'm getting the reasonable 
numbers etc 
but it seems that i always get the same height back as I put into the. \

I must be missing something... help would be appreciated!

terrain is pagedLOD and created with vpb using the --geocentric flag
pos = lat, lon, height_above_sealevel (maybe that should be above the center of 
the earth?)
... 

Code:

getHat(osg::Vec3f pos, osg::Node* target)
{
   // turn off OSG_NOTICE which prints out from computeIntersection called from 
computeHeightAboveTerrain
   osg::setNotifyLevel(osg::WARN);
   osgSim::HeightAboveTerrain myhat;

   // print what I pass in something like lat 32.???, lon -111.???, height 
= 545.???
   printf("inlat, inlon, inhgt = %f %f %f \n",pos[0],pos[1],pos[2]);

   // get the world XYZ coords
   double  X,Y,Z;
   
dynamic_cast(target)->getEllipsoidModel()->convertLatLongHeightToXYZ(
  osg::DegreesToRadians(pos[0]),
  osg::DegreesToRadians(pos[1]), 
  pos[2], X,Y,Z);


   // the resulting XYZ  looks like reasonable numbers... X & Y in the neg 
millions, Z pos mill
   printf("X,Y,Z = %f %f %f\n",X,Y,Z);
 
   // just want to check that nothing messed up the numbers
   double lat, lon, height;
   em->convertXYZToLatLongHeight(X,Y,Z,lat,lon,height);
   printf("lat lon height = %f %f 
%f\n",osg::RadiansToDegrees(lat),osg::RadiansToDegrees(lon),height);
   if( Scene* scene = dynamic_cast( m_viewer.getSceneData() ) )
   {
   osg::Node*  terrain = scene->getEarthModel();
   hat =  
osgSim::HeightAboveTerrain::computeHeightAboveTerrain(terrain,osg::Vec3d(X,Y,Z));

   printf(" HAT = %f  pos = %f %f %f\n",hat, X, Y, Z);
   }
 } 

here is the output

inlat,inlon,inhgt = 32.875961 -111.756973 545.467957
X,Y,Z = -1987688.866583 -4980417.869354 3442709.618813

lat lon height = 32.875961 -111.756983 545.467957
HAT = 545.467957  pos = -1987688.866583 -4980417.869354 3442709.618813



do I need to set something about the terrain lowest elevation?


Cheers,
lawrence

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





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


Re: [osg-users] osgViewer stand alone window problem with 3.1.0.`2

2014-03-28 Thread Robert Osfield
Hi David,

When you say the window doesn't display, only a "window with a ?" it's hard
to know what you mean.  It's certainly now a description I've seen before
from users w.r.t OSG app problems.

The best I can suggest is start by getting an OSG example compiling and
working that is close to yours and then bit by by modify it.  If there is a
problem a screenshot would be useful.  Also it would be useful to outline
the hardware you are working on.

Another route would be to just grab OSG-3.2.0 from source and compile it
and go from there.

Robert.


On 28 March 2014 14:54, David Cofer  wrote:

> I am trying to get my osg project running on Ubuntu 12.04. I originally
> had it working with OSG 2.8.3, but I am trying to upgrade to OSG 3.0.1.2. I
> installed the following packages using Synaptics.
>
> libopenscenegraph-dev
> libopenscenegraph80
> openscenegraph
> openscenegraph-doc
> openscenegraph-examples
> libopenthreads-dev
> libopenthreads14
>
> I can run the osg examples fine. My application attempts to create a
> standalone window using the following code.
>
> Code:
>
> void OsgSimulationWindow::InitStandalone(Simulator *lpSim, OsgSimulator
> *lpVsSim)
> {
>   m_osgViewer = new osgViewer::Viewer;
>   m_osgManip = new OsgCameraManipulator(lpSim, m_osgViewer.get());
>   m_osgViewer->setCameraManipulator(m_osgManip.get());
>
>   osgGA::GUIEventHandler *lpHandler = new OsgDraggerHandler(lpSim,
> m_osgViewer.get());
>   m_osgViewer->addEventHandler(lpHandler);
>
>   // Create the window and run the threads.
>   m_osgViewer->setUpViewInWindow(m_ptPosition.x, m_ptPosition.y,
> m_ptSize.x, m_ptSize.y);
>
>   CStdColor *vColor = lpSim->BackgroundColor();
>   m_osgViewer->getCamera()->setClearColor(osg::Vec4(vColor->r(),
> vColor->g(), vColor->b(), vColor->a()));
>   m_osgViewer->setSceneData(lpVsSim->OSGRoot());
>
>   int inheritanceMask =
>   (osgUtil::SceneView::VariablesMask::ALL_VARIABLES &
>   ~osgUtil::SceneView::VariablesMask::CULL_MASK);
>
>   // set mask for upper camera
>   m_osgViewer->getCamera()->setInheritanceMask(inheritanceMask);
>   m_osgViewer->getCamera()->setCullMask(0x1);
>
>   m_osgViewer->realize();
> }
>
>
>
>
>
> This worked in 2.8.3. However, when I run it with the 3.1 I get a window
> that shows up in the task bar with a big question mark and it does not
> actually display anything. I set the osg logging level to DEBUG_INFO, but I
> am not seeing any errors are warnings in it. I then tried create a full
> screen window by commenting out the setupViewInWindow method call, and this
> worked. The scene rendered correctly in full screen mode. So my osg is
> working, it is just something with starting in a stand-alone screen that is
> the problem.
>
> I then started looking through the examples and I found the
> osgkeyboardmouse example that opens a screen like I want. I was able to run
> the example that is installed in the deb package. However, when I
> downloaded the example .cpp and compiled it myself it produces the same
> result as my simulation. A window with a ? that does not display. Here are
> the commands I am using to compile the example.
>
>
> Code:
>
> g++  -MMD
> "/home/david/AnimatLabSDK/Test/osgkeyboardmouse/osgkeyboardmouse.cpp" -g
> -O0 -DDEBUG -DMONODEVELOP
> -I"/home/david/AnimatLabSDK/Test/osgkeyboardmouse/.prec/Debug"  -c -o
> "/home/david/AnimatLabSDK/Test/osgkeyboardmouse/bin/Debug/osgkeyboardmouse.o"
>
> Generating binary "osgkeyboardmouse" from object files
> g++ -o
> "/home/david/AnimatLabSDK/Test/osgkeyboardmouse/bin/Debug/osgkeyboardmouse"
> "/home/david/AnimatLabSDK/Test/osgkeyboardmouse/bin/Debug/osgkeyboardmouse.o"
>  -l"osg" -l"osgDB" -l"osgFX" -l"osgGA" -l"osgManipulator" -l"osgParticle"
> -l"osgShadow" -l"osgSim" -l"osgTerrain" -l"osgText" -l"osgUtil"
> -l"osgViewer" -l"osgVolume" -l"osgWidget"
>
>
>
>
> I am kind of stumped. It seems like the example should be working, but it
> is not. I was hoping someone might have some suggestions on what I could be
> doing wrong?
>
> Thanks,
> David
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=58754#58754
>
>
>
>
>
> ___
> 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] osgViewer stand alone window problem with 3.0.1.2

2014-03-28 Thread David Cofer
That was weird. I rebooted my system to try and get a screen shot for you and 
now it is working in both the osgkeyboardmouse example and in my app.  
Not sure why that would have made any difference, but it is working great now 
and I did not do anything else to it.

Thanks,
David

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





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


Re: [osg-users] osgViewer stand alone window problem with 3.0.1.2

2014-03-28 Thread Robert Osfield
On 28 March 2014 20:04, David Cofer  wrote:

> That was weird. I rebooted my system to try and get a screen shot for you
> and now it is working in both the osgkeyboardmouse example and in my app.
> Not sure why that would have made any difference, but it is working great
> now and I did not do anything else to it.
>

I would suspect a driver error somewhere in the chain or memory corruption
of some kind.  I guess there could be a threading issue somewhere,
sometimes this type of issue comes and goes.

Glad to hear it's working now, even if you don't know what was the cause of
problem.

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


[osg-users] Bigger bounding box to make picking (intersection) easier?

2014-03-28 Thread Petr Svoboda
Hi,

I would like to ask if there is some way how to create bigger bounding box over 
some model to make it easier to pick it/ intersect with.
For example if there is a cow.osg model and I want to pick it then how do it in 
a way that I dont need to click with my mouse exactly on that model but a bit 
"next to it".
Is that was is osg::BoundingBox made for? Or the purpose of BoundingBox is just 
for culling etc.?
I would like to use osg::LineSegmentIntersector + osg::IntersectVisitor.

Thank you!

Cheers,
Petr

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





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


Re: [osg-users] Bigger bounding box to make picking (intersection) easier?

2014-03-28 Thread Trajce Nikolov NICK
Ahoj Petr,

you can override the bound volume calculation with your own code via
callback. Have a look in the Node class

/** Callback to allow users to override the default computation of bounding
volume.*/
struct ComputeBoundingSphereCallback : public osg::Object
{

   virtual BoundingSphere computeBound(const osg::Node&) const {
return BoundingSphere(); }
};

so here you do the default Node::computeBound and adjust the radius by
something small (like radius *= 1.1)

Hope this helps

Nick


On Fri, Mar 28, 2014 at 10:00 PM, Petr Svoboda  wrote:

> Hi,
>
> I would like to ask if there is some way how to create bigger bounding box
> over some model to make it easier to pick it/ intersect with.
> For example if there is a cow.osg model and I want to pick it then how do
> it in a way that I dont need to click with my mouse exactly on that model
> but a bit "next to it".
> Is that was is osg::BoundingBox made for? Or the purpose of BoundingBox is
> just for culling etc.?
> I would like to use osg::LineSegmentIntersector + osg::IntersectVisitor.
>
> Thank you!
>
> Cheers,
> Petr
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=58760#58760
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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


Re: [osg-users] Bigger bounding box to make picking (intersection) easier?

2014-03-28 Thread Robert Osfield
HI Petr,

The ray intersection testing goes right down to the polygon level when
testing for intersection so "expanding" the bounding box won't make any
difference.

Perhaps what you are looking for is the PolytopeIntersector, this allows
you to create a screen aligned polytope that can intersection objects
within the polytope.

Robert.


On 28 March 2014 21:00, Petr Svoboda  wrote:

> Hi,
>
> I would like to ask if there is some way how to create bigger bounding box
> over some model to make it easier to pick it/ intersect with.
> For example if there is a cow.osg model and I want to pick it then how do
> it in a way that I dont need to click with my mouse exactly on that model
> but a bit "next to it".
> Is that was is osg::BoundingBox made for? Or the purpose of BoundingBox is
> just for culling etc.?
> I would like to use osg::LineSegmentIntersector + osg::IntersectVisitor.
>
> Thank you!
>
> Cheers,
> Petr
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=58760#58760
>
>
>
>
>
> ___
> 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