[osg-users] How to get Center Parameter of CameraManipulator

2017-03-14 Thread duc nguyen
Hi,
After setCameraManipulator for my viewer i can get the Eye parameter of camera 
but cannot get the Center parameter to get the point of my camera looking at. 
How to get this value?

Here is the way i get the Eye parameter:


Code:
osg::Matrixd mt = _viewer->getCameraManipulator()->getMatrix();
Vec3d eye = mt.getTrans();





Thank you!

Cheers,
duc

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





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


Re: [osg-users] bug: osgText doesn't work on MacOSX GL4.x with VAO

2017-03-14 Thread Robert Osfield
Hi Remo,

On 14 March 2017 at 18:16, Remo Eichenberger  wrote:
> The env variable doesn't help. I see such errors:
>
> With subloading enabled i see this:
>
> before Glyph::subload(): detected OpenGL error: invalid enumerant
> Glyph::subload(): texture sub-image width and/or height of 0, ignoring 
> operation.

I can't investigate these OSX specific issues.  There is a limit to
the amount of free support I can do on this, the rewrite of osgText
has already cost me three weeks work, all unpaid.  It's time that OSX
users stood up to the plate and started resolving OSX specific issues.
There are other pressing things I need to get on with.

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


Re: [osg-users] bug: osgText doesn't work on MacOSX GL4.x with VAO

2017-03-14 Thread Remo Eichenberger
The env variable doesn't help. I see such errors:

With subloading enabled i see this:

before Glyph::subload(): detected OpenGL error: invalid enumerant
Glyph::subload(): texture sub-image width and/or height of 0, ignoring 
operation.

I've posted the log on the github issue.

Remo

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





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


Re: [osg-users] bug: osgText doesn't work on MacOSX GL4.x with VAO

2017-03-14 Thread Robert Osfield
On 14 March 2017 at 17:38, Remo Eichenberger  wrote:
> Without this setting I see only a blue screen/window without any text.

Do you get any GL errors reported on the console?

Could you try disabling the incremental subloading of the glyph
texture by setting the env var OSG_TEXT_INCREMENTAL_SUBLOADING to OFF

i.e.

setenv OSG_TEXT_INCREMENTAL_SUBLOADING OFF
osgtext

Also have you tried OSG+GL3 on other platforms?  Knowing whether this
is a OSX specific bug or not will help us look for what the cause
might be.

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


Re: [osg-users] bug: osgText doesn't work on MacOSX GL4.x with VAO

2017-03-14 Thread Remo Eichenberger
Without this setting I see only a blue screen/window without any text.

Remo

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





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


Re: [osg-users] bug: osgText doesn't work on MacOSX GL4.x with VAO

2017-03-14 Thread Robert Osfield
On 14 March 2017 at 17:01, Remo Eichenberger  wrote:
> Update: Stock sample "examples_osgtext" partial works with:
>
> font->setMinFilterHint(osg::Texture::LINEAR);
>
> on MacOSX GL3 Core Profile

This will be disabling mipmapping.  Surely OSX GL3 core profile
supports mipmapping. this is a fundamental feature of texturing.
Perhaps the driver is broken.

Disabling mipmapping on text is not desirable as you'll end up with
aliasing artefacts when the text on screen size results in the texel
to pixel ratio less than one.

What happens you don't use the
font->setMinFilterHint(osg::Texture::LINEAR); hack?  A screenshot
would be useful.

Robert.
___
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 Antialiasing of an osg::Text

2017-03-14 Thread Robert Osfield
Hi Lv,

It looks like you are position the text in a 3D scene and leaving it
to scale in object coordinates, which is fine, but it does mean that
the scale will and orientation will vary, this is very different
challenge for rendering clear text than rendering a fixed font to a
fixed 2D projection like you have with a typical Qt application.  You
simple can't compare fonts working in 3D and 2D domains.

That aside to get the best quality of text in a 3d scene you'll
typically want to aim for a font resolution around the on screen
resolution that the text will typically be rendered at, in full 3D
scene this scaling obviously varies so there won't be one ideal
resolution, you'll just have to pick the best one for your the size of
your text and the distances you view them at.

Disabling of placing text into the transparent bin could cause real
problems as the blending of the text could be broken.  Text is put in
the transparent bin to make sure it's rendered after the rest of the
3D scene to make sure that the transparent parts of the text are
correctly blending and the quads text doesn't interfere with with the
zbuffer.  I don't know whether this is affecting quality for you as
you don't say anything about what you by "decluttering".

Robert.

On 14 March 2017 at 17:07, Lv Qing  wrote:
> Hi,
>
> Thx Robert!
>
>I use one of osgEarth fuction to rendering my text.
>
>
>
> Code:
>
>
> osg::ref_ptr PowerPlaceNode::createPlaceNodeTextDrawable(const 
> std::string& text,
> const TextSymbol* symbol, const osg::Vec3& positionOffset)
> {
> osg::ref_ptr < osgText::Text > t = new osgText::Text();
> osgText::String::Encoding text_encoding = 
> osgText::String::ENCODING_UNDEFINED;
> if (symbol && symbol->encoding().isSet())
> {
> switch (symbol->encoding().value())
> {
> case TextSymbol::ENCODING_ASCII:
> text_encoding = osgText::String::ENCODING_ASCII;
> break;
> case TextSymbol::ENCODING_UTF8:
> text_encoding = osgText::String::ENCODING_UTF8;
> break;
> case TextSymbol::ENCODING_UTF16:
> text_encoding = osgText::String::ENCODING_UTF16;
> break;
> case TextSymbol::ENCODING_UTF32:
> text_encoding = osgText::String::ENCODING_UTF32;
> break;
> default:
> text_encoding = osgText::String::ENCODING_UTF8;
> break;   //editby lvqing 20140509
> }
> }
>
> t->setText(text, osgText::String::ENCODING_UTF8);
>
>
> if (symbol && symbol->pixelOffset().isSet())
> {
> t->setPosition(
> osg::Vec3(positionOffset.x() + 
> symbol->pixelOffset()->x(),
> positionOffset.y() + 
> symbol->pixelOffset()->y(), positionOffset.z()));
> }
> else
> {
> t->setPosition(positionOffset);
> }
>
> osgText::Font* font = 0L;
> if (symbol && symbol->font().isSet())
> {
> font = osgText::readFontFile(*symbol->font()); // read font*/
> }
>
> t->setFontResolution(256,256);
>
> t->setAutoRotateToScreen(false);
> t->setCharacterSizeMode(osgText::Text::OBJECT_COORDS);
>
> if (symbol != NULL)
> {
> if (symbol->size() != NULL)
> {
> t->setCharacterSize( symbol && symbol->size().isSet() 
> ? *symbol->size() : 20.0f );
> }
> else
> {
> t->setCharacterSize( 20.0f );
> }
> }
>
> if (!font)
> font = Registry::instance()->getDefaultFont();
> if (font)
> {
> t->setFont(font);
> }
>
> t->setColor(symbol && symbol->fill().isSet() ? 
> symbol->fill()->color() : Color::White);
>
> if (symbol)
> {
> // they're the same enum.
> osgText::Text::AlignmentType at = 
> (osgText::Text::AlignmentType) symbol->alignment().value();
> t->setAlignment(at);
> }
>
> if (symbol && symbol->halo().isSet())
> {
> t->setBackdropColor(symbol->halo()->color());
> t->setBackdropType(osgText::Text::OUTLINE);
>
> if (symbol->haloOffset() != NULL)
> {
> if (symbol->haloOffset().isSet())
> {
> t->setBackdropOffset(*symbol->haloOffset(), 
> *symbol->haloOffset());
> }
> }
> }
> else if (!symbol)
> {
>

Re: [osg-users] bug: osgText doesn't work on MacOSX GL4.x with VAO

2017-03-14 Thread Remo Eichenberger
Update: Stock sample "examples_osgtext" partial works with:

font->setMinFilterHint(osg::Texture::LINEAR);

on MacOSX GL3 Core Profile

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





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


Re: [osg-users] My game - Narrow

2017-03-14 Thread Johny Canes
I'll post a demo maybe some time soon.

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





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


[osg-users] [vpb] How to query height of terrain given lat lon position ?

2017-03-14 Thread Vinoth Rajendran
Hi,

   I have created terrain using VPB tool I would like to query height of a 
point in terrain provided corresponding latitude and longitude.

Any Help is appreciated...

I am generating flat terrain using VPB.

Thank you!

Cheers,
Vinoth

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





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


Re: [osg-users] My game - Narrow

2017-03-14 Thread michael kapelko
Nice. Where can we get the game?

2017-03-10 3:25 GMT+07:00 Johny Canes :

> Hi,
>
> Hey, here's a screenshot of my game. I've ported it from Three.js and OSG
> has been a really, really smooth ride so far!
>
> That's an Awesomium texture on that CRT :D!
>
> http://imgur.com/a/mLhUn
>
> Thank you!
>
> Cheers,
> Johny
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70461#70461
>
>
>
>
>
> ___
> 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] bounding box collisions (without osgbullet)

2017-03-14 Thread Julien Valentin
Hi Sebastian

If you have  few dynamic objects, an update callback with an inner 
intersectvisitor can do the trick ...
In other case you may have to reimplement the wheel (like a AABB sweeping 
broaphase) , so osgBullet seams the best fit 
And to finish, if you have massive dynamics:
-bullet3 have a GPU experimental Broadphase 
-you could implement your own GPU collision stuff (as most SPH implementation 
does)

PS: if osgBullet annoys you because of its dependencies with osgWorks, i have 
removed all of them on my git:
https://github.com/mp3butcher/osgbullet


Trajce Nikolov NICK wrote:
> Hi Sebastian,
> 
> it is for simulation, i have a moving entity and a terrain (with buildings 
> etc). Now I am not after triangle level intersection, but after Entity BBox 
> collision with the terrain (enough is true false). I was thinking to do it 
> really very simple by having LOS rays from the entity center to the corners 
> of the BBox. The entity can move in any direction
> 
> 
> On Mon, Mar 13, 2017 at 9:41 PM, Sebastian Messerschmidt < ()> wrote:
> 
> >   Hi Nick, 
> > 
> > basically this is not an easy task. What exactly do you expect as a 
> > collision result? 
> > I've implemented a triangle-box collision with MTD (minimal transform 
> > distance = vector describing how to push the box to get it exactly away 
> > from the colliding triangle). OSG has all the math facilities to do this, 
> > but I guess you'll save a lot of headache using pyhsics etc. for dynamics. 
> > So maybe try to explain the problem you're trying to solve a bit more in 
> > detail.
> > 
> > Cheers
> > Sebastian 
> > 
> > 
> > >  no one on this?
> > > 
> > > On Sun, Mar 12, 2017 at 9:53 PM, Trajce Nikolov NICK < ()> wrote:
> > > 
> > > >  Hi community, 
> > > > 
> > > > what would be the best way to implement bbox collision with terrain, 
> > > > from what is already in OSG (no bullet etc)?
> > > > 
> > > > 
> > > > thanks a bunch as always,
> > > > Nick 
> > > > 
> > > > -- 
> > > > trajce nikolov nick
> > > > 
> > > > 
> > > > 
> > > > 
> > >  
> > > 
> > > 
> > > 
> > > -- 
> > > trajce nikolov nick
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > ___
> > > > osg-users mailing list
> > > >  ()
> > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > >  
> > > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > > > 
> > >  
> >  
> > 
> > 
> > ___
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> > 
> 
> 
> 
> 
> -- 
> trajce nikolov nick
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] bounding box collisions (without osgbullet)

2017-03-14 Thread Julien Valentin
Hi Sebastian

If you have  few dynamic objects, an update callback with an inner 
intersectvisitor can do the trick ...
In other case you may have to reimplement the wheel (like a AABB sweeping 
broaphase) , so osgBullet seams the best fit 
And to finish, if you have massive dynamics:
-bullet3 have a GPU experimental Broadphase 
-you could implement your own GPU collision stuff (as most SPH implementation 
does)

PS: if osgBullet annoys you because of its dependencies with osgWorks, i have 
removed all of them (but bullet) on my git:
https://github.com/mp3butcher/osgbullet


Trajce Nikolov NICK wrote:
> Hi Sebastian,
> 
> it is for simulation, i have a moving entity and a terrain (with buildings 
> etc). Now I am not after triangle level intersection, but after Entity BBox 
> collision with the terrain (enough is true false). I was thinking to do it 
> really very simple by having LOS rays from the entity center to the corners 
> of the BBox. The entity can move in any direction
> 
> 
> On Mon, Mar 13, 2017 at 9:41 PM, Sebastian Messerschmidt < ()> wrote:
> 
> >   Hi Nick, 
> > 
> > basically this is not an easy task. What exactly do you expect as a 
> > collision result? 
> > I've implemented a triangle-box collision with MTD (minimal transform 
> > distance = vector describing how to push the box to get it exactly away 
> > from the colliding triangle). OSG has all the math facilities to do this, 
> > but I guess you'll save a lot of headache using pyhsics etc. for dynamics. 
> > So maybe try to explain the problem you're trying to solve a bit more in 
> > detail.
> > 
> > Cheers
> > Sebastian 
> > 
> > 
> > >  no one on this?
> > > 
> > > On Sun, Mar 12, 2017 at 9:53 PM, Trajce Nikolov NICK < ()> wrote:
> > > 
> > > >  Hi community, 
> > > > 
> > > > what would be the best way to implement bbox collision with terrain, 
> > > > from what is already in OSG (no bullet etc)?
> > > > 
> > > > 
> > > > thanks a bunch as always,
> > > > Nick 
> > > > 
> > > > -- 
> > > > trajce nikolov nick
> > > > 
> > > > 
> > > > 
> > > > 
> > >  
> > > 
> > > 
> > > 
> > > -- 
> > > trajce nikolov nick
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > ___
> > > > osg-users mailing list
> > > >  ()
> > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > >  
> > > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > > > 
> > >  
> >  
> > 
> > 
> > ___
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> > 
> 
> 
> 
> 
> -- 
> trajce nikolov nick
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] Frame Rate

2017-03-14 Thread Robert Osfield
HI Bhanu,

Have a look at the osgforest example, it has various approach to
rendering large numbers of trees. The example uses texture quads as
the basis but the approaches can be generalized.

Robert.

On 14 March 2017 at 05:40, Bhanu Chandra  wrote:
> Hi,
> I am trying to add more than 3000 .3ds models to the scene at different 
> places. I am getting too low frame rate i.e 2.6. Is there any algorithms to 
> improve the frame rate in osg. I tried with following code
> osg::ref_ptr root = new osg::Group;
> osg::Node* loadedModel = osgDB::readNodeFile("tree.3ds");
> for (int i = 0; i<3500; ++i)
> {
> float x = randomValue(0.5f, 6.5f);
> float y = randomValue(0.5f, 6.5f);
> float z = randomValue(0.0f, 1.0f);
>
> osg::ref_ptr trans = new   
> osg::MatrixTransform;
> trans->setMatrix(osg::Matrix::scale(0.001, 0.001, 0.001) * 
> osg::Matrix::translate(x, y, z));
> trans->addChild(loadedModel);
> osg::ref_ptr parent = new osg::Group;
> parent->addChild( trans.get());
>
> root->addChild(parent.get());
> }
> ...
>
> Thank you!
>
> Cheers,
> Bhanu
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70478#70478
>
>
>
>
>
> ___
> 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