Re: [osg-users] Geometry in world coordinates but with same screen size - how to do?

2017-01-19 Thread tianzjyh
Hi, Roko, 
Just check function osg::AutoTransform::setPosition(const Vec3d& pos), and 
try setting "pos" to (0,0,0), then maybe you will find a clue.





--





Cheers, 
---
TianZJ



At 2017-01-20 10:10:31, "Roko Talk"  wrote:
>Hi TianZJ,
>
>thank you for your reply :) - Are you sure combining stuff from within the 
>osgautotransform example is enough to achieve what I want for osg::Geometry? 
>Because for text I can realize it with the above posted command.
> 
>Many thanks! :)
>
>Cheers,
>Roko
>
>--
>Read this topic online here:
>http://forum.openscenegraph.org/viewtopic.php?p=70016#70016
>
>
>
>
>
>___
>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] Geometry in world coordinates but with same screen size - how to do?

2017-01-19 Thread Roko Talk
Hi TianZJ,

thank you for your reply :) - Are you sure combining stuff from within the 
osgautotransform example is enough to achieve what I want for osg::Geometry? 
Because for text I can realize it with the above posted command.
 
Many thanks! :)

Cheers,
Roko

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





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


Re: [osg-users] Geometry in world coordinates but with same screen size - how to do?

2017-01-19 Thread tianzjyh


hi, Roko, 
The example "osgautotransform" demonstrates different kinds of text 
auto-transform, e.g. ranged min-scale, max-scale, fixed position. If you are 
not sure about the implementation inside the source code, just try to combine 
the different kinds of texts inside the example, and you will get your wanted 
text.




--





Cheers, 
---
TianZJ



At 2017-01-20 08:55:08, "Roko Talk"  wrote:
>Ps. To specify what I'm exactly looking for, it is an equivalent for 
>osg::Geometry of the following stuff for osgText::TextBase:::
>
>
>Code:
>
>CharacterSizeMode OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT
>
>
>
>
>I hope now it is clear what I'm looking for :)
>
>--
>Read this topic online here:
>http://forum.openscenegraph.org/viewtopic.php?p=70014#70014
>
>
>
>
>
>___
>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] Geometry in world coordinates but with same screen size - how to do?

2017-01-19 Thread Roko Talk
Ps. To specify what I'm exactly looking for, it is an equivalent for 
osg::Geometry of the following stuff for osgText::TextBase:::


Code:

CharacterSizeMode OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT




I hope now it is clear what I'm looking for :)

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





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


Re: [osg-users] Geometry in world coordinates but with same screen size - how to do?

2017-01-19 Thread Roko Talk
Hey Robert,

I thought it is clear what I'm struggling with. I'm able to reproduce the whole 
osgautotransform example. Also I'm able to reproduce it with a geometry geode. 
But I'm struggling with what functionalities I have to combine to be able to 
let my geometry geode have a constant screen size, independent from the zoom 
level, BUT fix world coordinates. 

The stuff in the osgautotransform example comes close to it, but it still 
changes the size when I'm zooming out. 

So my question is, what do I have to combine to have a geometry geode have a 
constant screen size and fixed world coordinates. I guess half of it will be 
osgautotransform, what would be the other half?

Please let me know what you expect from provided example by me. The example 
what just be a geometry geode and applying the features from the 
osgautotransform example to it.


Many thanks in advance : )


Roko

Cheers,
Roko

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





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


Re: [osg-users] found memory leak in OSG 3.0.1

2017-01-19 Thread Robert Osfield
Hi Gianluca,

How you are measuring the memory usage?  It could simply be that the
memory tracking isn't properly handling deallocations.

As a general note, close will just close the graphics context, it
won't delete the osg::GraphicsWindowWin32.  Try testing the creation
of a viewer within a well defined scope and then see what memory has
been deallocated or not on leaving the scope where all the viewer
related objects should be cleaned up.

Robert.

On 19 January 2017 at 17:02, Gianluca Natale  wrote:
> Hi all,
>
> In my application I’m using OSG 3.0.1 (I do know it is old, but I do not
> have the time now to move to a newer version).
>
> I think I have a memory leak, and I don’t know if it’s my fault or a bug in
> OSG.
>
> Using the task manager (on Win 8.1 Pro), I see this.
>
>
>
> When I call:
>
>
>
> GraphicsContext* GraphicsContext::createGraphicsContext(Traits* traits);
>
>
>
> memory allocated in my application increases of about 2.5 MB.
>
>
>
> Then, when I call:
>
>
>
> GraphicsContext::close(bool callCloseImplementation); // I pass true to this
> function
>
>
>
> memory allocated in my application decreases of about 1.5 MB.
>
> So, there is always  about 1 MB that is not deallocated.
>
>
>
> I tried to investigate a bit, and noticed that the problem seems to happen
> inside this function:
>
>
>
> bool GraphicsWindowWin32::setWindow( HWND handle ).
>
>
>
> Specifically, there are 2 calls in that function where memory is allocated:
>
>
>
> 1)  bool GraphicsWindowWin32::setPixelFormat(); // increases about 1 MB
>
> 2)  HGLRC GraphicsWindowWin32::createContextImplementation(); //
> increases about 1.5 MB
>
>
>
> So, it looks like the memory allocated at point 1 is never released.
>
> Is there anything I have to call, when I want to destroy a graphic context,
> other than close()?
>
> Or, if you do know that it is a memory leak, has it been fixed in a newer
> version of OSG?
>
>
> Thanks,
>
> Gianluca Natale
>
>
>
>
>
>
>
>
>
>
>
> ___
> 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] Mip Maps

2017-01-19 Thread David Heitbrink
Thanks, this seems to mostly fix my issue. The texture filtering should have 
already been set for the model, but it looks like along the way,  things that 
were supposed to be NEAREST_MIPMAP_LINEAR were getting set to LINEAR.

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





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


[osg-users] found memory leak in OSG 3.0.1

2017-01-19 Thread Gianluca Natale
Hi all,
In my application I'm using OSG 3.0.1 (I do know it is old, but I do not have 
the time now to move to a newer version).
I think I have a memory leak, and I don't know if it's my fault or a bug in OSG.
Using the task manager (on Win 8.1 Pro), I see this.

When I call:

GraphicsContext* GraphicsContext::createGraphicsContext(Traits* traits);

memory allocated in my application increases of about 2.5 MB.

Then, when I call:

GraphicsContext::close(bool callCloseImplementation); // I pass true to this 
function

memory allocated in my application decreases of about 1.5 MB.
So, there is always  about 1 MB that is not deallocated.

I tried to investigate a bit, and noticed that the problem seems to happen 
inside this function:

bool GraphicsWindowWin32::setWindow( HWND handle ).

Specifically, there are 2 calls in that function where memory is allocated:


1)  bool GraphicsWindowWin32::setPixelFormat(); // increases about 1 MB

2)  HGLRC GraphicsWindowWin32::createContextImplementation(); // increases 
about 1.5 MB

So, it looks like the memory allocated at point 1 is never released.
Is there anything I have to call, when I want to destroy a graphic context, 
other than close()?
Or, if you do know that it is a memory leak, has it been fixed in a newer 
version of OSG?

Thanks,
Gianluca Natale






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


Re: [osg-users] Geometry in world coordinates but with same screen size - how to do?

2017-01-19 Thread Robert Osfield
On 19 January 2017 at 15:34, Roko Talk  wrote:
> does any one else has maybe an idea? : )

I suspect others will be like myself and unable to guess what bit you
are struggling to get working and what you don't understand.  Why not
create a small example, such as by modifying an existing one like
osgautottransform that illustrates your usage case and then others
will be able to see what you are doing and what the results are, and
what you are doing wrong.

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


Re: [osg-users] Geometry in world coordinates but with same screen size - how to do?

2017-01-19 Thread Roko Talk
Hey guys,

does any one else has maybe an idea? : )


Many thanks!

Cheers,
Roko

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





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


Re: [osg-users] Multi thread Rendering

2017-01-19 Thread Robert Osfield
Hi Vinoth,

OpenGL doesn't support multi-threading within a single graphics
context, so you are constrained to doing the rendering for each
context in a single thread.  The threading models that the OSG
provides reflect this, enabling threading of the update, event and
cull traversals in parallel with the draw thread.  This is all
possible with a Qt based viewer, but different versions of Qt add
their own caveates/problems.  If you care a about full screen
real-time performance then Qt probably isn't the best tool to use,
native osgViewer based viewer will work much better, but if you need
the 2D GUI elements that Qt provides then you'll need to jump through
the extra hoops that Qt throws into the mix.

Robert.

On 19 January 2017 at 13:19, Vinoth Rajendran
 wrote:
> Hi,
>
>i am developing one application with terrain, Ocean and some entities.the 
> terrain and some entities reducing the frame rate while rendering.in osg is 
> it possible to create multi thread rendering using QT ? is there any sample 
> code in osg Examples ?
> ...
>
> Thank you!
>
> Cheers,
> Vinoth
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70005#70005
>
>
>
>
>
> ___
> 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] Multi thread Rendering

2017-01-19 Thread Vinoth Rajendran
Hi,

   i am developing one application with terrain, Ocean and some entities.the 
terrain and some entities reducing the frame rate while rendering.in osg is it 
possible to create multi thread rendering using QT ? is there any sample code 
in osg Examples ?
... 

Thank you!

Cheers,
Vinoth

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





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


Re: [osg-users] Bounding box calculations of geometry including osg::Billboard

2017-01-19 Thread Robert Osfield
Hi Malcom,

The osg::Billboard computes the modelview matrix required to the
rotate the osg::Drawable attached to the billboard node, it doesn't
modify the bounding box of the Drawable children.  This is the same
way that the rest of the scene graph works, parents do not affect the
bounding volumes of their children.

Robert.

On 19 January 2017 at 08:58, Malcolm Pigott
 wrote:
> I have a scene where a QUAD in 3D space is rotated to face the camera using 
> an osg::Billboard as the camera rotates and the quad is positioned directly 
> in front of the camera (it's effectively a drag and drop operation).
>
> However, I am trying to draw geometry in an Ortho2D overlay to match up with 
> the edges of the quad by using its bounding box. However, as the camera 
> rotates away from the quad's original location, the bounding box geometry 
> does not seem to take into account the rotations performed by the Billboard.
>
> I have tried replacing the Billboard with an AutoTransform but the latter 
> flicks between states when not being "dragged". This seems to be because the 
> scene is rotated 90degrees so the model is Z up.
>
> Whilst I'm trying to get my head around the AutoTransform problem, is there 
> any way to get the Bounding Box calculations to be correct when a Billboard 
> is in use?
>
> Thanks.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70002#70002
>
>
>
>
>
> ___
> 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] [forum] How best to provide C++ code examples in a post

2017-01-19 Thread Malcolm Pigott
Hi,

I would like to quote some C++ in my questions, such as:


Code:

#include 
int main()
{
std::cout << "Hello, world!" << std::endl;
}




However, it doesn't appear correctly. Can anyone pass on any advice as to how 
to properly quote C++ code?

Thanks.[/code]

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





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


[osg-users] Bounding box calculations of geometry including osg::Billboard

2017-01-19 Thread Malcolm Pigott
I have a scene where a QUAD in 3D space is rotated to face the camera using an 
osg::Billboard as the camera rotates and the quad is positioned directly in 
front of the camera (it's effectively a drag and drop operation).

However, I am trying to draw geometry in an Ortho2D overlay to match up with 
the edges of the quad by using its bounding box. However, as the camera rotates 
away from the quad's original location, the bounding box geometry does not seem 
to take into account the rotations performed by the Billboard.

I have tried replacing the Billboard with an AutoTransform but the latter 
flicks between states when not being "dragged". This seems to be because the 
scene is rotated 90degrees so the model is Z up.

Whilst I'm trying to get my head around the AutoTransform problem, is there any 
way to get the Bounding Box calculations to be correct when a Billboard is in 
use?

Thanks.

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





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


Re: [osg-users] updating the webpages

2017-01-19 Thread Jordi Torres
Hi Paul,

You have now publisher rights. Once you login you can take a look to the
author guidelines:

http://www.openscenegraph.org/index.php/login/author-guidelines

Don't hesitate to ask if you have any doubt.

Cheers.

2017-01-19 4:47 GMT+01:00 Paul McIntosh :

> Thanks - now registered.
>
> Cheers,
>
> Paul
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69998#69998
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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


Re: [osg-users] Mip Maps

2017-01-19 Thread Robert Osfield
Hi David,

There shouldn't be any need to call allocateMipmapLevels() as for most
usage cases the OSG will do what is required, all you need to do is
set up the Texture::setMagFilter(osg::Texture::MIN_FILTER,
NEAREST_MIPMAP_LINEAR).  Calling allocateMipmalLevels() doesn't for a
texture to use mipmapping if the filter level isn't set, and is just a
hint to rebuild the mipmaps, so not required if you are just assigning
a load static osg::Image to the texture.

Robert.

On 19 January 2017 at 00:22, David Heitbrink  wrote:
> I having an issue with rendering models with mip maps, when I render my scene 
> I get some strange aliasing on text in the texture.
>
> I am mostly using DDS files, some texture have mip maps, some do not. If they 
> do not have a mip map defined I am setting:
>
> texture->allocateMipmapLevels();
>
>
> So to test this I added some test code to my shaders to manualy cycle through 
> the mip map levels (FrameNum is a uniform that is incremented every frame):
>
> Code:
>
> vec4 texel = texture2D(TextureId,TexCoord[0]);
> int txtLvl = textureQueryLevels(TextureId);
> int lvl ;
> if (txtLvl > 1){
> lvl = (FrameNum/10) % txtLvl;
> texel = textureLod(TextureId,TexCoord[0],float(lvl));
> if (lvl == 0 ) texel.r+=0.5;
> }
>
>
>
>
> In most of my scene I am getting the red flashing every couple of seconds or 
> so. But the texture does not blur out. In a handful of cases I have some 
> textures that do blur out, but most do not.
>
> Does any one have any ideas on what could be causing this issue?
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69997#69997
>
>
>
>
>
> ___
> 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