Re: [osg-users] How do I move a Texture in an model of Openflight format (.flt) in the UV direction?

2019-09-17 Thread Ulrich Hertlein
Hi Dae,

On 17/9/19 03:16, Dae Woo Ryu wrote:
> As shown in the code below, 
> I get the geometry information from the model of Openflight(.flt) format and 
> move the coordinates of the vertices.
> But the texture doesn't move.
> How can I move a texture?

Depending on what you are trying to achieve, a texture matrix osg::TexMat might 
also work
(and be less CPU intensive.)

Cheers,
/Ulrich



signature.asc
Description: OpenPGP digital signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgFX::Outline lose material color while GL_LIGHTING set OFF

2019-09-02 Thread Ulrich Hertlein
Hi Franco,

From the png I understand that you have a Group with Geodes A and B.
The effect will *always* be applied to the entire node that it's attached to, 
so if you
want to have the outline only on A or B then you must attach the effect to A or 
B, not the
parent Group.

Hope this helps.

Cheers,
/Ulrich

On 29/8/19 07:33, Franco Tang wrote:
> There is an another problem. When a group has been added into osgFX::Outline, 
> how to remove outline effect from it's specific child.
> 
> 
> Code:
> 
> osgFX::Outline *outline = new osgFX::Outline;
> 
> osg::Group *group = new osg::Group;
> osg::Geode *geode_1 = osg::Geode;
> group->addChild(geode_1);
> // add more osg::Geode and init drawable for this node.
> // 
> 
> // How to remove Outline effect from this node.
> // I had tried to remove stencil test. But it failed.
> osg::Geode *geode_no_outline = osg::Geode;
> // geode_no_outline->getOrCreateStateSet()->setMode(GL_STENCIL_TEST, 
> osg::StateAttribute::OFF);
> group->addChild(geode_no_outline);
> // init drawable
> // ...
> 
> outline->addChild(group);



signature.asc
Description: OpenPGP digital signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Building on macOS 10.14

2019-02-07 Thread Ulrich Hertlein
On 6/2/19 22:57, Jan Brejcha wrote:
> I found a related issue on Github, seems solved 
> https://github.com/openscenegraph/OpenSceneGraph/issues/637

Yes, seems to work around the issue, but I wouldn't call it being solved.

The cmake files are broken, because they set the necessary environment *after* 
the
compiler is detected and checked.

I've created a pull request with cleanups and fixes for macOS 10.14.
https://github.com/openscenegraph/OpenSceneGraph/pull/711

Cheers,
/ulrich





signature.asc
Description: OpenPGP digital signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Building on macOS 10.14

2019-02-04 Thread Ulrich Hertlein
Hi Jan,

I can prepare a diff tonight.  But I'm wondering: we can't be the only people 
trying to
compile for 10.14.  Aren't others running into this problem?

Cheers,
/Ulrich

> is there any progress with a working version for macos 10.14? I did not have 
> any problem building on 10.13,
> but on 10.14 I get exactly the same CMake error as Ulrich. Any help would be 
> very appreciated!> > Thank you!> > Cheers,> Jan



signature.asc
Description: OpenPGP digital signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Switch between primitive and model

2018-11-12 Thread Ulrich Hertlein
Hi Charlie,

On 12/11/18 03:26, Charlie Tan wrote:
> I am trying to toggle between a model that I have loaded (a unit cube) and a 
> colored surface (a unit triangle). Thus, the triangle rendered should be half 
> the area of the unit cube's face. In addition, the triangle rendered should 
> lie on the cube face itself.
> 
> // Model
> auto loadedModel = readRefNodeFiles(...);
> auto swtch = new Switch();
> 
> scene->addChild(swtch);
> swtch->addChild(loadedModel); //swtch[0]
> 
> // Colored surface
> Node* geode;
> auto polyGeom = Geometry();
> polyGeom->setVertexArray(...);  //Set to (0,0,0), (1,0,0), (1,1,0)
> polyGeom->setColorArray(...);
> polyGeom->setNormalArray(...);
> geode->addDrawable(polyGeom);
> 
> swtch->addChild(geode); //swtch[1]
>...
> The size, position and the orientation of the colored surface is way off as 
> compared to my cube model.

You didn't say much about how the unit cube is constructed, but usually it 
means that it
has an edge length of one (1.0) and is centered around the origin (0,0,0).  
This usually
also implies that the model matrix is the identity matrix.

So corners will be at min(-0.5, -0.5, -0.5) and max(0.5, 0.5, 0.5).

The triangle you are constructing, however, extends from the origin with an 
edge length of
1.0.  Try to offset your triangle by translate(-0.5, -0.5, -0.5) and you should 
see it
lining up.

You can also use the coordinates directly, e.g. a triangle (-0.5, -0.5, -0.5), 
(0.5, -0.5,
-0.5), (0.5, 0.5, -0.5).  Or something along those lines, depending on which 
face of the
cube you want to overlay.

Hope this helps,
Cheers,
/Ulrich



signature.asc
Description: OpenPGP digital signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Building on macOS 10.14

2018-11-11 Thread Ulrich Hertlein
Hi guys,

Has anyone managed to build OSG (master) on macOS 10.14?

I'm getting a cmake failure trying to even find a useable compiler, due to the 
usage of
the deprecated+removed libstdc++.

I'm working on a fix for that, but during that journey I noticed that
- minimum supported OS X version is *supposedly* 10.4
- there's checks for Carbon support all over the place

My question is this:
- is somebody actually *using* OSG with macOS pre 10.10 (for example)?
- is (that same?) somebody actually still *using* Carbon?

If not then I'd consider removing Carbon support and setting the minimum 
supported macOS
version to 10.10 or thereabouts.  Please note that I don't have a way to check 
whether it
actually *works* with anything previous to the current version 10.14 though...

Cheers,
/Ulrich



signature.asc
Description: OpenPGP digital signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] iOS build guide locked/checked out on osg website

2017-04-22 Thread Ulrich Hertlein
On 22/4/17 00:43, Thomas Hogarth wrote:
> Hi All
>
> Not sure who can do what about this. A little while back i was going to 
> update the build
guide for osg on iOS, but the document/article was checked out and locked by 
another user.
Since 2014 haha. Says it's been checked out by Ulrich Hertlein. If you're still 
around
could you unlock it?
Oops; damn that wiki has a good memory :-}
I'll unlock it.

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


Re: [osg-users] ShaderComposer::releaseGLObjects warning

2016-04-18 Thread Ulrich Hertlein
Hi guys,

On 18/04/2016 20:22, Robert Osfield wrote:
> On 18 April 2016 at 17:39, Andy Skinner  > wrote:
>  
> We are getting a warning for ShaderComposer::releaseGLObjects: 'void
> osg::ShaderComposer::releaseGLObjects(osg::State *)' : member function 
> does not
> override any base class virtual member function   
> osg::Object::releaseGLObjects is
> virtual, but osg::ShaderComposer::releaseGLObjects is not.  Is there a 
> reason why?
> 
> Sounds like a dodgy compiler warning.

I think not, it looks like an actual bug:

osg::Object
virtual void releaseGLObjects(osg::State* = 0) const {}

osg::ShaderComposer
void releaseGLObjects(osg::State* state);

The ShaderComposer method is non-const and therefore does not override the 
osg::Object method!

Can we use the 'override' keyword yet?

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


Re: [osg-users] [build] Xocde 7.1 with osgDB compiler error

2015-10-31 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi,

On 28/10/2015 15:07, Radu Popescu wrote:
> We are using OSG for a cross-platform application that runs on Windows, Linux 
> and Mac
> OS X (10.10 and 10.11).
> 
> The application uses OSG 3.4 and Qt 4.8 and we had to apply some patches to 
> get this 
> setup working. We maintain a public Git clone, based on the GitHub mirror of
> OpenSceneGraph. ... Here is a patch that could help with the compilation:
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt index ce2815b..3e496c1 100644 ---
> a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,7 +180,13 @@ IF(APPLE) 
> STRING(REPLACE
> "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME}) LIST(GET MACOS_VERSION_LIST 0
> MACOS_VERSION_MAJOR) LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR) -
> LIST(GET
> MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH) + +LIST(LENGTH 
> MACOS_VERSION_LIST
> MACOS_VERSION_LIST_LENGTH) +IF(MACOS_VERSION_LIST_LENGTH EQUAL "3") +
> LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH) +ELSE() +
> SET(MACOS_VERSION_PATCH "0") +ENDIF()
> 
> SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

- From what I could grep, MACOS_VERSION_PATCH isn't used anywhere.
Should we maybe remove it instead of adding code for something that's not used?

Cheers,
/ulrich

- -- 
Public Key - 0227 8EE1 2C64 8EF4 DA11  9864 FF16 0114 B9DA 3318
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJWNLJnAAoJEP8WARS52jMYU0UIANJrUOwKsl+anVIeHosqxPal
W9Oww/DVFnlwF8T0o8ZqWzhLqqHiwBgMuDSB16ZS20F+avj5UD+za4oxFNDoS9Du
HbUBa+qfiEu5So6B40mG7ofZlTuh4Sjz/PoNsONVNVxUXCnELvnIexmWmch63FxH
vzLcMvu+dgJTBEyx2BlsETcpNp0/PIHgUwcK7w3yhrOOdLgEswAI4W8KoEwowbPf
u9YMkw04FPCCvWCn2TwizwjTDMnoxDnQCcframN+EwnmiTP3ulgJa9Ahr5EdTlB2
MO2aTuw7943LXDi+qqQlT8PhgEBZ3e/fOT4gxbbQwUxPk9SMfIcmWPQcCUjuEhg=
=RdbZ
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Wrong understanding of tangent space and world coordinates?

2015-05-09 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Andreas,

On 6/05/2015 13:28, Andreas Schreiber wrote:
 If I pass the following vector from osg code to the shader:
 
 Code: plane-getOrCreateStateSet()-addUniform(new 
 osg::Uniform(object_position,
 osg::Vec4(1, -0.25, 1,1)));
 
 This vector is in world space coordinates, correct?

The coordinate system is entirely up to you - tt can be world space, object 
space, or
anything else.  You are responsible for keeping track of what it is.

But since the uniform is not automagically transformed it could be considered 
to be in
world space.

Cheers,
/ulrich
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJVTgqlAAoJEP8WARS52jMYCMMH/1yv7QHKn/D/D2kt8D82vV+f
pOQWxYiEifRZvTxWG0BEadZekEecn2n58QF93uVMHWtnYa/I2ueq9xb0Au58Uv/k
FF3ROOQgXIcVYZDhdDfjSDoqtnpLL71K49w4lMPiHmsAjsx+g28UcGXCDAeX0TH8
zhIt3OozWAAzhhuwOmn8oXh5hUOkguT67Z+l/U7Foo4zTpzklHiFdMeH6BvbVkp+
CxmjsvyIvi136D6Mi8Hnsllj5Y6qtIH2MbsxFbvD4tOvrSoL5O6K9T7z1iKM0Oty
5d6XdCOIXTE3qqCs99gqK0YstxMVzSSlgc7KOMgixZVqrlkuelCCKK0lvAqWoHc=
=JKkl
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] referenced memory management across dlls/exe (Windows only)

2015-03-01 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Nick,

On 28/02/2015 14:46, Trajce Nikolov NICK wrote:
 I am facing a problem with memory clean-up when mixing the place of 
 allocation across
 dlls and the executable. Let say I have main executable that loads dlls 
 (plugins) in
 which I allocate memory using referenced pointers. On exit, those pointers 
 that were
 allocated in one of the dlls got stucked in ... If I clean these pointers 
 from the
 originated dll, it works ok, otherwise not.
 
 Any clue?

You end up with different instances of the runtime library, each with its own 
heap
management.  You allocate the object on the heap of one DLL and free it onto 
the heap of
the other - bang.

Sorry, I don't know what the corresponding flag might be on mingw.

Cheers,
/ulrich
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBCAAGBQJU8vDIAAoJEP8WARS52jMYq6gH/Axcl3evhaF8tdjUePeHb707
Et4rociiWaZdVu2Cq3x3TWr6MvOqqdcJMka1h7z0Nyy43FI0HI2s63NdPiXH5LcS
BYC8j1w8BTzOisOUYyQJwGaqt4856ne2tHAjAU47Qp5bAsvbx7ZTZa0VU2ncLmJt
A5P2TOtDRGBjtxoQc4Kmx33AWHFzX3iT+yaN5v6EUTVO3MReQTqWCXdJWr+/GC/0
DMWmO/ZhGLis2NONoDGeNtZtgABPhg91Z+tZt0jYyzEkJ9eC4WN+F7x++0NPfRaf
BBAzFN8Ch9YA4mcMjQF2TkqEdMcBHnmUb49ObUbU6fHd9Ce946dwfrB1gtlne4M=
=Q7H0
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Moving a model with NodeCallback

2014-09-18 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Chris, hi Mattias,

On 17/09/2014 20:19, Mattias Helsing wrote:
 Hi again, some more 2p I'm not an animator myself but I'm guessing the hand 
 model
 was rigged and skinned in 3ds max

That was my guess as well and a look at the converted lefthand.osgt confirms 
this, I
think.  I can find only two Geodes, HandsREAL_ and nailsFix2.

How skinning works is that there is a skeleton ('bones', made up of a hierarchy 
of
matrices) and a mesh, that is connected to and deformed by the skeleton.  This 
requires
additional information for each vertex to control how much it is influenced by 
a given
'bone' (e.g. a vertex in the left thumb will not be influenced by the bone for 
the left
pinky).

There is support for this in osgAnimation (the osganimationskinning example 
looks like a
starting point), but I don't know which loaders actually support this.

Hope this helps a bit.
Cheers,
/ulrich

- -- 
Fingerprint 0227 8EE1 2C64 8EF4 DA11 9864 FF16 0114 B9DA 3318

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBCAAGBQJUGoFYAAoJEP8WARS52jMYwgEIAI/FRLnzUCoGIqvUZTmT3FeU
NDtxNc0evZn/ENOtl+f2UxyYptZ6ez0SU+P9FWNaIZyixzN6cOG/gCUlKH706Tun
Itdo2ZNG8ecXW+yPVOLa4tjxM3ATr8zo2jPxLk7tQtlagw8EF3PKy6N45amLB50K
1DZVnW17THXHFsOLNe8yGL+Ux3fNKW1I+8oZ6XNW3YXComLAq1ZsL/B842Nc3eDE
LwDbb53CrTDWerLuifXXtoljT2H2gr9X4dDJwu7aDh2u60OiV+TU4mSDxJF/O/5S
TFpehbQrn3Hr7EGnBk/4Lt9X3L+zbbLS+5V9aSSvJbHDo4T4NekoZ0NqTA4a9Ko=
=gz3B
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] BoundingBox centre location after PossitionAttitudeTransform translation/rotation

2014-04-01 Thread Ulrich Hertlein

Hi Petr,

Quoting Petr Svoboda upd...@seznam.cz:

If I point to an object I want to visualise it somehow (create
BoundingSphere over that *.OSG model) and for that I use
ShapeDrawable-Sphere with StateSet to PolygonMode which works nicely.

But the problem is:
The intersection visitor accepts (finds intersection with) that
visualised BoundingSphere and if I then ask for  worldcoordinates
with getWorldIntersectPoint() and count difference in Z axe between
my position from which I'm pointing to an object and Z position from
getWorldIntersectPoint() vector then it is just some huge number
like 16,18 etc. Without visualised BoundingSphere is just 2, 2.5.

I think that there are 2 solutions:

1) Is it possible to find intersection only on *.osg model and not
on that drawable? Both *.osg model and Geode-ShapeDrawable-Sphere
are children of PositionAttitudeTransform.


I don't think you can filter drawables during intersection.

But if you put the ShapeDrawable/Sphere under another Geode under the
existing PAT then you can exclude that node from intersection
traversal using the node's mask and the traversal mask of the
intersection visitor.

Cheers,
/ulrich


pgpvXTMLqdkvq.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::ref_ptr thread safety

2014-03-07 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 6/03/2014 20:09, ttaw wrote:
 From: Ulrich Hertlein u.hertl...@sandbox.de mailto:u.hertl...@sandbox.de 
 try
 m_resource.release().

Thanks, whoever you are.

But that moves the ownership from the class to the caller and is not what I'm 
after.
Plus it doesn't solve the potential problem of thread-safety.

Cheers,
/ulrich

 Hi guys,
 
 during a recent discussion at the office the question was raised whether or 
 not
 there's anything architectural that's stopping the owner of a ref-counted 
 resource to
 return it via a raw pointer and dereference (and hence delete it) before it's
 assigned to a receiving ref_ptr.
 
 Along these lines: caller: Resource* r = foo(); owner: return 
 m_resource.get() 
 (separate thread does m_resource.reset() or similar) caller: ref_ptr p(r);
 
 ref_ptr is assigned return value of 'foo()' which is now a dangling pointer. 
 (Yes,
 you would usually do 'ref_ptr p(foo())' but that's not fundamentally 
 different from
 the above sequence.)
 
 To the best of my knowledge there's nothing in the design of ref_ptr that 
 stops
 this, but then again I don't believe it's an issue because otherwise we'd 
 surely have
 heard.
 
 Can anyone think of something (in the ABI, or elsewhere) that would prevent 
 this?
 
 Cheers, /ulrich

- -- 
Fingerprint 0227 8EE1 2C64 8EF4 DA11 9864 FF16 0114 B9DA 3318
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBCAAGBQJTGiHVAAoJEP8WARS52jMYpzAH/0GSSjBnQzV1+rQc2Y7/GXtU
5jLJxSurSdezv1bMJ8WylB4L8td2LD2vGEd5nKFNVF7hZHaNIGkXDzA5qEb1MfaW
OXwxFu+yVzScxolJx+PT/stZRxsBXocr7X2lJJ1zYdFsWV+QCzN8r+301vcqYqih
dToKEA2p4c+a0D3lPla4XvTHkmm1ZK1XQF3iIwxfQucA9UQpKxBC3AVdyxSuwDPG
Klqfa0lFXo8OmRrtPHXL3ExPEwwFHAcZQHugwxvxWqI+rICZGQoffpDfs8Nf58JK
WNcBIdw4qg2Y9Cc9X4kfimsY7eYyaQ3ihWHLHpYAMUT2+igg92WaZHJ5rpw3L0o=
=VwT/
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::ref_ptr thread safety

2014-03-07 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Robert,

On 6/03/2014 12:48, Robert Osfield wrote:
 Hi Ulrich,
 
 If you get a C pointer from a ref_ptr you are explicitly moving outside the 
 scope
 of automatic reference counting.  It's only safe to get and use a C pointer 
 from a
 ref_ptr if you know the object being referenced will not get unreferenced 
 during
 the lifetime of the C pointer.  If you don't feel comfortable with this
 responsibility then simply don't get a C pointer, just pass around 
 ref_ptr's, the
 availability of get() method is to allow power users to use the speed and 
 flexibility
 of the C pointer when they know it's safe.

Yes, that was my understanding too.
I was just advocating this procedure since it's sort of most-common practice in 
OSG to
return raw pointers and the question came up.

Thanks,
/ulrich

- -- 
Fingerprint 0227 8EE1 2C64 8EF4 DA11 9864 FF16 0114 B9DA 3318
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBCAAGBQJTGiILAAoJEP8WARS52jMYSHQH/RTfB/So+bUHblOEnpC8UUqU
G8EYyOzPejeo7kDAGN8fPegSVYQLrkkZGSIGOjOnivl7PSUH92UChzvMGSf8s8XX
gG29Sa0vSiWPaTn6O7+6dSu16x2PxYlXSPcWIvk1pTJSFMpNofVS/xAQuqaUqzaw
8iTs9a49mkm69PNH5JzmzSDzeXDvxYwLJ4AdlO+YkSJDI3lych3cb8Qhx75cMyWW
pkQpa8pXTQXgBgFE3njfWQFaUDyzjkj2Ms3lkNgJtuXfyTa7zKU2fNDM3RyZ5JXr
q6txWStp+gnqUwdw6nGCY6D2t/2SoiVUVXWgJgK9uql8uEJ3v5kbJoGSzKqe9ME=
=AgNn
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] bug stl pugin?

2014-03-05 Thread Ulrich Hertlein

Hi Anneke,

Quoting Anneke Sicherer-Roetman letter...@hotmail.com:
I just installed version 3.2.0. Now, when reading an .stl file with  
the pretaining plugin, I get vector subscript out of range in the  
readNode function. I temporarily reverted to 3.0.1 to bve able to  
continue my work, but what can I do about this??


Could you post a file that exhibits this behaviour?

Cheers,
/ulrich


pgp4F0ES6O3cU.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] ld: symbol(s) not found for architecture x86_64

2014-03-05 Thread Ulrich Hertlein

Hi Michael,

Quoting Michael Zurek michael.zu...@gmail.com:
I downloaded the stable release 3.2.0 which I am able to build  
(without libc++) but whenever I compile an application I'm getting  
ld: symbol(s) not found for architecture x86_64. I don't use xcode  
though. I'm using clang++ from Apple and libc++ that comes with the  
developer tools but I'm using Code::Blocks for my programming. I  
have compiled OSG with the dependencies package that can be  
downloaded from the website. Somewhere on the forum I found a thread  
talking about this error and libc++. So I checked out the svn last  
night ...

michaels-mbp:build michael$ make
Scanning dependencies of target OpenThreads
[  0%] Building CXX object  
src/OpenThreads/pthreads/CMakeFiles/OpenThreads.dir/PThread.cpp.o

g++-4.8: error: unrecognized command line option '-stdlib=libstdc++'


How did you configure cmake?
From the output it looks like it's using g++-4.8 but with clang options.

Maybe you could explain your setup again, because I'm slightly confused:
at one point you're saying that you *ARE* able to compile OSG (without  
libc++, with what compiler), but you're getting errors linking an  
application (which C++ lib, which compiler?); then you're saying  
you're only using clang and libc++?


Please rephrase ;-)

Cheers,
/ulrich


pgpADuZYtakmj.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg::Sequence and reversing direction

2014-03-05 Thread Ulrich Hertlein

Hi Sebastian,

did you try setBegin()/setEnd() with the last and the first child  
respectively?

(But I'm not claiming to know Sequence any better.)

/ulrich



pgpdaG3yglw1Z.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg::ref_ptr thread safety

2014-03-05 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi guys,

during a recent discussion at the office the question was raised whether or not 
there's
anything architectural that's stopping the owner of a ref-counted resource to 
return it
via a raw pointer and dereference (and hence delete it) before it's assigned to 
a
receiving ref_ptr.

Along these lines:
caller: Resource* r = foo();
owner:  return m_resource.get()
(separate thread does m_resource.reset() or similar)
caller: ref_ptr p(r);

ref_ptr is assigned return value of 'foo()' which is now a dangling pointer.
(Yes, you would usually do 'ref_ptr p(foo())' but that's not fundamentally 
different
from the above sequence.)

To the best of my knowledge there's nothing in the design of ref_ptr that stops 
this,
but then again I don't believe it's an issue because otherwise we'd surely have 
heard.

Can anyone think of something (in the ABI, or elsewhere) that would prevent 
this?

Cheers,
/ulrich

- -- 
Fingerprint 0227 8EE1 2C64 8EF4 DA11 9864 FF16 0114 B9DA 3318
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBCAAGBQJTF5BRAAoJEP8WARS52jMYaHcH/igaGEoeexD1kdO2c3KNER/N
VCeLvswEvoWqTV6Q9legodZgGUgeAXClx8p+lZcM8uizTLy5LknDkRn87It58vF8
cJfZLcgbwuw/8BA3qF/iURn8taAgqBYM97t1tWPuLnoshnW1WU0C6G5Q8uJuWRUR
TfqVxCvcllXLOZPefOeS3cLI4YUgxIRywUGNTW5A+4/vNa2kJAvVr1ZDnuT8/fjg
vpYiV761iR+TM/bKPTS1+wsC723iYFSYl/7WL1Sgy/NevB/BUz9H75wtkyCXib3J
APlweXbYZF2RH20Mu/3hO59SLrOZ8wefEOtc2fXjNn2URAfzVmr9mPRtphJTCUE=
=YK8M
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Hidden Memory Leaks

2014-02-26 Thread Ulrich Hertlein

Hi Amir,

Quoting amir amir.yi...@gmail.com:

Env: Win7/64bit/MSVC 2008/OSG3.0.1
I make unusual use of OSG - in every iteration I set new parameters,
then I read the results to images and use them (no graphic display  
is required!)

I have my app keep growing all the time...
Any suggestion?

I'm using the OSG smart pointers (ref_ptr) well - following the doc.
DevPartner Memory analyzer reports any space allocated and assigned  
to ref_ptr as a leak, but I assume it couldn't handle it...
Except that, it doesn't find any leak. I just see the process keeps  
growing in the TaskManager.


Schematically, I do the following (pseudo-code):
(notice all required objects are ref_ptr in my real code)

ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer;
ref_ptrosg::Image colorImage = new osg::Image;
ref_ptrosg::Image depthImage = new osg::Image;

viewer-setScheneData(model);

foreach givenViewport
{
  // create 'traits' with some values, inc. target = FRAME_BUFFER_OBJECT
  gc = osg::GraphicsContext::createGraphicsContext(traits.get())
  camera = viewer-getCamera()
  camera-setGraphicsContext(gc)


Are you doing this for every frame/iteration?  Your code sample  
doesn't make it obvious.

I could imagine creating a new context every frame to leak GL resources...

Cheers,
/ulrich


pgpCAseaxz6Iu.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem with 3D image for scientific visualization

2014-01-21 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Josiah,

On 21/01/2014 9:56, Josiah Jideani wrote:
 ...

 The code has been working fine until I developed a new imaging algorithm and 
 had to
 increase the size of the volume.  Here is the code snippet that sets up the 
 viewer: 
 ... The typical values for _S, _T, and _R used in the allocateImage() 
 function call
 are 127, 2048 and 63 respectively and they are represent the exact size of 
 the data
 matrix.

What were the previous dimensions for the 3D texture?  I haven't used 3D 
textures in
ages, but those dimensions look suspicious to me...

You might want to enable debug output and check for errors there.
(Unless the previous dimensions were somewhat similar and I'm way behind 3D 
texture usage.)

Cheers,
/ulrich

- -- 
Fingerprint 0227 8EE1 2C64 8EF4 DA11 9864 FF16 0114 B9DA 3318
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBCAAGBQJS3kotAAoJEP8WARS52jMYltsH/21DKEvILbdLNZejEXgJeiPy
xRPTV8bTkdQQcYTGpye4JF6gkSV7oIIf8VskYNrZSqfGmPv8kMPGRdGdczHjav08
B0SIxn+ORd/DdD+UXXVf8jQ8JI+HovwUcynW482C4LiVChIeOqQTz9SGXHyLZLFu
q7u8YbkhEHPo9SqK3dCahvicd8hMS0B9eO78hqmWFeZmctRJWrBwyqc7cv6dGfDb
1Y7J2AkwSituQ8ZaXrcG2E3EBH/6VTW2GariqZIOe//FxMn1ZW29FBD6paSu/mAD
4Ufqtn9TX5wkGzRD6ocEEMXjQRPGgZtUlcd2u6jJIkuvXA7tnzi6BdSbLV1vF18=
=ev/Z
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Ulrich Hertlein

Hi John,

Quoting John Moore kahar...@gmail.com:

In my app I am using 2 textures of size 4096x2048.
I have a serious problem of memory usage.

...

using this code my app jumps from 20 MB of memory to 250 MB of memory usage

Since I am developing on mobile platform this is a huge waste of memory.

I partially solved the problem by changing the MIN_FILTER from  
LINEAR_MIPMAP_LINEAR to LINEAR

Now the memory usage is 150MB

It's still a lot!

Do you know a way to optimize the memory usage of these 2 textures?


You can set 'osg::Texture::setUnRefImageDataAfterApply' on the texture  
if you don't need to keep the osg::Image in memory.


Cheers,
/ulrich


pgpxWspjKSkbs.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] singleton instane

2013-10-18 Thread Ulrich Hertlein
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Sajjadul,

On 13/10/2013 1:12, Sajjadul Islam wrote:
 Thanks for the suggestion of the singleton design . I tried to design a 
 template base
 class as follows :
 
 Code: ... templateclass T class Singleton { public: /** * Init the actual
 singleton. * Must be called BEFORE the class is used, like this: */ static 
 void
 init() { assert( singletonClass_.get() == NULL); singletonClass_ = new T; }
 
 
 /** * Get Pointer of the actual class * @return Pointer of the actual class 
 */ static
 T* getPtr() { assert( singletonClass_.get() != NULL); return
 singletonClass_.release(); } ... But it crashes at the assertion. I tried 
 without
 assertion , then debugger simply exits at the point where i call: ... 
 osgOpenCL::Context *cxt = osgOpenCL::SingletonosgOpenCL::Context::getPtr();

Did you call 'init' on the singleton class before this?

Also, the 'getPtr' is buggy, since it calls 'release' on the singleton object.  
This
will work the first time round, but delete the object afterwards and will crash 
on
subsequent calls.

Cheers,
/ulrich

- -- 
Fingerprint 0227 8EE1 2C64 8EF4 DA11 9864 FF16 0114 B9DA 3318
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (Darwin)

iQEcBAEBAgAGBQJSYQ9qAAoJEP8WARS52jMYWY8H+wR8F/mt7t6DWYbBr7TVwTmA
/w1UO9B+VtV2ZOlX/E/Z3U6ooKZu4K/jKYU0gihqOCUVNVmops3BILr9AGRStgu6
e6Z/rSxYB7zQRjJl3D25gfg9Y+s+/oe2668Yyq8XQmZ6FABbSVTHnNEXRnwQO+XB
n2po44cQ/i+O5pIbACWr3PgDvejcIxf/AvJoIArz+R5j3jZUC/4ig6k6o6tFn8Uo
esV+DXZg80nGTx8fus+piqSEENUNmzm/2/POBFNxKuXLjX9s11lsHv0K4FtOi+ap
8Z4fshX9Mw79LElGH1hf3qbj61/weyOw9lZarRh1BFaWYTsmoNVcwYQH78PfNXY=
=2pYO
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Issue With osgDB::writeNodeFile Writing New Material to .osgb

2013-09-30 Thread Ulrich Hertlein

Hi Patrick,

Quoting Patrick Keenan pk...@hotmail.com:
I have an osg::ProxyNode model that I change the material on then I  
try to update the file itself so that next time I run the program  
the changes persist. If I save it to my_model.osgb then the next  
time I go to open it osgDB::readNodeFile locks up trying to read the  
file, ...

Code:

void M_model::Set_material(void)
{
osg::ref_ptrosg::Material mtl = new osg::Material;
float alpha = 0.3f;
mtl-setAmbient(osg::Material::FRONT, osg::Vec4(0.75f, 0.53f,  
0.19f, alpha));

...


osg::StateSet* ss = _prox_node-getOrCreateStateSet();
	ss-setAttributeAndModes(mtl.get(),  
osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

ss-setMode(GL_DEPTH_TEST,osg::StateAttribute::ON);

...

This is just a hunch, but is '_prox_node' the ProxyNode or the node  
loaded from the file?  Did you try to modify/save the child node of  
ProxyNode?


Cheers,
/ulrich


pgpUbj2ZzC_Jo.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Issue With osgDB::writeNodeFile Writing New Material to .osgb

2013-09-30 Thread Ulrich Hertlein

Follow up:

If '_prox_node' the the ProxyNode referencing the file 'frame_6' then  
you will end up creating an infinite recursion by having an ProxyNode  
in your original file that references a file with a ProxyNode to itself.


Anyway, just a hunch as I said.

You can verify that by saving to .osgt and having a look at the file.

Cheers,
/ulrich


pgp2zxtmfVfeb.pgp
Description: PGP Digital Signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using c++11 smartpointer instead of osg::ref_ptr?

2013-08-02 Thread Ulrich Hertlein
On 2/08/2013 17:46, Mathias Fröhlich wrote:
 This design problem with shared_ptr forces you to copy
 shared_ptr's all the time when access data members which just can't
 be efficient and requires end users to always stick to this rule.
 Ack!
 Also you need twice as much mallocs because the reference counts need to be 
 allocated seperately.

std::make_shared allocates object and ref-counter in one allocation :-)

C++11 also has std::enable_shared_from_this which solves some issues, but still 
hasn't the
same semantics as osg::ref_ptr.

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


Re: [osg-users] Using c++11 smartpointer instead of osg::ref_ptr?

2013-07-31 Thread Ulrich Hertlein
On 29/04/2013 2:53, Maik Klein wrote:
 I am wondering if it is possible to use the c++11 smartpointer instead of
 osg::ref_ptr?
 Is there any advantage in using the osg::ref_ptr?

Mixing the two is a bad idea, as they will happily ignore one another ;-)

One benefit of osg::ref_ptr is that the reference count is part of the object, 
so even if
you return a raw pointer at some point you could stuff it back into a ref_ptr 
without
things getting stuffed up.

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


Re: [osg-users] osgdb_shp plugin's XBaseParser may have aerror

2013-07-24 Thread Ulrich Hertlein
Hi ChaosWong,

On 24/07/2013 2:59, ChaosWong wrote:
 I work under windows, and which platform do you work?

Linux and OS X.

 so I think it's never return 0, because 0 is usually represent Standard 
 input (stdin).
 If function fail, it should return -1, i think.

Yes, it will return -1 on error, but it can return 0 as well, if 
stdin/stdout/stderr are
closed (like for a daemon).

But that wasn't my main point, the solution that you and Robert worked out is 
correct (no
close in the error case).

After reading the code it is clear that 'parse(fd)' will actually close the file
descriptor when it's done reading.  Unless an error occurred, in which case the 
fd will
never be closed and effectively leak.

Also, if it succeeds with fd=0 it will close stdin!  Funny things can happen 
when you do that.

I realize that you didn't write the code but thought that if you're doing 
modifications in
that area this might be worth fixing as well.

Cheers,
/ulrich

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


Re: [osg-users] osgdb_shp plugin's XBaseParser may have aerror

2013-07-23 Thread Ulrich Hertlein

Hello ChaosWong,

Quoting ChaosWong chaosw...@qq.com:
i develop osg application under windows. when i was loading a .shp  
file,  my application was crashed. after i tracked, i found i miss a  
.bdf  file, and code was crashed at red line:


XBaseParser::XBaseParser(const std::string fileName):
_valid(false)
{
int fd = 0;
if (fileName.empty() == false)
{
#ifdef WIN32
if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) = 0 )
#else
if( (fd = ::open( fileName.c_str(), O_RDONLY )) = 0 )
#endif
{
perror( fileName.c_str() );
if (fd) close( fd );
return;
}
}

_valid = parse(fd);
}


I don't have the code available, but the whole piece looks fishy to me:
- if the fileName is empty, it calls 'parse(fd)' with fd==0
- if the fileName is valid, it opens the file and calls 'parse(fd)',  
but leaks the file descriptor

- god only knows what happens when an exception is thrown

Cheers,
/ulrich

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


Re: [osg-users] Nodes not being displayed in Kubuntu 13.04 with AMD

2013-07-15 Thread Ulrich Hertlein

Hi Roland,

Quoting Roland Hill roland.h...@fourwindstechnology.com.au:
The upgraded machine is a laptop with an AMD Mobility Radeon 5850.  
Everything worked perfectly before upgrading from 12.04.


I still have a desktop running Kubuntu 12.04 with an Nvidia card and  
the same code base works perfectly.


I have tried OSG 3.1.6, 3.1.7 and 3.1.9 and all have the same  
problem on the 13.04/AMD machine.


Stating the obvious here, but from your descriptions it sounds like a  
problem with the 13.04 AMD drivers rather than anything related (and  
hence fixable) in OSG.


You could verify by installing 13.04 on the nvidia machine.

Cheers,
/ulrich


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


Re: [osg-users] [build] Building a libc++ project against OSG on Mac OS X

2013-05-24 Thread Ulrich Hertlein
On 6/05/13 20:42, Kellen Gillespie wrote:
 @ulrich - Thanks for the reply!  It definitely makes sense to me that OSG 
 would also
 need to be built with libc++ / c++11 in order to properly be linked to by my 
 project.
 
 Since that's the case, do you remember how you did build OSG with those 
 features?  I've
 tried compiling OSG with libc++ but MANY of the Osg Plugins fail to compile 
 when I'm
 using libc++ instead of libstdc++.  Did you not run into these problems 
 compiling OSG?

Did you compile the plugin libraries with the same runtime library?
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dinamic Line Drawing

2013-05-13 Thread Ulrich Hertlein
Hi Patrick,

Similar to the change that Judson suggested for 'Add_new_point', the 
osg::Matrix and
osg::Vec3f you pass into the constructor should be 'const osg::Matrix' (same 
for vector),
otherwise you are making a copy of the object every time.

The empty destructor is okay, as everything is contained in smart pointers and 
will be
properly cleaned up.  (Except for the original usage of 'Add_new_point'.)

Unless you need them for later modification, you don't have to have member 
variables for
the matrices, the osg::Geode, and the color/normal arrays.

Cheers,
/ulrich

On 10/05/13 23:57, Judson Weissert wrote:
 Hi Patrick,
 
 On 5/9/2013 9:16 PM, Patrick Keenan wrote:
...
 Code:

 osg::Vec3Array* line_pts = new osg::Vec3Array;
 line_pts-push_back(osg::Vec3(100, 0, 0));
 line_pts-push_back(osg::Vec3(0, 100, 500));
 line_pts-push_back(osg::Vec3(100, 100, 100));
 

 lines_test = new 
 M_OSG_line_strip(osg::Matrix::rotate(osg::inDegrees(0.0f), 0.0f,
 0.0f, 1.0f),
 osg::Matrix::translate(0.0f, 0.0f, 0.0f),
 
 osg::Matrix::rotate(osg::inDegrees(0.0f), 0.0f,
 0.0f, 1.0f),
 line_pts,
 osg::Vec4(0.0f,1.0f,1.0f,1.0f)
 );
 
 Memory leak if lines_test assignment line throws an exception (lines_pts will 
 leak). An
 osg::ref_ptr would solve this.
 
...
 Code:

 void M_frame::OnTestBtnClick(wxCommandEvent WXUNUSED(event))
 {
 osg::Vec3f* new_pt = new  osg::Vec3f(4000.0f, 2000.0f, 0.0f); // works
 lines_test-Add_new_point(new_pt);
 }

 Another memory leak for all points created since nobody is calling delete. I 
 suggest
 passing osg::Vec3 parameters by value or const reference.
 
 Regards,
 
 Judson

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


Re: [osg-users] [build] Building a libc++ project against OSG on Mac OS X

2013-05-06 Thread Ulrich Hertlein
Hi Kellen,

Yes, I've used OSG with clang++/libc++.

The error you're seeing is due to trying to link libraries that use different 
runtimes.
In your case OSG is probably using libstdc++ and your own project is using 
libc++.  They
have to match, which means you have to recompile OSG.

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


Re: [osg-users] Problem loading RGBA bmp.

2013-03-12 Thread Ulrich Hertlein
Hello nameless stranger,

On 13/03/13 1:19, Peterakos wrote:
 I try to load a bmp image and set it to a texture.
 When i render the model with the texture (using shaders), even though
 the rgb channels are passed fine, the alpha channel is always 1.

Can you make your BMP file available?
I have a collection of .bmp files that I used for testing the bmp plugin, but 
only one has
an alpha channel and that is only 1-bit.

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


Re: [osg-users] Two question about (bounding box and select object)

2013-02-19 Thread Ulrich Hertlein
Hi Sahar,

What doesn't work with the bounding-box code?  Does it display the wrong bbox?  
Does it crash?

On 19/02/13 18:14, Sahar Aseeri wrote:
 group-addChild(lineGeode);
 
 group-addChild( model1 );
 group-addChild( model2 );
 
 int index1;
 index1=0; 
 
 osg::Geometry* geome = 
 group-getChild(index1)-asGeode()-getDrawable(0)-asGeometry();
osg::BoundingBox bb=geome-getBound();

You're getting the bounding box of the first child, which is 'lineGeode'.
This is most likely not what you want.

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


Re: [osg-users] [build] Running the examples on mac OS X snow Leopard 10.7.5

2013-02-12 Thread Ulrich Hertlein
Hi guys,

The error you're seeing points to a configuration issue with the Carbon vs. 
Cocoa
windowing system.  Check the value of the OSG_WINDOWING_SYSTEM cmake variable - 
maybe
neither is selected?

FWIW I always install OSG as 64-bit on OS X and use Cocoa as the windowing 
interface.
Where did it say that you should build 32-bit?

Cheers,
/ulrich

On 12/02/13 16:59, Craig Miller wrote:
 I'm having the same problem.  I installed via MacPorts.
 
 Craig
 
 Craig Miller http://spatialminds.com
 
 On Jan 30, 2013, at 9:21 AM, Yakhoub DRAME yakd...@gmail.com wrote:
 
 I've encountered a problem while installing Openscenegraph 3.0.1 on my mac : 
  i guess
 the first step to check if it was well installed was to run the examples,
 unfortunately none of them are working. It's advised to install 
 Openscenegraph in 32
 bits on mac OS X for the time being because the osgviewer files can only 
 work in
 32bits for now on snow leopard (there have carbon commands and carbon was 
 replaced by
 cocoa on snow leopard if i understood well). So i opened Cmake 2.8.10, put 
 i386 in
 the architecture slot, generated an Xcode project, built it and ran it 
 To test if
 Openscenegraph was well installed, i opened the bash, went in the 
 Openscenegraph
 repertory, and i ran the sh runexamples.bat command. There were still errors 
 like
 Error, no WindowSystemInterface available, cannot create windows. or
 Viewer::realize() - failed to set up any windows... Does anyone know how 
 to bypass
 this matter? Maybe i did some things wrong on the way.
 
 Thank you!
 
 Cheers, Yakhoub
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Failure in casting to osg::AnimationPathCallback*

2013-02-07 Thread Ulrich Hertlein
Hi Philip,

On 7/02/13 15:34, Philip Lamb wrote:
 UpdateCallback: className is AnimationPathCallback and type_id.name() is 
 PN3osg12NodeCallbackE
 
 So it looks like a failure somewhere in RTTI. Both typeid and the 
 dynamic_cast fail to
 convert the osg::NodeCallback* to an osg::AnimationPathCallback*. Yet 
 clearly, the
 callback IS the right type, as evidenced by OSG's className() function's 
 output.
 
 Any ideas about where this kind of issue might be coming from?

This does ring a dim bell somewhere.  Something about type-comparisons being 
done by
pointer rather than name and hence failing when the objects come from different
compilation units.

I haven't got any keywords or links, but I believe there is a compiler flag 
that you can set.

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


Re: [osg-users] Fix for building with ref_ptr::get()

2013-02-04 Thread Ulrich Hertlein
Hi Paul,

On 5/02/13 8:40, Paul Martz wrote:
 I wanted to start a discussion on the CMake variable
 OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION. Does anyone else besides me 
 change this
 variable from its default ON state to OFF? If not, should we just remove it?
 
 The reason I ask is that it seems like every time I do an update from trunk, 
 the latest
 source contains some changes that assume this variable is always on, and the 
 code fails to
 compile if the variable is off. Here's an example:
 osg::ref_ptr osg::Group  source;
 osg::Group* dest;
 dest = source; // Compile error, should be dest = source.get()
 
 I got in the habit of always disabling implicit ref_ptr output conversion 
 because someone
 once tried to use my osgWorks project with an OSG that had been built with 
 the CMake
 variable turned off. The only way for me to make sure my project builds is to 
 do all my
 testing with the CMake variable turned off. Code written with the variable in 
 an OFF state
 will build whether the variable is ON or OFF, but code written with the 
 variable in its
 default ON state stands a good chance of failing to compile when the variable 
 is flipped OFF.

I have never changed the CMake variable (having only vaguely been aware of it), 
but have
always used 'source.get()' in my own code.

Following the mantra 'explicit is better than implicit' I would like to 
advocate to remove
the 'feature' (basically setting it to OFF) AND to remove the CMake variable.

This follows std::shared_ptr and std::unique_ptr.

Yes, this will break some code but maybe for the better?

Cheers,
/ulrich

PS: On a related note: how do you folks feel about slowly starting to adopt 
C++11
features?  I feel like a kid in a candy store with all the new stuff that has 
come along!  :-D
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] getting errors in creating First OSG program

2013-02-04 Thread Ulrich Hertlein
On 5/02/13 14:29, om prakash Paliwal wrote:
 /usr/bin/c++
 */-I/home/heart-hacker/OpenSg/build_OpenSceneGraph/include/OpenThreads
 -I/home/heart-hacker/OpenSg/build_OpenSceneGraph/include/osg
 -I/home/heart-hacker/OpenSg/build_OpenSceneGraph/include/*-o
 CMakeFiles/MyProject.dir/main.cpp.o -c 
 /home/heart-hacker/OpenSg/project/main.cpp
 /home/heart-hacker/OpenSg/project/main.cpp:2:20: fatal error: osg/Node: 
 No such file
 or directory
 compilation terminated.
 make[2]: *** [CMakeFiles/MyProject.dir/main.cpp.o] Error 1
 make[2]: Leaving directory `/home/heart-hacker/OpenSg/project'
 make[1]: *** [CMakeFiles/MyProject.dir/all] Error 2
 make[1]: Leaving directory `/home/heart-hacker/OpenSg/project'
 make: *** [all] Error 2
 
 And i have highligted the -i flag. it would be easier to see . One 
 thing i want to
 mention , when i browse through my include file earlier i only had two 
 folders namely
 osg and openthread .. Rest of the header file were not there.. So i had 
 to copy others
 from source directory  
 
 Anything i am missing?

The directory you've set in OSG_DIR is the build directory, which only contains 
the
binaries and generated files.  The header files are never supposed to be there.

If you do a 'make install' you'll get the libraries *and* the header files 
installed into
a common location, such as /usr/local.

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


Re: [osg-users] getting errors in creating First OSG program

2013-02-03 Thread Ulrich Hertlein
On 3/02/13 16:52, om prakash Paliwal wrote:
 I fixed this error as directed by you . but the problem of compilation 
 with make is
 still there ... 
 
 heart-hacker@hearthacker-HP-Pavilion-g6-Notebook-PC:~/osgproject/program-2$ 
 make
 [100%] Building CXX object CMakeFiles/MyProject.dir/test.cpp.o
 /home/heart-hacker/osgproject/program-2/test.cpp:1:23: fatal error: 
 osg/ref_ptr: No such
 file or directory
 compilation terminated.
 make[2]: *** [CMakeFiles/MyProject.dir/test.cpp.o] Error 1
 make[1]: *** [CMakeFiles/MyProject.dir/all] Error 2
 make: *** [all] Error 2

Could you run make VERBOSE=1?
It looks very much like whatever directory is passed is *not* the one where OSG 
is
actually installed.

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


Re: [osg-users] getting errors in creating First OSG program

2013-02-03 Thread Ulrich Hertlein
On 3/02/13 22:51, om prakash Paliwal wrote:
 i executed make VERBOSE=1 and getting a screenful list of texts saying 
 somthing has been
 depriciated and at the last is says
 
 make[2]: *** 
 [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoder.o] Error 1
 make[2]: Leaving directory `/home/heart-hacker/OpenSg/OpenSceneGraph-3.0.1'
 make[1]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/all] Error 2
 make[1]: Leaving directory `/home/heart-hacker/OpenSg/OpenSceneGraph-3.0.1'
 make: *** [all] Error 2

The above is apaprently from the OSG build directory and any build error there 
may or may
not be relevant but since that's not the error you're trying to solve I'll 
ignore it.

What I meant was to compile *YOUR* program with 'make VERBOSE=1' and check what 
'-I' flags
it sets to find the OpenSceneGraph headers.

You should find the compiler command line for the file that's failing to 
compile and it
will contain various '-I directory' lines, one of which should point to the 
directory
where you have OSG installed.

Cheers,
/ulrich

PS: Please respond to the mailing list thread rather than a private mail.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Fedora 18 with nVidia driver: OSG crashes session

2013-01-31 Thread Ulrich Hertlein
Hi Stuart,

On 31/01/13 20:45, Stuart Mentzer wrote:
 Hi Robert,
 
 No luck: Both osgviewer and my (debug build) app bring down the session even 
 running
 under gdb.
 
 Running my app in its non-GUI mode that brings up a stand-alone OSG window 
 doesn't kill
 the session. Instead I get:
 
 Code:
 
 Error: Not able to create requested visual. GraphicsWindow has not been 
 created
 successfully. Error: Not able to create requested visual. GraphicsWindow has 
 not been
 created successfully. Viewer::realize() - failed to set up any windows

I agree with Robert, this doesn't look OSG-specific.

Have you tried running 'glxinfo' and 'glxgears' to check if OpenGL support is 
available?

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


Re: [osg-users] osgFX question

2012-12-06 Thread Ulrich Hertlein
Hi Pjotr,

On 5/12/12 3:40, Pjotr Svetachov wrote:
 We recently converted our stereo viewer to cull the scene graph in parallel. 
 But now we
 are having a crash with some models that have bump mapping effects on them. 
 The crash
 happens in Effect::traverse because both threads try to add new techniques.
 
 Is there a reason this is done during the cull traversal? From my first scan 
 through
 this code it looks like this can also be done earlier, like in the 
 constructor of the
 Effect class. Or will this break other code I'm not aware off? Anyone 
 familiar with
 that piece of code who can shed some light on this issue?

My guess is that this is done later since some effects need to have a valid GL 
context in
order to decide which techniques should be used (based on detected GL features).

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


Re: [osg-users] readNodeFile returns null without CURL env variables?

2012-12-05 Thread Ulrich Hertlein
Hi Tim,

On 24/10/12 3:59, Tim O'Leary wrote:
 When I have OSG_CURL_PROXY and OSG_CURL_PROXYPORT set to valid values, the 
 call to
 osgDB::readNodeFile( foo ) returns a valid pointer, and I'm able to load an 
 *.osg model
 from my C: drive.
 
 When I delete these environment vars, and re-run my project, the call to 
 readNodeFile()
 returns NULL.  Nothing else has changed.  The path that I'm sending to 
 readNodeFile is
 a valid *.osg file on my C: drive.
 
 Presumably, when I delete the CURL env vars, the CURL plugin stops working, 
 and OSG has
 no other way to load my *.osg file.  Is that a true statement?  Does this 
 mean that I'm
 missing a plugin to handle non-CURL file I/O?

Are you specifying your path URL-style, as file:///...?
Curl is not necessary to load resources from the local disk, but they then have 
to be
specified as plain paths.

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


Re: [osg-users] [osgPlugins] Changing CURL environment variables programmatically

2012-12-05 Thread Ulrich Hertlein
Hi Tim,

On 1/11/12 5:32, Tim O'Leary wrote:
 Is it possible to change CURL environment variables (e.g., OSG_CURL_PROXY)
 programmatically, or am I stuck with the same value until I restart my OSG
 application?
 
 I would like to be able to change OSG_CURL_PROXY, and I'm trying to do this 
 by calling
 (in Visual++) SetEnvironmentVariable(OSG_CURL_PROXY, some_URL) but it 
 doesn't
 appear to actually have any effect on OSG/CURL.  I have to shut down my OSG
 application, change the environment variable manually, then restart my OSG
 application.

The curl plugin also supports setting these through 
osgDB::Options::setOptionString.  The
options can be passed to the readNodeFile call.

Be aware that if the environment variables are set, then these take precedence!
(Which actually sounds like a bug to me, code supplied values should always take
precedence over environment supplied values.)

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


Re: [osg-users] What units does Quat::makeRotate accept?

2012-12-04 Thread Ulrich Hertlein
On 5/12/12 15:36, michael kapelko wrote:
 Hi. I can't understand what units (degrees? radians?) Quat::makeRotate 
 accepts.
 I tried to pass degrees, and it wasn't it (with small angle increase there 
 was large
 rotation).
 I tried to pass radians with the help of DegreesToRadians, and then it's not 
 it, too (when
 angle was going from 1 to 14, the screen rotated 3 times).
 So what it is then?

Radians.
Check your assumptions - depending on your usage, applying a Quat(14deg) might 
rotate the
object 14deg every frame!

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


Re: [osg-users] Retrobooster playable demo

2012-12-03 Thread Ulrich Hertlein
Hi Terry,

On 3/12/12 12:30, Terry Welsh wrote:
 From: Thomas Hogarth thomas.hoga...@gmail.com
 Really like the dust clouds kicking up as you approach the ground. Glow 
 effect is great too.

 I'm running windows 7 on a Mac Book via Parallels.

 Thanks, I spent a long time on the particles and glow. And maybe I
 won't have to port to OS X after all :) The glow might be a bit

Please do consider an OS X port!  Since you seem to be using SDL and OSG it 
might not be
that difficult.  And the packaging *can* be slightly more straight forward than 
on Linux :-}

Cheers,
/ulrich

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


Re: [osg-users] Uniform arrays not working for me using Visual Studio 2010

2012-10-25 Thread Ulrich Hertlein
Hi David,

On 25/10/12 2:17, David Sellin wrote:
 I ported my program from mingw and Code Blocks to Visual Studio 2010 Express 
 and found
 that I couldn't get uniform arrays to work. Has anyone experienced this? I'm 
 new to Visual
 Studio so I might have missed something.
...
 Old system:
 OSG 3.0 (revision 12753)
 MinGW and Code Blocks
...
 
 New system
 OSG 3.0.1 (stable release)
 Visual C++ 2010 Express
...

What's the error?
Did you check that it's not the usual debug vs. release libraries issue?
(I'm feeling like a parrot right now.)

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


Re: [osg-users] speed up the loading

2012-10-23 Thread Ulrich Hertlein
Hi Shawl,

On 23/10/12 14:15, wh_xiexing wrote:
   i have hundreds of millions of points to render.i  think the Geometry 
 's 
 setVertexArray (Vec3Array)  is time consuming .
  
 for every point ,  it must construct a Vec3 class, and put it into the array.

Not quite sure which setVertexArray you are talking about, but the one in 
osg::Geometry is
simply a pointer assignment - nothing is copied or constructed.

/ulrich

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


Re: [osg-users] [forum] Problem when nesting osgFX::Outline effects

2012-10-21 Thread Ulrich Hertlein
Hi celandre,

On 16/10/12 3:30, celandre dzimiwine wrote:
 I am trying to add an osgFX::Outline effect (as grand child) to another 
 osgFx::Outline
 effect to have an outlined node of which child is also outlined. But I am 
 getting a
 weird result: The child is displayed in fill mode and line mode (wireframe 
 over fill
 mode rendering). I kinda understand what the problem is but I don't have a 
 solution to
 that. Do you know if there is any solution to this bug?

Could you try to explain what you're trying to do?  As I understand it you're 
*not* trying
to have an outline on an outline (that would of course be insane ;-)

As I understand it you have an Outline FX on a parent and another (same?) 
outline on a
child somewhere in the subtree and they interfere?  Maybe you could use 
nodemasks to
ensure the child is not drawn with the FX when the parent is active?

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


Re: [osg-users] osg::Sequence boundingsphere

2012-10-18 Thread Ulrich Hertlein
Hi Marc-Andre,

On 18/10/12 14:49, Marc-Andre Labrie wrote:
 I guess you are referring to a node visitor when you wrote about
 TRAVERSE_ACTIVE_CHILDREN. I have inspected the code but could not find this 
 mechanism
 for computing the bounding sphere: I thought computebound was called 
 sequentially on
 every children after getbound is called on a node.

Yes, you are right, my mistake.  I was only looking at the traversal function.

The Sequence::combuteBound() is inherited from Group and indeed checks every 
child -
unlike Switch for example, which only looks at active children.

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


Re: [osg-users] osg::Sequence boundingsphere

2012-10-18 Thread Ulrich Hertlein
Hi Marc-Andre,

On 19/10/12 2:01, Marc-André Labrie wrote:
 But I still do not understand why non-visible geodes should take part to the
 boundingsphere calculation.
 
 In my case, in my osg::Sequence, frame1 is way much smaller than frame15 ...

I'm not saying that they should (quite the opposite), osg::Sequence *should* 
only use the
currently active child (like osg::Switch is doing).

Maybe you can submit a patch for that?

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


Re: [osg-users] osg::Sequence boundingsphere

2012-10-17 Thread Ulrich Hertlein
Hi Marc-Andre,

On 18/10/12 11:30, Marc-André Labrie wrote:
 Is there a reason why an osg::Sequence does not calculates its boundingsphere 
 based only
 on its active child (rather than using all of them)?
 
 I can define my own Sequence and override the getBounds() method; but I want 
 to know why
 it is not the default behavior.

From the source it looks like manually setting the traversal mode to
TRAVERSE_ACTIVE_CHILDREN would do the trick.

But it does feel like a better default IMO.

Cheers,
/ulrich

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


Re: [osg-users] Memory usage

2012-10-17 Thread Ulrich Hertlein
Hi Nikos,

On 13/10/12 1:29, Nikos Babasakalis wrote:
 Using test data from the external application and saving the graph to osg 
 files,
 I observed that their size is very big (88 MB in one case and 115 MB in 
 another).
 Moreover the memory consumption is very high (about 130 MB in one case and 
 350 MB in another)
 and it will be a serious problem when trying to depict more than one sets of 
 data 
 (in different child windows of the MDI application)
 
 Are there any guidelines for reducing the memory usage? 

You're not really telling us much about your data, like how many vertices, 
textures, etc.

Sharing image data might be a good candidate, but it you have millions of 
triangles then
that that gives you a minimum memory footprint.

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


Re: [osg-users] [build] Memory alloc fail on release OSG library

2012-10-15 Thread Ulrich Hertlein
Hi Dmitry,

On 12/10/12 2:56, Dmitry K. wrote:
 I have built OSG as dynamic library and when I attach the release version of 
 the
 library to my test project containing textures tutorial I receive bad alloc 
 mircosoft
 visual c++ exception. When I switch to debug version - everything works ok 
 but image
 doesn't loads with LoadImageFile (the function returns NULL).

You cannot mix debug and release libraries/builds in Visual Studio.
From your post it's not quite clear which versions you are building and 
linking but you
have to make sure that they're of the same type.

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


Re: [osg-users] Memory Clean Up Question

2012-10-15 Thread Ulrich Hertlein
Hi Karl,

On 16/10/12 2:53, Cary, Karl A. wrote:
 I am tracking down some memory leaks in our program and have come across a 
 couple
 situations where I am currently not sure if it is/can cause a memory leak. 
 There are many
 instances in our code where we do something similar:
 
 osg::ref_ptrosg::Geometry geo  = new osg::Geometry;
 geo-getOrCreateStateSet()-addUniform(new osg::Uniform(“blah”, someVal));
 geo-getOrCreateStateSet()-addUniform(new osg::Uniform(“blah2”, someVal2));
 
 What I am wondering is, will osg now clean up those 2 new uniforms? Or do I 
 need that be
 created externally as ref_ptrs so when my object deletes they will be 
 deleted? I
 personally want to change it to ref_ptrs, but given the number of places this 
 change needs
 to be made, I at least want to know if the work is truly needed or not.

Since you're not using them yourself you don't have to use ref_ptr in this case.
The new'd Uniforms are assigned to ref_ptr members of osg::StateSet and are 
cleaned up
when that object goes away (or rather, they are unref'd and deleted if no one 
else is
using them).

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


Re: [osg-users] Can I run OSG even on 128MB RAM grapics card

2012-09-24 Thread Ulrich Hertlein
Hi Koduri,

On 21/09/12 22:17, Koduri Lakshmi wrote:
 I did a sample program to render a model using OSG.
 
 I created a complex model from 3dsmax having  1lack of vertices.
 I exported it as OSG using OSGExporter. I used optimization techniques to 
 reduce size
 of the final osg file (don't know whether the vertexes are optimized or not ).
 
 It renders very well on the system having NVIDIA GeForce 8400GS with a RAM of 
 512 MB graphics card. 
 
 Now when I run this on a system having Intel graphics card with 128 MB RAM 
 then the
 performance is very poor. I did a small transformation from left to right. 
 The moving is
 sooo slow and getting
 Scaling Image from 640 by 480 to 512 by 512 on command prompt (for textures 
 of the model).

Scaling the textures will kill performance.

- if your hardware does not support non-power-of-two textures then rescale them 
offline.
- if you're running out of texture memory scale them down, e.g. 128x128 rather 
than 512x512.

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


Re: [osg-users] GPU stats on Mountain Lion (OS X 10.8)

2012-09-20 Thread Ulrich Hertlein
Hi Stephan,

On 19/09/12 2:23, Stephan Huber wrote:
 has anybody noticed issues with the GPU-stats on Mountain Lion (10.8.1)?
 When enabling them the rendering stops for several seconds from time to
 time. (Looks like a driver problem)

Yes, I also have the problem on 10.8.2.  Pauses every ~10s or so.
Cheers,
/ulrich

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


Re: [osg-users] How to get Sequence node to contorl animaton

2012-09-07 Thread Ulrich Hertlein
Hi Koduri,

On 6/09/12 23:58, Koduri Lakshmi wrote:
 Hi,
 
 I have an OSG file contains a sequence of objects. I read this OSG file and 
 assigned to a transformation matrix. 
 
 Now I want to get back the sequence to the OSG::Sequence object from the 
 transformation matrix to control animation.
 
 How can I get sequence and control the animaton?
 
 Can you please help me what to do?

I'm not quite sure what you're trying to do, but I can explain a bit what 
osg::Sequence
does.  osg::Sequence acts like a switch node, that automatically (based on 
simulation
time) enables its children in sequence.

So what you have to do is to create a Sequence node and add the children that 
you want to
switch between to it.

Maybe if you could post a code snippet it would help people (me included) to 
figure out
what you're trying to do.

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


[osg-users] RESOLVED Re: Repository broken with SVN =1.7.5?

2012-08-22 Thread Ulrich Hertlein
Hi guys,

On 19/08/12 12:12, Ulrich Hertlein wrote:
 That's very well possible, I haven't done a clean checkout for a long time.

The repository is back up and a fresh checkout does not have the svn:externals 
anymore.
Cheers,
/ulrich

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


Re: [osg-users] Repository broken with SVN =1.7.5?

2012-08-18 Thread Ulrich Hertlein
Hi Robert,

On 19/08/12 4:15, Robert Osfield wrote:
 directory.  My best guess is that Ulrich has done has done the test on
 a very old checkout of the OSG.

That's very well possible, I haven't done a clean checkout for a long time.

I tried to get a fresh copy just now but am getting errors, both for clean 
checkout and
update of my existing copy.  Can anyone confirm that?  Could it be related to 
the web
server problems on 'www.openscenegraph.org'?

$ svn checkout http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk 
OpenSceneGraph
svn: E175002: Unable to connect to a repository at URL
'http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk'
svn: E175002: OPTIONS of 
'http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk':
could not connect to server (http://www.openscenegraph.org)

$ cd _osg
$ svn update
Updating '.':
svn: E175002: Unable to connect to a repository at URL
'http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk'
svn: E175002: OPTIONS of 
'http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk':
could not connect to server (http://www.openscenegraph.org)

Cheers,
/ulrich

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


[osg-users] Repository broken with SVN =1.7.5?

2012-08-17 Thread Ulrich Hertlein
Hi guys,

ever since updating my Subversion client to 1.7.x I've been getting errors 
regarding
OpenThreads when updating:

$ svn up
Updating '.':
svn: warning: W20: Error handling externals definition for 
'include/OpenThreads':
svn: warning: W17: URL
'http://www.openscenegraph.org/svn/osg/OpenThreads/trunk/include/OpenThreads' 
at revision
13110 doesn't exist
svn: warning: W20: Error handling externals definition for 
'src/OpenThreads':
svn: warning: W17: URL
'http://www.openscenegraph.org/svn/osg/OpenThreads/trunk/src/OpenThreads' at 
revision
13110 doesn't exist
At revision 13110.
svn: E205011: Failure occurred processing one or more externals definitions

After doing a clean check-out I'm not getting src/OpenThreads and 
include/OpenThreads anymore.

src/OpenThreads and include/OpenThreads are pulled in via svn:externals 
references to the
OpenThreads repository:

$ cd OpenSceneGraph
$ svn propget svn:externals .
include/OpenThreads
http://www.openscenegraph.org/svn/osg/OpenThreads/trunk/include/OpenThreads
src/OpenThreads 
http://www.openscenegraph.org/svn/osg/OpenThreads/trunk/src/OpenThreads

Which would be fine, except that OpenThreads in turn has external references to
OpenSceneGraph!

$ cd OpenThreads
$ svn propget svn:externals .
include/OpenThreads
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/include/OpenThreads
src/OpenThreads 
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/OpenThreads

So we have a nice (or rather not so nice) circular reference and the newer SVN 
clients
apparently don't deal with this.

To solve this I suggest to remove the 'svn:external' on the OpenSceneGraph base 
directory.

Or am I the only one still using the SVN repository?
Should I turn off the lights and move on?

To my knowledge the hg and git repositories are not official and only mirror 
the SVN
repository?

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


Re: [osg-users] Store rgb data into rgba image

2012-07-09 Thread Ulrich Hertlein
On 8/07/12 3:16 , Jorge D'Alpuim wrote:
 int height = image_rgb-s();
 int width = image_rgb-t();
 int length = image_rgb-r();
 const long size = width * height * length * 4;
 
 unsigned char* rgb_data = image_rgb-data();
 unsigned char* rgba_data = (unsigned char*)calloc(size,sizeof(unsigned char));
 
 for(long i = 0; i  size; i+= 4)
 {
 rgba_data[i + 0] = rgb_data[i + 0]; //red
 rgba_data[i + 1] = rgb_data[i + 1]; //green
 rgba_data[i + 2] = rgb_data[i + 2]; //blue
 rgba_data[i + 3] = 255; //alpha
 }

For one, you're skipping over every 4th byte of input data (rgb_data).
Try something like:

const int numPixels = width * height * length;
for (int i = 0; i  numPixels; ++i)
{
  rgba_data[i * 4 + 0] = rgb_data[i * 3 + 0];
  rgba_data[i * 4 + 1] = rgb_data[i * 3 + 1];
  rgba_data[i * 4 + 2] = rgb_data[i * 3 + 2];
  rgba_data[i * 4 + 3] = 0xff;
}

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


Re: [osg-users] Problems with DotOsgWrapper in OSG 3.1.1 on OSX 10.7

2012-07-05 Thread Ulrich Hertlein
Hi guys,

On 5/07/12 17:38 , Stephan Huber wrote:
 Am 04.07.12 16:49, schrieb Mike Krus:
 Any ideas on how to fix this? Or anybody know if I can safely build the rest 
 with GCC 4.3 and OSG with the llvm-gcc 4.2 that comes with XCode?
 
 AFAIK you'll have to use the apple-compilers for compiling osg, as only
 the apple-compilers know how to handle Objective-C which is used for the
 cocoa backend.
 
 Don't know if you can mix both compilers, I had problems in the past
 compiling parts of osg with llvm-gcc and other parts of my code with clang.

I've switched to use clang/clang++ (3.1svn) to compile OSG and with MacPorts 
compiled with
Xcode-gcc without issues so far (but not a production environment).

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


Re: [osg-users] Screen not refreshing-overlapping content.

2012-07-05 Thread Ulrich Hertlein
Hi Praveena,

On 5/07/12 23:19 , Praveena Sara wrote:
 Code:
 osg::ref_ptrosg::Geometry beam = new osg::Geometry; 
 
 osg::ref_ptrosg::Vec3Array points = new osg::Vec3Array; 
 points-push_back(StartPoint); 
 points-push_back(EndPoint); 
 
 osg::ref_ptrosg::Vec4Array color = new osg::Vec4Array; 
 color-push_back(osg::Vec4(0.0f,1.0f,0.0f,1.0f)); 
 
 beam-setVertexArray(points.get()); 
 beam-setColorArray(color.get()); 
 beam-setColorBinding(osg::Geometry::BIND_PER_PRIMITIVE); 
 beam-addPrimitiveSet(new osg::DrawArrays(GL_LINES,0,2));
 
 osg::ref_ptrosg::Geode geode = new osg::Geode; 
 geode-addDrawable(beam.get() );
 
 
 osg::ref_ptrosg::LineWidth lineWidth = new osg::LineWidth;
 lineWidth-setWidth(5.0f);
 
 osg::StateSet* stateset = geode-getOrCreateStateSet();
 stateset-setAttribute(lineWidth.get());
 stateset-setMode(GL_LIGHTING, osg::StateAttribute::OFF);
 
 pat-addChild(geode); //osg::PositionAttitudeTransform 
 
 
 
 The lines are drawn precisely but the screen is not refreshed, thus it keeps 
 all the
 previously drawn lines. (Screenshot attached)

It's not really possible to tell what might be going wrong based on the code 
fragment
you've provided.  Is this setup code?  Called every time for a new line?

You're apparently creating a new osg::Geode with a new osg::Drawable every time 
and adding
the geode to an existing osg::PositionAttitudeTransform, without removing 
previous
objects.  I guess the PAT is just gathering a new Geode every time.

If you only need a single line it's better to just create a single Geode and 
modify the
coordinates on its Geometry/VertexArray.

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


Re: [osg-users] How to create osg::Texture2D from osg::Vec3Array...?

2012-06-30 Thread Ulrich Hertlein
Hi Kedar,

On 28/06/12 19:10 , Kedar Kumbhar wrote:
 The normal method given in many examples to create a Texture2D, is using a 
 Image file.
 
 Code:
 osg::ref_ptrosg::Texture2D texture = new osg::Texture2D;
   osg::ref_ptrosg::Image image = osgDB::readImageFile(Images/lz.rgb );
   texture-setImage( image.get() );
 
 Instead, I have a osg::Vect4Array in which I have color information (rgba).
 
 How can I use this Vec4Array to create Texture2D?

Vec4Array is-a std::vector and contains a contiguous block of its base type, 
such as
float.  I haven't tested this, but you should be able to just call:

osg::Image::setImage(
width, height, 1,
GL_RGBA8,
GL_RGBA, GL_FLOAT,
(unsigned char*) vec4Array[0], NO_DELETE);

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


Re: [osg-users] Compiling OSG applications on Ubuntu 12.04 = OK

2012-06-26 Thread Ulrich Hertlein
Hi Mike,

On 27/06/12 3:28 , Mike Hatcher wrote:
 There are two different stages of compilation: 1: A rendering library of 
 individual
 .cpp files is compiled into .o files and ultimately archived into a 
 libSimRender.a file
 using the ar command to build an archive of the .o files.  This one is the 
 one that
 includes DOFTransform.
 
 2: Then later a visuals subsystem is compiled with it's respective .o files.  
 Then
 these are all linked together with the .a (-lSimRenderer in my above posting) 
 and then
 built into a .so share object using the above compilation/linking command.
 
 I've run strings against the .a file and the symbols are in there but 
 probably not
 their definition, just the reference.  Why I'm not understanding is why the 
 linking
 command for the Visuals.so shared library above are ignore many of the -losg* 
 objects
 I've instructed it to link against.

What you could try is to place the '-losgSim' after the '-lSimRenderer' part.  
I've had
cases where the link would be ignored when it wasn't actually used by any of 
the linked .o
files.

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


Re: [osg-users] Enabling notifications from within program?

2012-05-31 Thread Ulrich Hertlein
Hi Preet,

On 1/06/12 4:25 , Preet wrote:
 That's what I'm currently doing (ie using stack traces to try and
 figure stuff out), but I was wondering why osg doesn't give me *any*
 output at all. For instance, I'm apparently able to do a bunch of
 stuff: Load an *.osg model, setup an animation path, create nodes,
 etc, pretty much all of the scene setup goes fine up until I try to
 create the viewer. Doesn't doing any of those things before the viewer
 provide output when I've set the notify level to debug? I made sure I
 compiled with OSG_DISABLE_NOTIFY (or whatever the exact wording for
 that flag was) to allow notifications.

Loading a file will certainly produce output with the proper OSG_LOG_LEVEL.
I'm wondering if whatever subsystem is redirecting output to a log file in your
application is maybe run after OSG sets up its logging and so they're going to 
different
file descriptors?

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


Re: [osg-users] Why no games with OSG?

2012-05-23 Thread Ulrich Hertlein
Hi Michael,

On 24/05/12 12:45 , michael kapelko wrote:
 I was thinking about iOS recently and decided to ask you, if you coded
 those apps in C++ or Obj-C? I heard you need to write Obj-C on iOS?

You can mix C, C++ and ObjC on iOS.  So the meat of your app could be in C++ 
talking to
OSG and the UIKit stuff can be in ObjC.

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


Re: [osg-users] Problem with semi-transparent textures

2012-05-14 Thread Ulrich Hertlein
On 5/05/12 22:30 , Martin Oswald wrote:
   texture2D = dynamic_castosg::Texture2D*(attr);
 ...
 texture2D-setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT);

Typo?  2D textures only require WRAP_S and WRAP_T.

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


Re: [osg-users] bug with osg::Matrix2 in head rev

2012-04-26 Thread Ulrich Hertlein
Hi Sergey,

On 26/04/12 23:39 , Sergey Polischuk wrote:
 Replying to myself :)
 
 Problem is: declaration of set(...) methods in derived Matrix*Template 
 classes hides base class MatrixTemplate::set(...) pack of methods
 This can be solved by adding line:
 using MatrixTemplate[template params]::set;
 
 in each derived class declaration.
 
 May be someone have better solution?

There recently was a similar case with the Vector* implementations that could 
be solved by
using the 'base_class' typedef in each class.

So rather than:

Matrix2Template( const Matrix2Template mat ) { set(mat.ptr()); }

it would be:

Matrix2Template( const Matrix2Template mat ) { base_class::set(mat.ptr()); }

Could you try that and submit a patch if it works?

On a related note, it feels weird to have all this Matrix/Vector related stuff 
in the
'Uniform' header file, as it can create much confusion with what's already in 
the 'Matrix'
and 'Vector' header files.

If this is truly Uniform only would it make sense to scope it to 'osg::Uniform' 
or put it
into separate header files like 'UniformMatrix' and 'UniformVector'?

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


Re: [osg-users] osx fail to configure

2012-04-11 Thread Ulrich Hertlein
On 12/04/12 0:53 , Cedric Pinson wrote:
 Thx for the hints, I modified the CMakeCache.txt file to point on the new 
 location of Xcode

For me, running xcode-select /Applications/Xcode.app/Contents/Developer did 
the trick.
(Maybe together with cmake patches brought in through MacPorts, not sure.)

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


Re: [osg-users] Drawing a simple sphere...

2012-04-09 Thread Ulrich Hertlein
Hi Mike,

On 10/04/12 13:03 , Mike Wozniewski wrote:
 Hi Ulrich (et al),
 
 How did you change the optimization flags in your makefiles? Did you search 
 and replace
 through them all? or is there a cmake variable / technique for doing this?

These days (the original thread is from August 2011) the only things I have to 
modify in
the cmake settings (through ccmake) is the architecture (to x86_64 only, 
because of
dependencies) and the location of the freetype library (from MacPorts).

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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-05 Thread Ulrich Hertlein
Hi David,

On 5/04/12 18:18 , David Callu wrote:
 Thanks for the fix,
 Can you post it on osg-submission list ?

Sure, I can do that, but maybe somebody who can actually reproduce the problem 
is more suited?

Otherwise I would just submit this:

 code
 if (!atomicCounterMap.empty()  
 _extensions-isShaderAtomicCounterSupported()) {
std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
std::vectorGLuint uniformIndex;
 /code

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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Ulrich Hertlein
Hi guys,

On 5/04/12 6:05 , Martin Naylor wrote:
 I see no Nvdia dll in the call stack, not sure if I should, so am thinking
 an OSG problem(please take with a pinch of salt).

Without having encountered that crash this to me would indicate that the crash 
is
happening in GL code (such as glGetActiveUniforms) rather than the surrounding 
setup.

 So I have had a go at debugging, its beyond me but a couple of questions to
 help me in my pursuit.
 The call before the crash in the vector stl lib is:
 
 if (_extensions-isShaderAtomicCounterSupported())
 {
 std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
 std::vectorGLuint uniformIndex;
 for (AtomicCounterMap::iterator it = atomicCounterMap.begin(), end =
 atomicCounterMap.end();
  it != end; ++it)
 {
 uniformIndex.push_back(it-first);
 }
 
 _extensions-glGetActiveUniformsiv( _glProgramHandle,
 uniformIndex.size(),
 (uniformIndex[0]),
 GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX,
 (bufferIndex[0]) );
 
 
 The above is doing a for loop and pushing the first item back, whilst
 debugging the 'end' has a bad_ptr, is this correct?
 Also why ++it and not it++ ?

Can you verify that 'uniformIndex' and 'bufferIndex' are *ALWAYS* non-empty?  
Otherwise
the 'uniformIndex[0]' will definitively cause a crash.

If that cannot be assured then we need a bit of

if (!uniformIndex.empty()  !bufferIndex.empty())
{
   // glGetActiveUniform()
}

Not sure why 'end' is bad, that certainly shouldn't be the case unless the
atomicCounterMap is not properly set up.

'++it' is a sort of code optimization hint to the compiler and may-or-may-not 
produce
faster code; the end result is the same.

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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-04 Thread Ulrich Hertlein
Hi guys,

On 5/04/12 6:05 , Martin Naylor wrote:
 if (_extensions-isShaderAtomicCounterSupported())
 {
 std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
 std::vectorGLuint uniformIndex;
 for (AtomicCounterMap::iterator it = atomicCounterMap.begin(), end =
 atomicCounterMap.end();
  it != end; ++it)
 {
 uniformIndex.push_back(it-first);
 }

Coming to think of it, I believe the whole block should check if 
atomicCounterMap is not
empty.  It does not need to be called if GL_UNSIGNED_INT_ATOMIC_COUNTER is 
supported but
not used.

code
if (_extensions-isShaderAtomicCounterSupported()  !atomicCounterMap.empty())
{
std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
std::vectorGLuint uniformIndex;
/code

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


Re: [osg-users] OpenThreads/Atomic currently broken with Xcode 4.3.1 and IOS

2012-03-22 Thread Ulrich Hertlein
Hi Stephan,

On 22/03/12 22:29 , Stephan Maximilian Huber wrote:
 Am 22.03.12 03:01, schrieb Ulrich Hertlein:
 This recently broke for me on OS X (with clang 3.1) as well.  Casting 
 'ptrOld' to (void*)
 works and this is also done for the other implementations (WIN32_INTERLOCKED 
 and
 BSD_ATOMIC) as well.

 No ideal, both 'ptrOld' and 'ptrNew' are only read and could actually both 
 be const but
 aren't for some reason.
 
 thanks for the feedback, there's even a simpler solution: use the
 BSD_ATOMIC implementation for IOS and OS X.

Simpler maybe, but I would expect that to be more expensive in CPU terms than a 
CPU
opcode.  Not?

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


Re: [osg-users] OpenThreads/Atomic currently broken with Xcode 4.3.1 and IOS

2012-03-21 Thread Ulrich Hertlein
Hi Stephan,

On 13/03/12 4:43 , Stephan Maximilian Huber wrote:
 it seems that compiling osg and specifically OpenThreads is currently
 broken for IOS when using xcode 4.3.1. The compilation fails at
 OpenThreads/Atomic with
 
 Users/stephan/Documents/Projekte/cefix/cefix/ios/../../libs/ios/include/OpenThreads/Atomic:244:48:
 error: cannot initialize a parameter of type 'void *' with an lvalue of
 type 'const void *const'
 return __sync_bool_compare_and_swap(_ptr, ptrOld, ptrNew);
 
 Googling around it seems, that this is because of a bug in the
 clang-compiler: http://llvm.org/bugs/show_bug.cgi?id=11280
 
 Has anybody an idea how to fix the issue? In the meantime i'll switch to
 _OPENTHREADS_ATOMIC_USE_MUTEX

This recently broke for me on OS X (with clang 3.1) as well.  Casting 'ptrOld' 
to (void*)
works and this is also done for the other implementations (WIN32_INTERLOCKED and
BSD_ATOMIC) as well.

No ideal, both 'ptrOld' and 'ptrNew' are only read and could actually both be 
const but
aren't for some reason.

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


Re: [osg-users] Maintaining a reference to an osg node outside of osg

2012-03-17 Thread Ulrich Hertlein
Hi Preet,

On 17/03/12 8:09 , Preet wrote:
 If I do this, then I need to maintain the underlying ref_ptr object
 no? This isn't particularly convenient. What was wrong with assigning
 the osg::Node's pointer to mysteryPtr instead? Basically with ...
 
 osg::ref_ptrosg::Node someNode;
 mysteryPtr = someNode.Get();
 
 As long as the pointer returned by the Get() method is valid for the
 lifetime of the object I'm safe right? Then if I want to do anything
 with object:
 
 osg::ref_ptrosg::Node someNode = some_cast_callosg::Node*(mysteryPtr);
 someNode-partyAllDay();

That's not going to work terribly well, the Get() method simply cannot make 
guarantees
that the pointer is valid.  You *MUST* keep a osg::ref_ptr around to keep the 
object
alive, otherwise you'll end up with a stale pointer to a deleted object at some 
point.  So
you might as well do that inside your struct.

Without knowing your plans in detail I'd think about using a virtual base class 
as an
interface (call it IMysteryStruct) that has a public method to return a void* 
if you need
it (although I don't see a use for that).  This is the class that you'd pass 
around
internally.

Then you can make derived classes, such as OsgMysteryStruct (which has an 
internal
osg::ref_ptr to the object in question) or a SharedMysteryStruct (which has an 
internal
shared_ptr to some object).

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


Re: [osg-users] [forum] using a TV remote control

2012-03-13 Thread Ulrich Hertlein
Hi Helen,

On 13/03/12 22:35 , Helen Diez wrote:
 I'm using Microsoft Windows 7.
 I still haven't found a solution to me problem. Any help will be really 
 apreciated

You wrote 'When I press red button on my remote, letter a is written...'.  
Writte where?

How do you interface with the remote control stuff?  Is it through an SDK?  A 
separate
applications that fakes key presses?

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


Re: [osg-users] [forum] using a TV remote control

2012-03-12 Thread Ulrich Hertlein
Hi Helen,

On 9/03/12 3:10 , Helen Diez wrote:
 I'm trying to implement an OSG application using a TV remote control. At the 
 beggining
 I had my code prepared to detect keyboard events as follows:
... 
 Everything worked fine. The thing is the application's final device will be a 
 TV. So I
 need to make the application work, not with keyboard events, but with the 
 remote
 control buttons.
 
 I'm using a IR receiver, everything seems to be well configured. When I press 
 red
 button on my remote, letter a is written, however my app. doesn´t seem to 
 detect it.

What platform are you on?

One issue I've come across on Unix / X11 with having another application send 
keystrokes
was that the target application might not have focus and the key would instead 
go to e.g.
the terminal.

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


Re: [osg-users] DataBasePager expired removal question

2012-03-05 Thread Ulrich Hertlein
Hi Sebastian,

On 5/03/12 20:01 , Sebastian Messerschmidt wrote:
 Now, in order to cache the nodes correctly I've put a reference to the node 
 in to a map
 (std::mapstd::string, osg::ref_ptrNode). I need to use the ref_ptr to be 
 sure the node
 is still valid.
 It works well, up to the point where the DataBasePager removes expired 
 PagedLODs, as I
 don't found any way to set a callback to the DataBasePager that tells me, 
 which node is
 going to be removed.

If you only need to detect that nodes have been expired by the DatabasePager 
(and not
necessarily the exact moment) you could use an observer_ptr in your map rather 
than a ref_ptr.

But you would need to 'lock()' every access and run a map cleanup periodically 
to remove
stale nodes.  Still, depending on your needs it might be cleaner than to 
subclass DBP.

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


Re: [osg-users] DataBasePager expired removal question

2012-03-05 Thread Ulrich Hertlein
I need a coffee, you've already figured that out. Sorry for the noise :-}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Point attribute affecting display of triangle on OS X

2012-03-01 Thread Ulrich Hertlein
Hi Andy,

On 1/03/12 1:27 , Andy Skinner wrote:
 Attached is a simple OSG example that, on Mac with nVidia card, seems to show 
 point
 geometry with the Point StateAttribute set causing other geometry to be 
 clipped.  We did
 not see this on a Mac with an ATI card.  This has been reproduced on the OSG 
 trunk, but
 has been seen on older versions as well.

 The example has a ClipNode, and a Geode with a Point, Line, and Triangle.  
 When we set
 the Point attribute on the StateSet, the Triangle and Line don’t appear.  
 When we skip
 setting the Point attribute, all three Geometry drawables appear.

when I run your example without arguments I see a green line and a red triangle.
When running with an argument I see the green line, a red trinangle, and six 
green discs
that are partially occluded by the red triangle.  The degree of occlusion 
varies when the
scene is rotated.  As I understand your description this is different to your 
results.

This is on a MacBookPro3,1 with NVIDIA GeForce 8600M running Lion 10.7.3 and 
OSG trunk.

 Also, if it turns out to be an issue we would report to nVidia, could we 
 report it with
 an OSG example?  In other words, does nVidia have the ability to build OSG 
 examples,
 and have you reported problems to them with OSG to demonstrate?

I believe you'll have to report this to Apple, since they do their own drivers 
(with input
from nvidia of course, but still).

Hope this helps; let me know if you need anything else.
Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] live video texture performance

2012-03-01 Thread Ulrich Hertlein
Hi Michael,

On 2/03/12 3:41 , Michael Schanne wrote:
 I am trying to create a scene which contains a texture displaying a live 
 video image.
 The image is sent as a buffer of raw data from an attached camera. I was able 
 to get
 something working but the performance is terrible: about 1.42 frames per 
 second. I need to
 get to at least 20 fps. I am dealing with an image that is 640x480 pixels 
 with 32 bits per
 pixel. I have stripped down my scene to contain only a geode with a quad 
 geometry, and an
 attached texture, and I still see the performance problem. The texture has an 
 attached
 StateAttributeCallback, in which I fetch the buffer of data for the next 
 video frame, and
 then call setImage:

Make sure that the image is not scaled to a power-of-two, by setting the 
appropriate hint.
 This can absolutely kill texture upload performance.

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


Re: [osg-users] osg, macosx-x86_64 imageio plugin color byte swap problem

2012-02-22 Thread Ulrich Hertlein
Hi Chris,

On 22/02/12 20:29 , Stephan Maximilian Huber wrote:
 I tested the imageio-plugin on os x 10.7 with an older 32bit build (from
 Nov 2011) and it works for me. I tested only png and jpg files.

I've also tested imageio on 10.7 with a current 64-bit build (trunk) and it 
works okay
(png, jpg, gif).

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


Re: [osg-users] [osgPlugins] Problem in loading Shape file

2012-02-22 Thread Ulrich Hertlein
Hi Lalit,

On 24/12/11 0:32 , Lalit Manchwari wrote:
 I followed your instruction and now program is not crashing. But in some file 
 it does
 not load the complete shape file. I have attached here a shape file and its 
 snapshot
 (with complete view).
 
 Please could you help.

When opening the 'polygon.shp' file I'm getting the following from osgviewer:

ESRIShape loader : .dbf file containe different record number that .shp file.
   .dbf record skipped.

This appears to indicate a problem with the .shp loader, but I don't know 
enough about
shape files to make any further comment, sorry.

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


Re: [osg-users] Segmentation fault when I try to assign MatrixD

2012-02-15 Thread Ulrich Hertlein
Hi guys,

On 15/02/12 23:52 , Philipp Moeller wrote:
 I have a class (Car) which extends|osg::PositionAttitudeTransform|.
 Now I want to create camera which has the same position. So I get
 car's matrix in Camera's getMatrix() method:

 |matrix=  car-asMatrixTransform()-getMatrix(); // osg::Matrixd* matrix|
...
 
 Does asMatrixTransform return a non-NULL pointer?
 PositionAttidudeTransform does not inherit from MatrixTransform so that
 should not work.

Also, you may want to use 'osg::Matrix' rather than the explicit 'osg::Matrixd' 
just in
case OSG is not compiled using doubles.

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


Re: [osg-users] OSG runtime error on Visual Studio Debug mode

2012-02-15 Thread Ulrich Hertlein
Hi Clement,

On 16/02/12 13:59 , clement@csiro.au wrote:
 I am using osg version 3.0.1 with MS Visual Studio 2008.  My application is 
 embedded
 osg viewer to display sample, so it is not necessary to build my application 
 with using
 debug version of osg.  The application build settings is using all non-debug 
 osg
 libraries even on Debug or Release configuration .  I can successfully 
 build the
 application without any error.  If I am using Release configuration to 
 build, then
 run the application and there is no any error showed.  While I am using 
 Debug
 configuration to build, I got unhandled exception error on runtime.  Anyone 
 knows how I
 can avoid this error. Seems Debug configuration settings must be used osg 
 debug
 libraries, but I am not debug the osg.

Even when you don't debug OSG itself you have to use Debug libraries when 
building a Debug
version of your own application.

C++ objects in Visual Studio can vary in size in Debug and Release (e.g. 
because of
additional properties for bounds checking).  So a Debug std::string might be 
bigger than
the Release version.

When your application includes OSG headers the OSG objects can have different 
sizes
depending on the build type and the library that is linked HAS to match that.

There's no way around (it that I'm aware of).

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


Re: [osg-users] Win32 Bitmap to osg Image

2012-02-02 Thread Ulrich Hertlein
Hi Vincent,

what errors/issues/non-results are you seeing?  Black?  Reversed colors?  
Crashes?

On 2/02/12 21:52 , Vincent Bourdier wrote:
 I'm currently trying to convert a bitmap image file to an osg::Image.
 I get my Bitmap from the win32 api making a screenshot, but as specified in 
 the plugin bmp
 the internal format of the Bitmap is not RGB but BGR.
 
 Is there any way to directly use the BGR data buffer in a new osg::Image or 
 do I need to
 swap from BGR to RGB ?
 I use this :
 /_texGrad-allocateImage(width, height, 1, GL_RGB, GL_UNSIGNED_BYTE);
 _texGrad-setImage(width, height, 1, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, 
 data,
 osg::Image::USE_NEW_DELETE); /
 
 I tried to change the GL_RGB into GL_BGR without results...
 
 Any suggestion will be very useful.

(As I understand it you want to use the Bitmap directly as an image (not save 
it and read
it back) so I'm not sure where the plugin fits into the picture.)

First of all you don't need to do 'allocateImage' *AND* 'setImage'.  
'allocateImage'
allocates memory internally to osg::Image that can then be filled but I assume 
you already
have a buffer that it should use, so 'setImage' would be enough.

osg::Image::setImage is designed to allow the user to specify a buffer that 
osg::Image
then uses (and manages, depending on the AllocationMode).  When you're passing 
a buffer
allocated by somebody else you may want to use AllocationMode::NO_DELETE, so 
that
osg::Image does not delete/free it.

Regarding the RGB vs BGR you only want to change the 'pixelFormat' parameter, 
not the
'internalTextureFormat'.

I would naively expect that either
_image-setImage(width, height, 1, GL_RGB,
GL_RGB, GL_UNSIGNED_BYTE, data, osg::Image::NO_DELETE);
or
_image-setImage(width, height, 1, GL_RGB,
GL_BGR, GL_UNSIGNED_BYTE, data, osg::Image::NO_DELETE);
would do the trick.

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


Re: [osg-users] KeyboardHandler - Moving an Object Forward

2012-01-24 Thread Ulrich Hertlein
Hi Pedro,

On 24/01/12 12:36 , Pedro Ribeiro wrote:
 Hi everyone, i'm newbie in osg, trying to learn from the osg tutorials. Now 
 i'm trying
 to implement tutorial 9.1 (Basic Keyboard Input) that allow the tank to move 
 forward,
 started with Tutorial 9 from NPS that allow a tank to rotate his gun.
 
 I tried to follow the tutorial step by step,i t seems that i'm close but i'm 
 getting 2 erros when compiling:
 
 1.\testKeyboard.cpp(35) : error C2061: syntax error : identifier 
 'tankInputDeviceStateType'
 1.\testKeyboard.cpp(35) : fatal error C1903: unable to recover from previous 
 error(s); stopping compilation
 
 refering to tankInputDeviceStateType that is present in 
 myKeyboardEventHandler class:
 
 Code:
 
 class myKeyboardEventHandler : public osgGA::GUIEventHandler
   {
   public:
   myKeyboardEventHandler(tankInputDeviceStateType* tids)
   {
   tankInputDeviceState = tids;
   }

That is really a question specific to that tutorial and not related to OSG, so 
it's not
terribly likely that we can help you with that.

I'd guess that maybe you're missing an #include for a definition of the
'tankInputDeviceStateType' type.

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


Re: [osg-users] [osgPlugins] Problem in loading Shape file

2011-12-22 Thread Ulrich Hertlein
Hi Lalit,

On 22/12/11 21:46 , Lalit Manchwari wrote:
 I am loading *.shp file in my program. In some files program works fine 
 (mostly shape
 file with lines) but in some other files program crashed.
 My code is :
 
 osg::Geode* geode = dynamic_cast  osg::Geode*  
 (osgDB::readNodeFile(Test.shp));

You're making the assumption that the returned node always is a Geode.

This may not always be the case, e.g. because the loader decided to place a
MatrixTransform or a Group at the root of the loaded graph.  In these cases the
dynamic_cast will return a NULL pointer which would explain the crash.

Just use a osg::Node* and remove the dynamic_cast and you should be fine.

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


Re: [osg-users] Lighting problem

2011-11-15 Thread Ulrich Hertlein
Hi Hartmut,

On 16/11/11 0:58 , Hartmut Leister wrote:
 I'm having a lighting problem in my osgviewerQt (derived from [1]) 
 application with a self created drawable object.
 All my spheres are basically looking like this [2], with this weird spot on 
 top of all spheres.
 
 Has anybody an idea, 
 a) what could be causing this or (more important)
 b) how to stop it?
 
 Has anyone stumbled upon this himself before?

I'm not quite sure what 'weird spot' you're talking about?  The highlight?  The 
black
sphere behind the green one (that looks like another geometry to me)?

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


Re: [osg-users] Switch node, and multiple views

2011-09-26 Thread Ulrich Hertlein
Hi Lars,

On 26/09/11 11:30 , Lars Karlsson wrote:
 Yes, I'd like to render one single scenegraph, however four times DIFFERENTLY 
 (i.e. in
 four different views), and of course simultaneously.
 ...
 I looked quickly into TraversalMask... Is my hunch correct when I say that:
 - I make all four subgraphs (under Switch) active 
 
 - I set their masks to 1, 2, 4, and 8 respectively
 
 - I take cameras of each of the four views in CompositeViewer, and set their 
 masks to 1, 2, 4 and 8 respectively
 
 - now the CULL traversals for all four views will cull respective subgraphs:
 
 - CULL for view 1 culls subgraphs 2, 3, and 4
 - CULL for view 2 culls subgraphs 1, 3, and 4
 - CULL for view 3 culls subgraphs 1, 2, and 4
 - CULL for view 4 culls subgraphs 1, 2, and 3
 
 Am I on the right track? Thanks!

Yes, except instead of a Switch you would probably just use a Group for this, 
unless you
want to disable/switch the subgraphs as well.

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


Re: [osg-users] Attach camera manipulator to RTT camera instead of viewer?

2011-09-24 Thread Ulrich Hertlein
Hi J-S,

On 23/09/11 19:40 , Jean-Sébastien Guay wrote:
 You don't attach a camera manipulator to a camera, but to an osgViewer::View. 
 So the trick
 is to tell the right camera to respond to user input, and the other(s) not to.
 
   camera-setAllowEventFocus(true or false);
 
 This may only work with slave cameras, perhaps not with in-scene-graph RTT 
 cameras, I
 don't know. I've used it with slave cameras, where the RTT camera would 
 respond to input,
 and the final draw camera (which draws a quad with the texture and shaders) 
 would not.

Thanks for the hint.  I did discover the 'setAllowEventFocus' but that didn't 
quite do it
with the in-scene camera.

I'll try with a slave camera instead.

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


Re: [osg-users] Please remove me from list

2011-09-23 Thread Ulrich Hertlein
You can do that yourself, using the mailing list link below.
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Attach camera manipulator to RTT camera instead of viewer?

2011-09-23 Thread Ulrich Hertlein
Hi guys,

I'm trying to find a way to attach a camera manipulator (Trackball) to my RTT 
camera
rather than the main viewer.  So far I couldn't find anything similar in the 
examples.

This must be a frequent scenario so obviously I'm missing something.  Can this 
be achieved
without writing a custom handler and if so, how?

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


Re: [osg-users] Release builds with gcc-llvm on Mac (Xcode 4), cosf/sinf recursion

2011-09-22 Thread Ulrich Hertlein
Hi James, hi all,

I've re-encountered this problem (after I had assumed it doesn't happen with 
clang/llvm)
in a project that's using particles.  The culprit here was sqrt/sqrtf.

I would like to propose that we remove these wrappers for OS X = 10.7:

Index: include/osg/Math
===
--- include/osg/Math(revision 12822)
+++ include/osg/Math(working copy)
@@ -38,14 +38,17 @@
 #define APPLE_PRE_10_2
 #endif
 #endif
+#if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MIN_REQUIRED 
MAC_OS_X_VERSION_10_7)
+#define APPLE_PRE_10_7
 #endif
+#endif

 #if defined(_MSC_VER)
 #include float.h
 #endif

 #if defined (sun) || \
-defined (__APPLE__) || \
+defined (APPLE_PRE_10_7) || \
 (defined (_AIX)  defined (__GNUC__))

 #include float.h

Cheers,
/ulrich

On 15/09/11 0:47 , James Turner wrote:
 I've encountered a problem with the osg/Math header, which a few previous 
 emails on
 this list have alluded to (based on searching the recent archives), but which 
 has an
 interesting explanation.
 
 osg/Math defines the 'f' versions of cos/sin/floor/etc in terms of the double 
 versions,
 on various platforms, including Mac. The implementation is an inline 
 function, which
 casts the input argument, and calls the 'base' version from math.h
 
 Unfortunately, LLVM (or the GCC frontend) is smart enough to turn the cast + 
 call of
 the base version back into the floating point version - but the symbol 
 look-up then
 resolves to the osg wrapper - and hence the problem we're seeing. Since 
 osg/Math was
 created, OS-X does define the 'f' versions - but I'm not sure which version 
 started
 doing so - the 10.6 SDK math.h includes the 'f' variants, but plain gcc 4.2 
 wasn't
 smart enough to turn the cast-to-double + call pattern into the float version.
 
 The local workaround is simply to remove the __APPLE__ case around line 48 of 
 osg/Math,
 but really it would be changed to a MAC_OS_X_VERSION_10_z, if someone can 
 identify what
 value 'z' should have. If anyone still has a 10.5 SDK, they could check
 '/usr/include/architecture/i386/math.h' and see if the 'f' variants of the 
 math
 functions are present.
 
 (What's the minimum version OSG claims to support at this time? 10.5 or still 
 holding
 out with 10.4?) (Potentially this affects iOS too, though I'm not sure if 
 Apple have
 enabled gcc-llvm for ARM yet, by de default)
 
 James


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


Re: [osg-users] Deriving my own Effect/Technique class - heap damage error

2011-09-19 Thread Ulrich Hertlein
Hi Matthias,

On 19/09/11 17:08 , matthias-schue...@web.de wrote:
 My goal is to use the osgFX node kit to write a customized Effect. Therefore, 
 I looked
 into the predefined osgFX::Cartoon Effect, copied it into my project, renamed 
 it into
 MyCartoon and tried to adapt the code to my needs. In order to debug a 
 program crash, I
 reduced the original osgFX::Cartoon Effect code to the following core:
... 
 When my application executes and the render process starts, the program 
 crashes with a
 heap damage error, when it returns from 
 osg::Technique::validate(osg::State). Therein,
 a local String_list is used to hold and traverse the extension strings and it 
 is
 attempted to be destroyed at the end of the function block. The last entries 
 in my call
 stack are in the std::basic_string template class and refer to the 
 destruction of the
 extension string GL_ARB_vertex_program.
 
 If I don't push entries in my getRequiredExtensions() method, the program 
 continues
 without a crash. I also overwrote osg::Technique::validate() in my 
 DefaultTechnique and
 used *exactly* the code from the base class and it worked fine. But if I call 
 the base
 class method directly, it crashes again, when destroying the first extension 
 string in
 the list. I can't figure out, why the strings are freed improperly and why 
 there is
 such a different behaviour, when I overwrite osg::Technique::validate().

you mentioned that you're debugging an other problem.  Is it possible that 
you're mixing
debug and release binaries?  E.g. debug build of your project with OSG release 
libraries?

Just because crashes when modifying STL containers raises a red flag...

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


Re: [osg-users] Release builds with gcc-llvm on Mac (Xcode 4), cosf/sinf recursion

2011-09-16 Thread Ulrich Hertlein
Hi James,

thanks for that impressive bit of detective work; I recently ran into that 
problem again
but didn't have the nerve/time to look into it more closely.

FWIW I've switched to clang/llvm on OS X and that works too (and supposedly 
produces
better code), so it seems to be the gcc-llvm frontend that's at fault.

Cheers,
/ulrich

On 15/09/11 0:47 , James Turner wrote:
 I've encountered a problem with the osg/Math header, which a few previous 
 emails on
 this list have alluded to (based on searching the recent archives), but which 
 has an
 interesting explanation.
 
 osg/Math defines the 'f' versions of cos/sin/floor/etc in terms of the double 
 versions,
 on various platforms, including Mac. The implementation is an inline 
 function, which
 casts the input argument, and calls the 'base' version from math.h
 
 Unfortunately, LLVM (or the GCC frontend) is smart enough to turn the cast + 
 call of
 the base version back into the floating point version - but the symbol 
 look-up then
 resolves to the osg wrapper - and hence the problem we're seeing. Since 
 osg/Math was
 created, OS-X does define the 'f' versions - but I'm not sure which version 
 started
 doing so - the 10.6 SDK math.h includes the 'f' variants, but plain gcc 4.2 
 wasn't
 smart enough to turn the cast-to-double + call pattern into the float version.
 
 The local workaround is simply to remove the __APPLE__ case around line 48 of 
 osg/Math,
 but really it would be changed to a MAC_OS_X_VERSION_10_z, if someone can 
 identify what
 value 'z' should have. If anyone still has a 10.5 SDK, they could check
 '/usr/include/architecture/i386/math.h' and see if the 'f' variants of the 
 math
 functions are present.
 
 (What's the minimum version OSG claims to support at this time? 10.5 or still 
 holding
 out with 10.4?) (Potentially this affects iOS too, though I'm not sure if 
 Apple have
 enabled gcc-llvm for ARM yet, by de default)
 
 James
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


  1   2   3   4   5   6   >