[osg-users] Prevention of near plane culling while moving camera

2018-03-09 Thread Hartwig Wiesmann
Hi,

In my dynamic scene (objects can be added or removed) I use a perspective 
projection and automatic near and far plane calculation. To prevent during 
camera movement culling of objects between the camera and the near plane I 
calculate before each camera movement if there are objects in the pyramid built 
by the camera's location and the near plane. This is done by using a polytope 
intersector. If there are objects in-between I limit the camera movement.

If the movement of the camera is moderate everything works fine but if there 
are big steps in the camera movement I still see near plane culling (for one 
frame or so). Because due to the camera movement the near plane will also 
change and therefore my calculation is slightly wrong for the next frame, I 
suppose. But this change of the near plane will only be calculated in the next 
cull traversal and my correction will be again corrected in the next movement 
and therefore the flicker, I guess.

I have already tried to use a slightly larger FOV or further near plane for the 
pyramid but this does not really help (the flicker can still be seen). 
Especially when the camera is looking more parallel to the scene.

I fear that I have to give up automatic near and far calculation or what are 
you doing in such a case?

If I have to give up automatic near-far calculation I basically have to do 
before finalising the camera movement a new near-far calculation and if there 
are still collisions limit or correct the camera movement or adjust the near 
plane. But this basically means that I have to run my own cull traversal. Or 
are there any other solutions?

PS: As the scene is dynamic I cannot pre-calculate the near and far planes.

Thank you for your suggestions in advance!

Cheers,
Hartwig

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





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


Re: [osg-users] The importance of using Camera::setDrawBuffer()+setReadBuffer() in application setup

2018-03-09 Thread Julien Valentin
I haven't followed recent developpement this last 15 days but after merging my 
fork with master todya, all my rtt stuff saved as osgb doesn't work 
anymore(freeze).
You said using using osgviewer would be okay but it doesn't seams to work 
I had setted all my view and rtt cam Read/Draw buffer to GL_BACK but nothing 
help...
Any idea why?


robertosfield wrote:
> Hi All,
> 
> A recent investigation into a bug a user was seeing in their
> application revealed that some applications that use 3rd party
> windowing toolkits aren't setting up the viewer Camera's correctly,
> and I've traced this back to the examples that the OSG provides.  To
> fix these I checked in the followinig commit that patches the various
> osgviewer* examples:
> 
> https://github.com/openscenegraph/OpenSceneGraph/commit/ee3e8202779f370501a1a27c83cb9a72ad009439
> 
> These fixes are now checked into the OpenSceneGraph-3.4 branch and
> master.  The changes are all in form:
> 
> // set the draw and read buffers up for a double buffered
> window with rendering going to back buffer
> camera->setDrawBuffer(GL_BACK);
> camera->setReadBuffer(GL_BACK);
> 
> This explicitly tells the OSG that you wish it to render to the back
> buffer, rather than just leave it to OpenGL defaults.  Not having
> these calls causes problems when you do RTT work where the draw/read
> buffer state has to be toggled between different states.  You can
> think this of a classic uninitialized variable issue - if you don't
> set the value you can get undefined results.
> 
> If you are using native osgViewer windowing it's likely that you won't
> need to make any changes as the code in osgViewer for setting up
> various viewer configurations do the neccessary
> setDrawBuffer+setReadBuffer() calls.  If you are are creating the
> graphics context and setting up the Camera's yourself then you'll need
> to above calls.
> 
> If you are using a Pixel Buffer then you'd set the values to GL_FRONT,
> or if you are using stereo buffer then you'll won't to use
> GL_BACK_LEFT, GL_BACK_RIGHT.
> 
> Cheers,
> Robert.
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


[osg-users] Undocking WIN32 causes problems

2018-03-09 Thread Adrian Jelffs
Hello,

I am running my OSG scene in a WIN32 application. I hooked it up to the window 
using the following code and it works great. When I resize the window the scene 
resizes perfectly. However, when I undock the window from the parent form the 
OSG scenes goes black and I lose all further contact. Has anybody had any 
experience with OSG running in a windows application?

RECT rect;
HWND hHwnd = (HWND)handle;

GetWindowRect(hHwnd, );

osg::ref_ptr windata = new 
osgViewer::GraphicsWindowWin32::WindowData(hHwnd);
osg::ref_ptr traits = new 
osg::GraphicsContext::Traits;

traits->x = 0;
traits->y = 0;
traits->width = rect.right - rect.left;
traits->height = rect.bottom - rect.top;
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->inheritedWindowData = windata;

Any hints or examples would be most welcome!

Many thanks for your help!!

Adrian

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





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


[osg-users] Getting the height of a 3DS node

2018-03-09 Thread Adrian Jelffs
Hello,

I am loading a 3DS file in to my scene and I need to find out the height of the 
object. I want to place some text above the object which moves with a fixed 
offset but I don't always know the size of the object.

I am currently loading it like this:

_myNode = osgDB::readNodeFile("adrian.3ds");
 
I thought I could do something like this but hf always returns NULL.

osg::ref_ptr hf = osgDB::readHeightFieldFile("adrian.3ds");

float height = hf->getSkirtHeight();


Many thanks for your help!!

Adrian

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





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


[osg-users] osg and the latest android ndk 27

2018-03-09 Thread Trajce Nikolov NICK
Hi community,

I did this years ago and now I am on it again - osg on android. Anyone
succeeded to configure and compile osg with ndk 27? If so, what is the
cmake command?

Thanks a bunch as always

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


Re: [osg-users] Looking for FBX models to test out our FBX plugin

2018-03-09 Thread Julien Valentin
Hi Robert
I tested the two models with Software transform implementations in 
osganimationviewer and it worked quite well
-The rig only test was successfull
-The rig+morph test gives strange result : I suspect morphtarget arent yet well 
supported (no MorphGeometry outputed)
It doesn't help a lot but still it 's  a feedback..:/



robertosfield wrote:
> Hi All,
> 
> I'm currently looking to re-factor elements of the FBX plugin to make
> it more cleaner and flexible but don't have many FBX models myself to
> test things.  If you have models that you can share publically or
> privately then I'd appreciate being able to add these to my sure any
> changes I make don't cause any regressions.
> 
> For now my focus will be unifying the way that textures are read and
> setup in the OSG's FBX plugin.  I've got a small window of time in
> which to look at a few outstanding issues, so will do what I can, it
> won't be a major re-factor of the FBX plugin.
> 
> Thanks in advance for any FBX models you can share.
> 
> Cheers,
> Robert.
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] Looking for FBX models to test out our FBX plugin

2018-03-09 Thread Julien Valentin
Hi Jordi
Thanks for the advice 
but now searching animated+rig gives me some rigs with no anim...(no a real 
problem as it can be detected at preview)
The purpose of my last post was just to propose Robert a proper model for 
osganimation basics and avoid him time spend in searching

After further search i also found this one that have rigs+morph targets
https://sketchfab.com/models/60a1ff80a22a48c09833a403b5f48b73

Great stuff you did at sketchfab on osgjs



Jordi Torres wrote:
> Hi Julien,
> 
> 
> There is a search filter for animated models. Maybe it can help...
> https://sketchfab.com/search?features=downloadable+animated=fbx_by=-pertinence=models
>  
> (https://sketchfab.com/search?features=downloadable+animated=fbx_by=-pertinence=models)
> 
> 
> 
> Cheers
> 
> El El vie, 9 mar 2018 a las 23:04, Julien Valentin < ()> escribió:
> 
> 
> > Hi
> > Searching sketchfab i find out that most of the so called rigged aren't...:/
> > so Here's the two I've found and check as real animated rig (Blender 2.79 
> > import fbx work very nice with them)
> > https://sketchfab.com/models/3a09c60daf6642598724a51a29e2cf28 
> > (https://sketchfab.com/models/3a09c60daf6642598724a51a29e2cf28)
> > https://sketchfab.com/models/ab4c8506972a43d8b9649727d88a475a 
> > (https://sketchfab.com/models/ab4c8506972a43d8b9649727d88a475a)
> > These seams decent test model for osgAnimation basics features.
> > Cheers
> > 
> > 
> > 
> > robertosfield wrote:
> > 
> > > Hi All,
> > > 
> > > I'm currently looking to re-factor elements of the FBX plugin to make
> > > it more cleaner and flexible but don't have many FBX models myself to
> > > test things.  If you have models that you can share publically or
> > > privately then I'd appreciate being able to add these to my sure any
> > > changes I make don't cause any regressions.
> > > 
> > > For now my focus will be unifying the way that textures are read and
> > > setup in the OSG's FBX plugin.  I've got a small window of time in
> > > which to look at a few outstanding issues, so will do what I can, it
> > > won't be a major re-factor of the FBX plugin.
> > > 
> > > Thanks in advance for any FBX models you can share.
> > > 
> > > Cheers,
> > > Robert.
> > > ___
> > > osg-users mailing list
> > > 
> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > > 
> > >   --
> > > Post generated by Mail2Forum
> > > 
> > 
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=73060#73060 
> > (http://forum.openscenegraph.org/viewtopic.php?p=73060#73060)
> > 
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> 
> 
> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px} span.s1 {font-family: 'Helvetica'; 
> font-weight: normal; font-style: normal; font-size: 12.00pt} -- 
> Jordi Torres
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] Looking for FBX models to test out our FBX plugin

2018-03-09 Thread Jordi Torres
Hi Julien,

There is a search filter for animated models. Maybe it can help...
https://sketchfab.com/search?features=downloadable+animated=fbx_by=-pertinence=models

Cheers

El El vie, 9 mar 2018 a las 23:04, Julien Valentin <
julienvalenti...@gmail.com> escribió:

> Hi
> Searching sketchfab i find out that most of the so called rigged
> aren't...:/
> so Here's the two I've found and check as real animated rig (Blender 2.79
> import fbx work very nice with them)
> https://sketchfab.com/models/3a09c60daf6642598724a51a29e2cf28
> https://sketchfab.com/models/ab4c8506972a43d8b9649727d88a475a
> These seams decent test model for osgAnimation basics features.
> Cheers
>
>
>
> robertosfield wrote:
> > Hi All,
> >
> > I'm currently looking to re-factor elements of the FBX plugin to make
> > it more cleaner and flexible but don't have many FBX models myself to
> > test things.  If you have models that you can share publically or
> > privately then I'd appreciate being able to add these to my sure any
> > changes I make don't cause any regressions.
> >
> > For now my focus will be unifying the way that textures are read and
> > setup in the OSG's FBX plugin.  I've got a small window of time in
> > which to look at a few outstanding issues, so will do what I can, it
> > won't be a major re-factor of the FBX plugin.
> >
> > Thanks in advance for any FBX models you can share.
> >
> > Cheers,
> > Robert.
> > ___
> > osg-users mailing list
> >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >  --
> > Post generated by Mail2Forum
>
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=73060#73060
>
>
>
>
>
> ___
> 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] Looking for FBX models to test out our FBX plugin

2018-03-09 Thread Julien Valentin
Hi
Searching sketchfab i find out that most of the so called rigged aren't...:/
so Here's the two I've found and check as real animated rig (Blender 2.79 
import fbx work very nice with them)
https://sketchfab.com/models/3a09c60daf6642598724a51a29e2cf28
https://sketchfab.com/models/ab4c8506972a43d8b9649727d88a475a
These seams decent test model for osgAnimation basics features.
Cheers



robertosfield wrote:
> Hi All,
> 
> I'm currently looking to re-factor elements of the FBX plugin to make
> it more cleaner and flexible but don't have many FBX models myself to
> test things.  If you have models that you can share publically or
> privately then I'd appreciate being able to add these to my sure any
> changes I make don't cause any regressions.
> 
> For now my focus will be unifying the way that textures are read and
> setup in the OSG's FBX plugin.  I've got a small window of time in
> which to look at a few outstanding issues, so will do what I can, it
> won't be a major re-factor of the FBX plugin.
> 
> Thanks in advance for any FBX models you can share.
> 
> Cheers,
> Robert.
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] Looking for FBX models to test out our FBX plugin

2018-03-09 Thread Jordi Torres
Hey Robert,

Huge list of free downloadable models from Sketchfab :)
https://sketchfab.com/search?features=downloadable=fbx_by=-pertinence=models

Cheers.

2018-03-09 17:20 GMT+01:00 Robert Osfield :

> Hi All,
>
> I'm currently looking to re-factor elements of the FBX plugin to make
> it more cleaner and flexible but don't have many FBX models myself to
> test things.  If you have models that you can share publically or
> privately then I'd appreciate being able to add these to my sure any
> changes I make don't cause any regressions.
>
> For now my focus will be unifying the way that textures are read and
> setup in the OSG's FBX plugin.  I've got a small window of time in
> which to look at a few outstanding issues, so will do what I can, it
> won't be a major re-factor of the FBX plugin.
>
> Thanks in advance for any FBX models you can share.
>
> Cheers,
> Robert.
> ___
> 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


[osg-users] Looking for FBX models to test out our FBX plugin

2018-03-09 Thread Robert Osfield
Hi All,

I'm currently looking to re-factor elements of the FBX plugin to make
it more cleaner and flexible but don't have many FBX models myself to
test things.  If you have models that you can share publically or
privately then I'd appreciate being able to add these to my sure any
changes I make don't cause any regressions.

For now my focus will be unifying the way that textures are read and
setup in the OSG's FBX plugin.  I've got a small window of time in
which to look at a few outstanding issues, so will do what I can, it
won't be a major re-factor of the FBX plugin.

Thanks in advance for any FBX models you can share.

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