Re: [osg-users] Invalid GL buffer object

2013-10-18 Thread Sajjadul Islam
Thanks Robert,

I am not calling glGenBuffers() in my code. I am calling the following :


Code:

osg::GLBufferObject *glBO = 
vbo-getOrCreateGLBufferObject(osgCompute::GLMemory::getContext()-getState()-getContextID());




Since i am getting undefined behavior, i used the debugger to get inside the 
above statement and found that  i am having the issue inside the GLBufferObject 
constructor.


Code:

GLBufferObject::GLBufferObject(unsigned int contextID, BufferObject* 
bufferObject, unsigned int glObjectID):
_contextID(contextID),
_glObjectID(glObjectID),
_profile(0,0,0),
_allocatedSize(0),
_dirty(true),
_bufferObject(0),
_set(0),
_previous(0),
_next(0),
_frameLastUsed(0),
_extensions(0)
{
assign(bufferObject);

_extensions = GLBufferObject::getExtensions(contextID, true);

if (glObjectID==0)
{
_extensions-glGenBuffers(1, _glObjectID);
}

// OSG_NOTICEConstucting BufferObject thisstd::endl;
}




The immediate above snippet is from the BufferObject file that came along with 
the API.

And i found that _glObjectID is carrying the value 0 even after call:


Code:

_extensions-glGenBuffers(1, _glObjectID);




I believe that 0 is not a valid value here. 

Any more thoughts ?

Regards,
Sajjadul

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





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


Re: [osg-users] Track map on a 3D view

2013-10-18 Thread Gianni Ambrosio
Thanks Robert. How could I overlap the two views? Looking at osgcompositeviewer 
example it seems they can overlay but one rectangle hides others while I need 
the 2D teack background to be transparent.

Regards
Gianni

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





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


Re: [osg-users] Multiple light fix in the FBX importer:

2013-10-18 Thread Robert Osfield
Thanks Konstantin, changes merged and submitted to svn/trunk.


On 3 October 2013 08:28, Konstantin lalakos...@gmail.com wrote:

 Hi Robert!

 My full name is:
 Konstantin S. Matveyev

 Content of submission can be:
 [*] Multiple light fix in FBX-importer

 etc)

 Next time i can send patches (or full files) to 
 *osg-submissions***http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
 .


 Thanks!





 2013/10/2 Robert Osfield robert.osfi...@gmail.com

 Hi Konstantin,

 Thanks for the modified file, changes make sense now that I can
 graphically diff your changes against svn/trunk.  I'm ready to merge
 but don't know what name to use to provided credit when I check it in
 - for submissions I provide check ion message of the form:

 From FirstName SecondName, Content of submission

 That helps provide credit where credit is due and also enables us to
 follow up more easily in case there are regressions or we need further
 information about a bit of code.  So could you let me know what name
 you want to use and I'll get the fix checked into svn/trunk and
 OSG-3.2 branch.

 Cheers,
 Cheers,
 Robert.


 On 30 September 2013 15:06, Konstantin lalakos...@gmail.com wrote:
  Rather!
 
 
 
  2013/9/30 Robert Osfield robert.osfi...@gmail.com
 
  Hi Konstantin,
 
  Could you post the full modified file to osg-submissions so I can
  review it, thanks.
 
  Robert.
 
  On 30 September 2013 14:54, Konstantin lalakos...@gmail.com wrote:
   Multiple light fix in the FBX importer:
  
   in fbxRLight.cpp
  
   This:
   /
   osg::Light* osgLight = new osg::Light;
   osg::LightSource* osgLightSource = new osg::LightSource;
  
   osgLightSource-setLight(osgLight);
   osgLight-setLightNum(nLightCount++);
   /
  
   Must be this:
   /
   osg::Light* osgLight = new osg::Light;
   osgLight-setLightNum(nLightCount++);
  
   osg::LightSource* osgLightSource = new osg::LightSource;
   osgLightSource-setLight(osgLight);
   /
  
   Other way, you will always have GL_LIGHT0, but the last (from FBX
 tree)
   8-)
   osgLightSource-setLight() should be after light was tuned in other
   words...
  
  
   KOS
  
  
   ___
   osg-users mailing list
   osg-users@lists.openscenegraph.org
  
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 
 
  --
  --
  С уважением,
  Матвеев Константин
  Руководитель проекта
  +7 (917) 554 44 64
  konstantin.matve...@eligovision.ru
 
  EligoVision. Интерактивные Технологии
  http://www.eligovision.ru
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 --
 --
 С уважением,
 Матвеев Константин
 Руководитель проекта
 +7 (917) 554 44 64
 konstantin.matve...@eligovision.ru

 EligoVision. Интерактивные Технологии
 http://www.eligovision.ru

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


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


Re: [osg-users] [build] Build Problem with osgGA at MacOS with Xcode 5

2013-10-18 Thread Jan Klimke
Hi Robert,

thanks for you reply.

I am pretty sure that the settings did not change. But what i noticed is that 
the build is running better when libc++ and the c++11 standard is used when 
compiling.

Currently if there is a clang compiler, the standard used is still c++98. This 
is currently hard coded and not configurable from cmake. Since dependent 
projects use the c++11 standard and libc++ as standard library implementation, 
there are linking issues if osg is not build with libc++ due to 
incompatibilities of std::string in libstdc++ and libc++


I had to adapt some plugins (added some casts to remove compiling errors) in 
oder to make osg compile. Do you think it is useful to switch the c++ versions 
in CMAKE at least for newer CLANG versions. 

The current Xcode provides the clang 5 as default compiler.

Do you think these changes could be integrated into osg and the defaults can be 
changed to libc++ and c++11 for clang compiling ?

Thank you!

Cheers,
Jan

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





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


Re: [osg-users] Track map on a 3D view

2013-10-18 Thread Robert Osfield
Hi Gianni,


On 18 October 2013 08:44, Gianni Ambrosio ga...@vi-grade.com wrote:

 Thanks Robert. How could I overlap the two views? Looking at
 osgcompositeviewer example it seems they can overlay but one rectangle
 hides others while I need the 2D teack background to be transparent.


Simply set the ClearMask on the Camera that overlays to just clear the
depth buffer.  See the osghud example for guidance on this.

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


Re: [osg-users] [build] Build Problem with osgGA at MacOS with Xcode 5

2013-10-18 Thread Stephan Maximilian Huber
Hi Jan,

Curious, I had linking errors when compiling osg with c++11 for IOS, so I added 
the c++98-flags to cmake. The best we can do is to make it configurable via 
cmake.

cheers,

Stephan

Am 18.10.2013 um 10:25 schrieb Jan Klimke osgfo...@tevs.eu:

 Hi Robert,
 
 thanks for you reply.
 
 I am pretty sure that the settings did not change. But what i noticed is that 
 the build is running better when libc++ and the c++11 standard is used when 
 compiling.
 
 Currently if there is a clang compiler, the standard used is still c++98. 
 This is currently hard coded and not configurable from cmake. Since dependent 
 projects use the c++11 standard and libc++ as standard library 
 implementation, there are linking issues if osg is not build with libc++ due 
 to incompatibilities of std::string in libstdc++ and libc++
 
 
 I had to adapt some plugins (added some casts to remove compiling errors) in 
 oder to make osg compile. Do you think it is useful to switch the c++ 
 versions in CMAKE at least for newer CLANG versions. 
 
 The current Xcode provides the clang 5 as default compiler.
 
 Do you think these changes could be integrated into osg and the defaults can 
 be changed to libc++ and c++11 for clang compiling ?
 
 Thank you!
 
 Cheers,
 Jan
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=56849#56849
 
 
 
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


Re: [osg-users] Invalid GL buffer object

2013-10-18 Thread Robert Osfield
Hi Sajjadul,

As I said I don't know what is going amiss in your code. Debugging this
type of thing really requires a proper overview of all the code and ideally
testable code.  This level of support is something I can provide.

Perhaps if you can't manage the wiring up of OpenCL and the OSG yourself
you should look for 3rd party example codes that do it.  I haven't
personally implemented OpenCL and OSG integation so can't help directly.

Robert.


On 18 October 2013 07:53, Sajjadul Islam dosto.wa...@gmail.com wrote:

 Thanks Robert,

 I am not calling glGenBuffers() in my code. I am calling the following :


 Code:

 osg::GLBufferObject *glBO =
 vbo-getOrCreateGLBufferObject(osgCompute::GLMemory::getContext()-getState()-getContextID());




 Since i am getting undefined behavior, i used the debugger to get inside
 the above statement and found that  i am having the issue inside the
 GLBufferObject constructor.


 Code:

 GLBufferObject::GLBufferObject(unsigned int contextID, BufferObject*
 bufferObject, unsigned int glObjectID):
 _contextID(contextID),
 _glObjectID(glObjectID),
 _profile(0,0,0),
 _allocatedSize(0),
 _dirty(true),
 _bufferObject(0),
 _set(0),
 _previous(0),
 _next(0),
 _frameLastUsed(0),
 _extensions(0)
 {
 assign(bufferObject);

 _extensions = GLBufferObject::getExtensions(contextID, true);

 if (glObjectID==0)
 {
 _extensions-glGenBuffers(1, _glObjectID);
 }

 // OSG_NOTICEConstucting BufferObject thisstd::endl;
 }




 The immediate above snippet is from the BufferObject file that came along
 with the API.

 And i found that _glObjectID is carrying the value 0 even after call:


 Code:

 _extensions-glGenBuffers(1, _glObjectID);




 I believe that 0 is not a valid value here.

 Any more thoughts ?

 Regards,
 Sajjadul

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





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

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


Re: [osg-users] Track map on a 3D view

2013-10-18 Thread Gianni Ambrosio
Hi Robert,
there's just one thing I don't like of this approach: the viewer is the driver. 
In my application I have one scene and I attach the root node to the viewer at 
startup. Then every model (xml) I load builds its own osg sub-graph and is 
attached to the scene. So that code doesn't need to know anything of the viewer.

Regards
Gianni

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





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


Re: [osg-users] Track map on a 3D view

2013-10-18 Thread Robert Osfield
Hi Gianni,

On 18 October 2013 10:34, Gianni Ambrosio ga...@vi-grade.com wrote:

 Hi Robert,
 there's just one thing I don't like of this approach: the viewer is the
 driver. In my application I have one scene and I attach the root node to
 the viewer at startup. Then every model (xml) I load builds its own osg
 sub-graph and is attached to the scene. So that code doesn't need to know
 anything of the viewer.


There is no reason why you couldn't do this with a CompositeViewer.  If you
wanted just a single scene graph then the NodeMask/TraversalMask
combination can be used to make sure each view gets to see what parts of
the scene graph are of interest to it.  See the osgstereoimage example for
an illustration of using node masks/traversal masks (just change the
traversal masks to CullMask for your purposes.)

Robert.
___
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


[osg-users] Fwd: Split-screen and Reflection Mapping

2013-10-18 Thread Gaëtan André
Hi,

How to have view dependents effects on a multiple view render ?

Let us say that I have two views on one scene (split-screen), each view
following a different car in a racing game. Reflection Mapping (RM) has to
be applied to the current car on each view and disabled for all other cars.

I made a shader in which we can activate or deactivate the rendering of the
reflection Map via a Uniform variable. We can modify the texture used for
RM using uniforms too.

In my OSG tree, the two view have the same scene_root child (it is not a
duplicate). So at each rendered view (corresponding to a osg::Camera), I
need to activate RM for the current car and provide the good RM map. Just
after the view is rendered I need to deactivate RM on this same car.

I try to do this using preDrawCallBack (to activate RM on the current car
of the current view, and provide the correct RM map) and postDrawCallback
(to deactivate RM on the current car) on the camera of each view. Although
the callbacks are called, the RM is not rendered. Is that normal ?

Do I do things in the correct way ?

Thank you!

Cheers,
Gaëtan

PS, I previously posted this message on the forum, but I saw in a topic
that mailing sould be use. So i do.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Track map on a 3D view

2013-10-18 Thread Gianni Ambrosio
Thank you again Robert!
If I undarstand correctly, then I have to create a composite viewer with a 
proper view for a 2D track even if the user may not need it (i.e. 2D track 
object not loaded). That would not be a real problem.
But  on the other hand a user can load more then one 2D track object (even if 
in this case it would not have really sense). Of course a new view can be added 
for each 2D track object but that means my scene manager should depend on the 
viewer (at the moment this dependency is not needed).

Regards
Gianni

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





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


Re: [osg-users] Grayscale texture

2013-10-18 Thread Boon Wah
Hi,

I tried --compression flag and --compression-dxt1 flag in OSGDEM. However, 
when I step through OSG when I view the IVE, I noticed that the texture 
compression all defaults to SCTC-DX1. The size of the compiled textures are the 
same.

Can anybody advise on how to select the ARB extension as suggested.


Kind Regards,
Jimmy

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





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


[osg-users] osgText does not show text on screen

2013-10-18 Thread Deniz Koçak
Hi all,

I am trying to put a text on my screen by creating a HUD camera. I create a
camera object and add nodes to it (as in HUD examples). However, when I
select XY_PLANE or SCREEN as AxisAlignment for osgText::Text object, it
dows not show anything, but works (no really works, but I can see rotated
text) with REVERSED_XY_PLANE. When I select REVERSED_XY_PLANE, the result
can be seen on attached screenshot and of course this not what I want. I
tried many combinations, but the result was always same. What can I do in
that case?

Cheers,
Deniz

-

osg::Camera* createHUDText()
{
   m_hudHeadingText = new osgText::Text();
m_hudHeadingText-setText(Test);
//m_hudHeadingText-setFont(osgText::Font::getDefaultFont());

m_hudHeadingText-setCharacterSizeMode(osgText::TextBase::OBJECT_COORDS);
m_hudHeadingText-setAlignment(osgText::TextBase::LEFT_BASE_LINE);
  m_hudHeadingText-setAxisAlignment(osgText::TextBase::XY_PLANE);
//m_hudHeadingText-setAutoRotateToScreen(true);
//m_hudHeadingText-setColor( osg::Vec4(1.0, 1.0, 1.0, 1.0) );
m_hudHeadingText-setCharacterSize(24);
m_hudHeadingText-setPosition( osg::Vec3(100.0f, 100.0f, -1.0f) );

osg::Geode* textGeode = new osg::Geode();
textGeode-getOrCreateStateSet()-setMode(GL_DEPTH_TEST,
osg::StateAttribute::OFF);
textGeode-getOrCreateStateSet()-setMode(GL_LIGHTING,
osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);

osg::MatrixTransform* textTransform = new osg::MatrixTransform;
osg::Matrix* textMatrix = new GMatrix;
//textTransform-setMatrix(osg::Matrix::translate(osg::Vec3d(300, 300,
0)));
textTransform-setMatrix(osg::Matrix::identity());
textTransform-addChild(textGeode);

//

m_hudTransformable = new osg::Camera();
m_hudTransformable-setReferenceFrame(GCamera::ABSOLUTE_RF);
m_hudTransformable-setAllowEventFocus(false);
m_hudTransformable-setRenderOrder(GCamera::POST_RENDER, 3);
m_hudTransformable-setProjectionMatrixAsOrtho2D(0.0, 500.0, 0.0,
500.0);
m_hudTransformable-setViewport(0.0, 0.0, 500, 500);
m_hudTransformable-setClearMask(GL_DEPTH_BUFFER_BIT);
m_hudTransformable-setViewMatrix(GMatrix::identity());
m_hudTransformable-getOrCreateStateSet()-setMode(GL_LIGHTING,
osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);
m_hudTransformable-addChild(textTransform);

return m_hudTransformable.get();
}
attachment: test.jpg___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Track map on a 3D view

2013-10-18 Thread Robert Osfield
HI Gianni,

On 18 October 2013 11:50, Gianni Ambrosio ga...@vi-grade.com wrote:

 If I undarstand correctly, then I have to create a composite viewer with a
 proper view for a 2D track even if the user may not need it (i.e. 2D track
 object not loaded). That would not be a real problem.
 But  on the other hand a user can load more then one 2D track object (even
 if in this case it would not have really sense). Of course a new view can
 be added for each 2D track object but that means my scene manager should
 depend on the viewer (at the moment this dependency is not needed).


I would certainly code the application so the adding/removing of the 2D
tracks would be done at a high level that knows about the CompositeVewer
and can add/remove/recyle the required View.

If you wanted the add code to not know about the viewer then I guess you
could use a singleton method for accessing the current viewer, or pass the
viewer pointer to add methods.

Another alternative would be to not use CompositeViewer but instead place
the osg::Camera for each 2D track into the main scene graph.  The osghud
example shows how to do this with an in scene graph osg::Camera as well as
the more conventional and recommend routes of placing the HUD as a slave
Camera or separate View.

The advantage of the CompositeViewer with separate Views is each View can
have it's won event handles and camera manipulator, so allows for unique
behaviours in convenient form. Conceptually it also easy to get your head
around.

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


Re: [osg-users] Grayscale texture

2013-10-18 Thread Robert Osfield
Hi Jimmy,

I don't recall the options or whether compressed greyscale is possible with
VPB/osgdem as it's a while since I worked on the code.  What may be the
best thing to do is simple disable compression, the option is probably
---no-compression.

Robert.


On 18 October 2013 14:59, Boon Wah boon...@gmail.com wrote:

 Hi,

 I tried --compression flag and --compression-dxt1 flag in OSGDEM.
 However, when I step through OSG when I view the IVE, I noticed that the
 texture compression all defaults to SCTC-DX1. The size of the compiled
 textures are the same.

 Can anybody advise on how to select the ARB extension as suggested.


 Kind Regards,
 Jimmy

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





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

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


Re: [osg-users] osgText does not show text on screen

2013-10-18 Thread Robert Osfield
HI Deniz,

On quick review I couldn't spot the problem, but have a look at the osgtext
example, it has code for placing text on a HUD and should be roughly what
you are after.

Robert.


On 18 October 2013 16:04, Deniz Koçak lend...@gmail.com wrote:

 Hi all,

 I am trying to put a text on my screen by creating a HUD camera. I create
 a camera object and add nodes to it (as in HUD examples). However, when I
 select XY_PLANE or SCREEN as AxisAlignment for osgText::Text object, it
 dows not show anything, but works (no really works, but I can see rotated
 text) with REVERSED_XY_PLANE. When I select REVERSED_XY_PLANE, the result
 can be seen on attached screenshot and of course this not what I want. I
 tried many combinations, but the result was always same. What can I do in
 that case?

 Cheers,
 Deniz


 -

 osg::Camera* createHUDText()
 {
m_hudHeadingText = new osgText::Text();
 m_hudHeadingText-setText(Test);
 //m_hudHeadingText-setFont(osgText::Font::getDefaultFont());

 m_hudHeadingText-setCharacterSizeMode(osgText::TextBase::OBJECT_COORDS);
 m_hudHeadingText-setAlignment(osgText::TextBase::LEFT_BASE_LINE);
   m_hudHeadingText-setAxisAlignment(osgText::TextBase::XY_PLANE);
 //m_hudHeadingText-setAutoRotateToScreen(true);
 //m_hudHeadingText-setColor( osg::Vec4(1.0, 1.0, 1.0, 1.0) );
 m_hudHeadingText-setCharacterSize(24);
 m_hudHeadingText-setPosition( osg::Vec3(100.0f, 100.0f, -1.0f) );

 osg::Geode* textGeode = new osg::Geode();
 textGeode-getOrCreateStateSet()-setMode(GL_DEPTH_TEST,
 osg::StateAttribute::OFF);
 textGeode-getOrCreateStateSet()-setMode(GL_LIGHTING,
 osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);

 osg::MatrixTransform* textTransform = new osg::MatrixTransform;
 osg::Matrix* textMatrix = new GMatrix;
 //textTransform-setMatrix(osg::Matrix::translate(osg::Vec3d(300, 300,
 0)));
 textTransform-setMatrix(osg::Matrix::identity());
 textTransform-addChild(textGeode);

 //

 m_hudTransformable = new osg::Camera();
 m_hudTransformable-setReferenceFrame(GCamera::ABSOLUTE_RF);
 m_hudTransformable-setAllowEventFocus(false);
 m_hudTransformable-setRenderOrder(GCamera::POST_RENDER, 3);
 m_hudTransformable-setProjectionMatrixAsOrtho2D(0.0, 500.0, 0.0,
 500.0);
 m_hudTransformable-setViewport(0.0, 0.0, 500, 500);
 m_hudTransformable-setClearMask(GL_DEPTH_BUFFER_BIT);
 m_hudTransformable-setViewMatrix(GMatrix::identity());
 m_hudTransformable-getOrCreateStateSet()-setMode(GL_LIGHTING,
 osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);
 m_hudTransformable-addChild(textTransform);

 return m_hudTransformable.get();
 }

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


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


Re: [osg-users] osgText does not show text on screen

2013-10-18 Thread Deniz Koçak
Hi Robert,

I have already looked at the example(s) on osgText (both comes with source
code and in tutorials on the net), but could not find anything. The weird
thing is it is a quite easy task, but I have no result. I use
OpenSceneGraphversion 3.1.2 and Visual Studio 2010 on Windows
XP. Is there any bug report or a tricky part should I know?

Cheers,
Deniz


On Fri, Oct 18, 2013 at 6:20 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 HI Deniz,

 On quick review I couldn't spot the problem, but have a look at the
 osgtext example, it has code for placing text on a HUD and should be
 roughly what you are after.

 Robert.


 On 18 October 2013 16:04, Deniz Koçak lend...@gmail.com wrote:

 Hi all,

 I am trying to put a text on my screen by creating a HUD camera. I create
 a camera object and add nodes to it (as in HUD examples). However, when I
 select XY_PLANE or SCREEN as AxisAlignment for osgText::Text object, it
 dows not show anything, but works (no really works, but I can see rotated
 text) with REVERSED_XY_PLANE. When I select REVERSED_XY_PLANE, the result
 can be seen on attached screenshot and of course this not what I want. I
 tried many combinations, but the result was always same. What can I do in
 that case?

 Cheers,
 Deniz


 -

 osg::Camera* createHUDText()
 {
m_hudHeadingText = new osgText::Text();
 m_hudHeadingText-setText(Test);
 //m_hudHeadingText-setFont(osgText::Font::getDefaultFont());

 m_hudHeadingText-setCharacterSizeMode(osgText::TextBase::OBJECT_COORDS);
 m_hudHeadingText-setAlignment(osgText::TextBase::LEFT_BASE_LINE);
   m_hudHeadingText-setAxisAlignment(osgText::TextBase::XY_PLANE);
 //m_hudHeadingText-setAutoRotateToScreen(true);
 //m_hudHeadingText-setColor( osg::Vec4(1.0, 1.0, 1.0, 1.0) );
 m_hudHeadingText-setCharacterSize(24);
 m_hudHeadingText-setPosition( osg::Vec3(100.0f, 100.0f, -1.0f) );

 osg::Geode* textGeode = new osg::Geode();
 textGeode-getOrCreateStateSet()-setMode(GL_DEPTH_TEST,
 osg::StateAttribute::OFF);
 textGeode-getOrCreateStateSet()-setMode(GL_LIGHTING,
 osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);

 osg::MatrixTransform* textTransform = new osg::MatrixTransform;
 osg::Matrix* textMatrix = new GMatrix;
 //textTransform-setMatrix(osg::Matrix::translate(osg::Vec3d(300,
 300, 0)));
 textTransform-setMatrix(osg::Matrix::identity());
 textTransform-addChild(textGeode);

 //

 m_hudTransformable = new osg::Camera();
 m_hudTransformable-setReferenceFrame(GCamera::ABSOLUTE_RF);
 m_hudTransformable-setAllowEventFocus(false);
 m_hudTransformable-setRenderOrder(GCamera::POST_RENDER, 3);
 m_hudTransformable-setProjectionMatrixAsOrtho2D(0.0, 500.0, 0.0,
 500.0);
 m_hudTransformable-setViewport(0.0, 0.0, 500, 500);
 m_hudTransformable-setClearMask(GL_DEPTH_BUFFER_BIT);
 m_hudTransformable-setViewMatrix(GMatrix::identity());
 m_hudTransformable-getOrCreateStateSet()-setMode(GL_LIGHTING,
 osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);
 m_hudTransformable-addChild(textTransform);

 return m_hudTransformable.get();
 }

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



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


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


Re: [osg-users] osgText does not show text on screen

2013-10-18 Thread Robert Osfield
HI Deniz,


On 18 October 2013 16:25, Deniz Koçak lend...@gmail.com wrote:

 I have already looked at the example(s) on osgText (both comes with source
 code and in tutorials on the net), but could not find anything. The weird
 thing is it is a quite easy task, but I have no result. I use
 OpenSceneGraph version 3.1.2 and Visual Studio 2010 on Windows XP. Is there
 any bug report or a tricky part should I know?


I am not aware of any bug reports or fixes that might be relevant to your
case, it's most likely just an error with setup somewhere.

I would however recommend either using OSG-3.2.0 stable release or one
OSG-3.3.0 or later dev releases as these contain a range of improvements
and quite a few bug fixes.  While I might not expect it to resolve your
problems it'll likely avoid the possibility of hitting others.

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


[osg-users] how to disable the frustum culling?

2013-10-18 Thread Julio Jerez
I am get a lot of frustration trying to disable frustum culling with OSG
camera.

I am setting the perspective matrix to  a near plane of 0.1 and a far plane
of 1000.0

here is my code.

I explicitly disable frustum culling, however no matter how many time I do
it,  each time 

viewer.frame() is called, the camera rest the near plane to 0.112 and the
far plane to 228.56

 

can someone tells me how to prevent OSG from doing that?

here is my setup code that initialize the camera after the viewer is
instantiated.  

 

   SetCameraProjectionMatrix (viewer, 90.0f, dFloat (width) /
height, 0.1, 1000.0f);

 

   int cullingMode = cam-getCullingMode();

   cullingMode = ~osg::CullSettings::VIEW_FRUSTUM_CULLING;

   cam-setCullingMode(cullingMode);

}

 

void SetCameraProjectionMatrix (osgViewer::Viewer viewer, dFloat
viewAngleInDegress, dFloat aspectRatio, dFloat nearPlane, dFloat farPlane)

{

   osg::Camera* const camera = viewer.getCamera();

   camera-setProjectionMatrixAsPerspective (viewAngleInDegress,
aspectRatio, nearPlane, farPlane);

 

//camera-setViewMatrixAsLookAt (osg::Vec3 (3.0f, -5.0f, 2.0f),
osg::Vec3 (0.0f, 0.0f, 0.0f), osg::Vec3 (0.0f, 0.0f, 1.0f));

   camera-setViewMatrixAsLookAt (osg::Vec3 (-3.0f, -5.0f,
2.0f), osg::Vec3 (0.0f, 0.0f, 2.0f), osg::Vec3 (0.0f, 0.0f, 1.0f));

}

 

 

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


Re: [osg-users] how to disable the frustum culling?

2013-10-18 Thread Sebastian Messerschmidt

Hi julio,

I guess you are not looking for culling, but for near-far plane calculation.
try:

camera-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);


why do you want to disable culling, or did you just mixed it up with the 
near-far mode?


cheers
Sebastian

I am get a lot of frustration trying to disable frustum culling with 
OSG camera.


I am setting the perspective matrix to  a near plane of 0.1 and a far 
plane of 1000.0


here is my code.

I explicitly disable frustum culling, however no matter how many time 
I do it,  each time


viewer.frame() is called, the camera rest the near plane to 0.112 and 
the far plane to 228.56


can someone tells me how to prevent OSG from doing that?

here is my setup code that initialize the camera after the viewer is 
instantiated.


   SetCameraProjectionMatrix (viewer, 90.0f, dFloat 
(width) / height, 0.1, 1000.0f);


   int cullingMode = cam-getCullingMode();

   cullingMode = ~osg::CullSettings::VIEW_FRUSTUM_CULLING;

cam-setCullingMode(cullingMode);

}

void SetCameraProjectionMatrix (osgViewer::Viewer viewer, dFloat 
viewAngleInDegress, dFloat aspectRatio, dFloat nearPlane, dFloat farPlane)


{

   osg::Camera* const camera = viewer.getCamera();

camera-setProjectionMatrixAsPerspective (viewAngleInDegress, 
aspectRatio, nearPlane, farPlane);


// camera-setViewMatrixAsLookAt (osg::Vec3 (3.0f, -5.0f, 2.0f), 
osg::Vec3 (0.0f, 0.0f, 0.0f), osg::Vec3 (0.0f, 0.0f, 1.0f));


camera-setViewMatrixAsLookAt (osg::Vec3 (-3.0f, -5.0f, 2.0f), 
osg::Vec3 (0.0f, 0.0f, 2.0f), osg::Vec3 (0.0f, 0.0f, 1.0f));


}



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


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


Re: [osg-users] Track map on a 3D view

2013-10-18 Thread Gianni Ambrosio

robertosfield wrote:
 
 Another alternative would be to not use CompositeViewer but instead place the 
 osg::Camera for each 2D track into the main scene graph.  The osghud example 
 shows how to do this with an in scene graph osg::Camera as well as the more 
 conventional and recommend routes of placing the HUD as a slave Camera or 
 separate View.
 

OK, in fact I was trying to implement it this way.

robertosfield wrote:
 
 The advantage of the CompositeViewer with separate Views is each View can 
 have it's won event handles and camera manipulator, so allows for unique 
 behaviours in convenient form. Conceptually it also easy to get your head 
 around.
 

Thanks for explaining the benefits of your suggested solution. I will try this 
also.

Gianni

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





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


Re: [osg-users] [3rdparty] OSG EXPORTER for 3DS MAX - Y-up

2013-10-18 Thread Tim Larson
I know this is an old thread, but I would like to ask the original poster if he 
ever found a resolution to this issue.

I have also found that after a recent update to osgexp my model's up 
orientation has changed.

... 


Thank you!

Cheers,
Tim

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





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


Re: [osg-users] how to disable the frustum culling?

2013-10-18 Thread Paul Martz
It's often desirable to disable culling for any geometry that is
non-spatial in nature. Such geometry is very common in modern graphics
programming.

Even after you disable near/far auto-compute, and set culling disabled on
your scene graph, the CullVisitor will still cull any geometry that is
behind the eye point. This makes rendering non-spatial geometry just a
little tricky. You must add such geometry to its own Camera node, and
configure the Camera so that the CullVisitor will not discard its child
geometry.
   -Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [3rdparty] OSG EXPORTER for 3DS MAX - Y-up

2013-10-18 Thread Farshid Lashkari
Hi Tim,

Which version of the exporter are you using? Did you use one of the
pre-built installers, and if so where did you download the installer?

Cheers,
Farshid


On Fri, Oct 18, 2013 at 9:51 AM, Tim Larson tlar...@hunter.com wrote:

 I know this is an old thread, but I would like to ask the original poster
 if he ever found a resolution to this issue.

 I have also found that after a recent update to osgexp my model's up
 orientation has changed.

 ...


 Thank you!

 Cheers,
 Tim

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





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

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