Re: [osg-users] What's the difference between put rttcamera under root node and viewer?

2015-11-23 Thread Robert Osfield
Hi John,

The inconsistent behaviour suggests that some state set up by SpeedTree is
affecting the OSG rendering and possibly the other way around too.

W.r.t. rendering different parts of the scene in the mirror vs main scene,
you can use a combination of NodeMask's on the subgraphs you want to
specialize and CullMask (see in osg::CullSettings that is inherited by
osg::Camera.)

Robert

On 21 November 2015 at 17:32, John Green  wrote:

> Hi,
> I'm trying to implement a rearview mirror in my car simulation project.So
> I need a rtt camera.And my scene consists of the osgearth node,some
> building models nodes,and a speed tree node.
> I find two way to build a rtt camera,one is add it to a scene node,using
> addchild method;the other is add it to the viewer,using addslave method.
> When the rttcamera is under a scene node,the osgearth node and the models
> nodes are rendered correctly,but the speedtree node is disapeared.(The
> speedtree node is rendered by its selfdefined drawable with opengl).
> And when the rttcaera is added to the viewer,with useMastersSceneData been
> set true,the whole scene can be rendered correctly,however there are still
> some nodes which should not be seen in the rearview mirror,like the visual
> aid lines , points or texts.If I set the useMastersSceneData false,and add
> the osgearth node,builds nodes  and speedtree node into the rttcamera
> manually,then the buildings and trees are fine.But the osgearth's textures
> are disappeared,and the whole terrain turn into black.
> So i am confused with the mechanism of the two kinds of rttcameras.I want
> to know the differences between them,and why the osgearth terrain turn into
> black when using a "addslave" rttcamera.
> Thank you![/b]
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65726#65726
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Mac compilation error

2015-11-23 Thread Robert Osfield
Hi Philippe,

This is a bug, it should be a reference - I must have made a copy and paste
error when adapting the line to use the template ref_ptr interface.

Robert.

On 22 November 2015 at 10:02, philippe renon 
wrote:

> Hi,
>
> The include/osgViewer/View include has that suspicious line:
>
> template void setImagePager(const osg::ref_ptr* ip) {
> setImagePager(ip.get()); }
>
> which fails to compile on mac with :
>
> member reference base type 'const osg::ref_ptr *' is not a structure 
> or union
>
>
> This pattern using osg::ref_ptr is used in many places but that suspicious
> line is only one with pointer instead of reference.
>
> Philippe.
>
>
> ___
> 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] Processor Affinity and forked processes

2015-11-23 Thread Pete Black
This bit me too.. i create a number of Qt threads to do things (update terrain, 
run physics simulation) and OSG was forcing them to all run on CPU 0, leading 
to really terrible performance, since it sets CPU affinity on the main thread, 
and all threads spawned from it will inherit the CPU mask.

OSG should not, in my opinion, be doing this by default. if a CPU affinity is 
to be set, it should be done explicitly by the programmer.

If this (hardcode cpu affinity to CPU 0) was a common practice in other 
libraries and apps, wouldn't it obviate any advantage OSG might gain from it?

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





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


Re: [osg-users] Mac compilation error

2015-11-23 Thread Robert Osfield
On 23 November 2015 at 08:45, Robert Osfield 
wrote:

> This is a bug, it should be a reference - I must have made a copy and
> paste error when adapting the line to use the template ref_ptr interface.
>

Fix is now checked into github's openscenegraph repository.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Mac compilation error

2015-11-23 Thread Jordi Torres
Hi Robert,

The svn is connected to github but not the opposite. So if you do a commit
in github it is not updated in the svn.
So now it is not syncrhonized.

Cheers.



2015-11-23 9:59 GMT+01:00 Robert Osfield :

>
>
> On 23 November 2015 at 08:45, Robert Osfield 
> wrote:
>
>> This is a bug, it should be a reference - I must have made a copy and
>> paste error when adapting the line to use the template ref_ptr interface.
>>
>
> Fix is now checked into github's openscenegraph repository.
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


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


Re: [osg-users] pfObject::getNamedUserDataSlot

2015-11-23 Thread Robert Osfield
Hi Tony,

On 22 November 2015 at 23:16, Tony Vasile  wrote:

> I have looked at ValueObject and was wondering why there is no option to
> save an osg::Object or an osg::Referenced object. Is this an omission or
> intended?
>

I don't know where you got this impression. You can save custom
osg::Object's to .osgb/.osgx,.osgt as long as you provide the serializers -
see the OpenSceneGraph/src/osgWrappers/serializer/*/* for examples.

The serializers for ValueObject can be found in
src/osgWrappers/serializers/osg/ValueObject.cpp.

Classes subclassed from osg::Referenced rather than osg::Object don't
support serialization though as the serialization requires the RTT info
that osg::Object adds.

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


Re: [osg-users] Bitmap Font

2015-11-23 Thread Robert Osfield
Hi Aaron,

On 22 November 2015 at 23:18, Aaron Andersen  wrote:

> I haven't really been able to find a bitmap font in OSG. The closest I
> could find was the DefaultFont in the osgText source code. I was hoping
> there was an actual bitmap font class that I could use to create fonts from
> an image. Anyone know of any?
>

There isn't a specific bit map font class as it isn't neccessary as you can
provide custom fonts by subclassing from osgText::FontImplementation, see
the OpenSceneGraph/src/osgPlugins/freetype/FreetTypeFont.h/.cpp and
src/osgQt/QFontImplementation.cpp.

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


Re: [osg-users] Processor Affinity and forked processes

2015-11-23 Thread Robert Osfield
Hi Kristofer,

I merged what were supposed to be "fixes" to the OpenThreads from a user
submissions between OSG-3.2 and 3.4.  The change in behaviour might stem
from this, try reverting these changes and see what happens.

Robert.

On 16 November 2015 at 11:09, Kristofer Tingdahl <
kristofer.tingd...@dgbes.com> wrote:

> Hi,
>
> we just found and solved the most weird bug that was associated with our
> upgrade from OSG 3.2 to OSG 3.4 .
>
> Our problem was that our batch programs (i.e. number-crunchers) would only
> run single threaded when launched from our application, but multi-threaded
> when launched on the command line.
>
> After 10 hours debugging, we found out that OSG 3.4 sets the CPU affinity
> from osgViewer::ViewerBase::startThreading(). When the process forks, this
> setting is inherited by the new process, and hence limits the new process
> to only run on one physical CPU.
>
> Our solution to this was to let the new processes unset the affinity mask,
> but I wish to make the community aware of this unwanted effect of OSG 3.4
>
> Best regards,
>
>
> Kristofer Tingdahl
> --
> *Dr. Kristofer Tingdahl**Chief Executive Officer*
> *__*
>
> *dGB Earth Sciences*Phone:+31 53 4315155Skype:dgbtingdahlE-mail:
> kristofer.tingdahl@dgbes.comInternet:dgbes.com & opendtect.org
> *__*
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Mac compilation error

2015-11-23 Thread Robert Osfield
On 23 November 2015 at 09:08, Jordi Torres  wrote:

> Hi Robert,
>
> The svn is connected to github but not the opposite.
>

github is no longer connected to the old svn repository.


> So if you do a commit in github it is not updated in the svn.
> So now it is not syncrhonized.
>

github provide a link for subversion users. i.e. to check out trunk:

svn co  https://github.com/openscenegraph/osg/trunk OpenSceneGraph

I haven't had chance to update the OSG website with links to this yet -
still early days for moving to github, this morning checkin to github is my
first :-)

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


Re: [osg-users] Mac compilation error

2015-11-23 Thread philippe renon
Hi Robert,
That's what I figured :)
Are you going to fix it directly or should I submit the fix ?
Philippe.
 


Le Lundi 23 novembre 2015 9h45, Robert Osfield  a 
écrit :
 
 

 Hi Philippe,

This is a bug, it should be a reference - I must have made a copy and paste 
error when adapting the line to use the template ref_ptr interface.

Robert.

On 22 November 2015 at 10:02, philippe renon  wrote:

Hi,
The include/osgViewer/View include has that suspicious line:

template void setImagePager(const osg::ref_ptr* ip) { 
setImagePager(ip.get()); }
which fails to compile on mac with :member reference base type 'const 
osg::ref_ptr *' is not a structure or union
This pattern using osg::ref_ptr is used in many places but that suspicious line 
is only one with pointer instead of reference.
Philippe.


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





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


Re: [osg-users] Mac compilation error

2015-11-23 Thread philippe renon
Just saw that a fix was pushed. Thanks !
 


Le Lundi 23 novembre 2015 11h03, philippe renon  a 
écrit :
 
 

 Hi Robert,
That's what I figured :)
Are you going to fix it directly or should I submit the fix ?
Philippe.
 


Le Lundi 23 novembre 2015 9h45, Robert Osfield  a 
écrit :
 
 

 Hi Philippe,

This is a bug, it should be a reference - I must have made a copy and paste 
error when adapting the line to use the template ref_ptr interface.

Robert.

On 22 November 2015 at 10:02, philippe renon  wrote:

Hi,
The include/osgViewer/View include has that suspicious line:

template void setImagePager(const osg::ref_ptr* ip) { 
setImagePager(ip.get()); }
which fails to compile on mac with :member reference base type 'const 
osg::ref_ptr *' is not a structure or union
This pattern using osg::ref_ptr is used in many places but that suspicious line 
is only one with pointer instead of reference.
Philippe.


___
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] pfObject::getNamedUserDataSlot

2015-11-23 Thread Tony Vasile
Hi Robert,
  Unless I am going blind I couldn't see an explicit apply for  osg::Object in 
either GetValueVisitor or SetValueVisitor, hence the question.


Tony V

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





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


Re: [osg-users] pfObject::getNamedUserDataSlot

2015-11-23 Thread Robert Osfield
On 23 November 2015 at 11:38, Tony Vasile  wrote:

> Hi Robert,
>   Unless I am going blind I couldn't see an explicit apply for
> osg::Object in either GetValueVisitor or SetValueVisitor, hence the
> question.


This is different question to saving data, the serialization support uses
completely different mechanism.

Have a look at include/osg/ValueObject for the get/set methods for the
ValueObject/GetValueVisitor/SetValueVisitor.

Or... just use the template methods in osg::Object i.e.

 // set value
 int count;
 object->setUserValue("count", count);

  // get value
  object->getUserValue("count", count);

The later returns true of the object has a "count" value object of the same
type as the parameter passed in.  You need to take care here as:

  unsigned int value;
  object->getUserValue("count", value);

Will return false for the above setting using an int.

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


Re: [osg-users] Bitmap Font

2015-11-23 Thread Aaron Andersen

Hi Robert,

I went through that code and seems pretty straight forward.
Thank you for your help!

Aaron

Quoting Robert Osfield :


Hi Aaron,

On 22 November 2015 at 23:18, Aaron Andersen  wrote:


I haven't really been able to find a bitmap font in OSG. The closest I
could find was the DefaultFont in the osgText source code. I was hoping
there was an actual bitmap font class that I could use to create fonts from
an image. Anyone know of any?



There isn't a specific bit map font class as it isn't neccessary as you can
provide custom fonts by subclassing from osgText::FontImplementation, see
the OpenSceneGraph/src/osgPlugins/freetype/FreetTypeFont.h/.cpp and
src/osgQt/QFontImplementation.cpp.

Robert.




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


Re: [osg-users] pfObject::getNamedUserDataSlot

2015-11-23 Thread Tony Vasile
Hi Robert,
   We are trying to save classes which have more than simple types or the list 
specified in ValueObject. If we try and save an object which has osg::Object 
has its parent then you get a linker error about missing apply routines for 
SetValueVisitor and GetValueVisitor. I have worked around this by using 
addUserObject and setUserObject. I thought it would have been cleaner if we 
could use a string to token to identified the stored data rather than a magic 
number. The magic number approach is similar to Performer.


Tony V

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





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


[osg-users] How to use osgUtil::PolytopeIntersector to get primitive inside of a area in a terrain?

2015-11-23 Thread Bean Bean
OR you can use other methods to get? can you tell me. I need yours.
cheers,
Bean
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface?

2015-11-23 Thread Bean Bean
Hi Sebastian,
 I use the way about your method, but I get zero point.
I may use wrong. Here is the code:
   const float x = v1.x();
const float y = v1.y();
const float look_offSet = 10.0f;
osg::ref_ptr polyIt = new
osgUtil::PolytopeIntersector(osgUtil::Intersector::PROJECTION, x -
look_offSet , y - look_offSet, x + look_offSet, y + look_offSet );
polyIt->setDimensionMask(osgUtil::PolytopeIntersector::DimZero);// only
pick points

osgUtil::IntersectionVisitor iv(polyIt );

m_OSG->getViewer()->getCamera()->accept(iv);
osg::ref_ptr v = new osg::Vec3Array;

if (polyIt->containsIntersections())//this is "false"Why???
{
   .
 }
cheers,
Bean
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface?

2015-11-23 Thread Bean Bean
Hi Sebastian,
 I use the way about your method, but I get zero point.
I may use wrong. Here is the code:
   const float x = v1.x();
const float y = v1.y();
const float look_offSet = 10.0f;
osg::ref_ptr polyIt = new
osgUtil::PolytopeIntersector(osgUtil::Intersector::PROJECTION, x -
look_offSet , y - look_offSet, x + look_offSet, y + look_offSet );
polyIt->setDimensionMask(osgUtil::PolytopeIntersector::DimZero);// only
pick points

osgUtil::IntersectionVisitor iv(polyIt );

m_OSG->getViewer()->getCamera()->accept(iv);
osg::ref_ptr v = new osg::Vec3Array;

if (polyIt->containsIntersections())//this is "false"Why???
{
   .
 }
cheers,
Bean
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org