[osg-users] Issue with shadow

2016-09-15 Thread Suraj Paul
Hi All,

I have a scene in which a node is [b]moving over a terrain[/b] at a certain 
height. 
I also have a light source in the scene.
The node correctly casts shadow on the terrain. Also the parts of node like its 
limbs/appendages show shadow on the central body of the node as expected. 

However, I observe that the node shows a glittering appearance i.e the parts of 
the node looks sometimes dark and sometimes its bright as the node moves in the 
scene.
(see the attached two snapshots of the face ). The position of the light source 
is fixed.

Any clues on what could be the cause(s) of such a behavior? Anything else I 
need to set in the shadow map?
How to solve this issue?

I have only the terrain, node and a light source in the scene graph. 
... 

Thank you!

Cheers,
Suraj

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




Attachments: 
http://forum.openscenegraph.org//files/instantb_159.png
http://forum.openscenegraph.org//files/instanta_731.png


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


Re: [osg-users] Can't update my projection matrix amnually

2016-09-15 Thread Robert Osfield
On 15 September 2016 at 17:19, Bruno Oliveira
 wrote:
> I see. That means I need to manually keep updating my near/far plane.

NO.  If you want the OSG to use your projection matrices then you
simply need to switch off the automatic compute of the near/matrix as
I have already told you how to do.  That't it end of story.  I can't
help you anymore as I've already given you the answer you need you
just need to use it.  Simple.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Can't update my projection matrix amnually

2016-09-15 Thread Bruno Oliveira
I see. That means I need to manually keep updating my near/far plane.

Is there no other way?
 - Can I manually trigger a culling traversal?
 - I know the delta in z in which I am moving my camera. Can I calculate the 
new near and far planes the traversal will assign after the traversal? Example: 
newFarValue = oldFarValue + deltaZ
 - Is the near/far plane update code centralized in some public function that I 
can somehow use? If not, could you please tell me where this code is so that I 
can reproduce it?

> On 15 Sep 2016, at 17:09, Robert Osfield  wrote:
> 
> On 15 September 2016 at 16:57, Bruno Oliveira
>  wrote:
>> Hello,
>> 
>> I just verified and it is indeed related to near and far planes.
>> I am zooming my camera, and therefore, somewhere along the OSG update loops, 
>> the near and far planes will change but I don’t know what the new value is 
>> going to be.
>> 
>> I need to reproduce that in my code, as in:
>> 
 camera->setViewMatrix(getInverseMatrix());
 camera->setProjectionMatrixAsPerspective(...);
>> 
>> 
>> Can I somehow trigger the near/far plane recalculation?
> 
> You can't manually force a compute of the near/far planes, it happens
> as part of the cull traversal as this is where the OSG can determine
> what objects are in the view frustum and hence what values would be
> appropriate to clamp the near and far planes so all objects are
> visible.
> 
> If you don't want this computation simple switch it off as per my
> previous email.
> 
> Robert.
> ___
> 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] Can't update my projection matrix amnually

2016-09-15 Thread Robert Osfield
On 15 September 2016 at 16:57, Bruno Oliveira
 wrote:
> Hello,
>
> I just verified and it is indeed related to near and far planes.
> I am zooming my camera, and therefore, somewhere along the OSG update loops, 
> the near and far planes will change but I don’t know what the new value is 
> going to be.
>
> I need to reproduce that in my code, as in:
>
>>> camera->setViewMatrix(getInverseMatrix());
>>> camera->setProjectionMatrixAsPerspective(...);
>
>
> Can I somehow trigger the near/far plane recalculation?

You can't manually force a compute of the near/far planes, it happens
as part of the cull traversal as this is where the OSG can determine
what objects are in the view frustum and hence what values would be
appropriate to clamp the near and far planes so all objects are
visible.

If you don't want this computation simple switch it off as per my
previous email.

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


Re: [osg-users] Can't update my projection matrix amnually

2016-09-15 Thread Bruno Oliveira
Hello,

I just verified and it is indeed related to near and far planes.
I am zooming my camera, and therefore, somewhere along the OSG update loops, 
the near and far planes will change but I don’t know what the new value is 
going to be.

I need to reproduce that in my code, as in:

>> camera->setViewMatrix(getInverseMatrix());
>> camera->setProjectionMatrixAsPerspective(...);


Can I somehow trigger the near/far plane recalculation? 


> On 15 Sep 2016, at 16:49, Robert Osfield  wrote:
> 
> Hi Bruno,
> 
> There a few two many unknowns for us to know what is going on.  So we
> can only guess.
> 
> Could it be that the OSG's default clamping of the near/far values to
> fit with the bounds of the scene in the view frustum is what is
> adjusting the projection matrix?
> 
> Try setting the ComputeFarMode to DO_NOT_COMPUTE_NEAR_FAR via
> 
>   
> viewer.getCamera()->setComputeFarMode(osg::CullSetting::DO_NOT_COMPUTE_NEAR_FAR);
> 
> Then see what happens.
> 
> Robert.
> 
> On 15 September 2016 at 16:18, Bruno Oliveira
>  wrote:
>> Hello,
>> 
>> 
>> I am trying to set my view and projection camera matrix. I do this inside a
>> custom camera manipulator code I am building.
>> 
>> I set the camera view matrix as
>> 
>> camera->setViewMatrix(getInverseMatrix());
>> 
>> After this, since I am using a perspective projection matrix, I know I need
>> to update my projection matrix. I try to do this with
>> 
>> camera->setProjectionMatrixAsPerspective(30.f, aspectRatio, 0.5f, 500.f);
>> 
>> This results in the following projection matrix,
>> 
>>2.69691 0 0 0
>> 
>>0 3.73205 0 0
>> 
>>0 0 -1.002 -1
>> 
>>0 0 -1.001 0
>> 
>> 
>> However this is wrong, my matrix should be something similar to
>> 
>>2.69691 0 0 0
>> 
>>0 3.73205 0 0
>> 
>>0 0 -50 -1
>> 
>>0 0 -1.01309e+06 0
>> 
>> 
>> What am I doing wrong? What else do I need to correctly compute the
>> projection matrix?
>> 
>> ___
>> 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] Can't update my projection matrix amnually

2016-09-15 Thread Robert Osfield
Hi Bruno,

There a few two many unknowns for us to know what is going on.  So we
can only guess.

Could it be that the OSG's default clamping of the near/far values to
fit with the bounds of the scene in the view frustum is what is
adjusting the projection matrix?

Try setting the ComputeFarMode to DO_NOT_COMPUTE_NEAR_FAR via

   
viewer.getCamera()->setComputeFarMode(osg::CullSetting::DO_NOT_COMPUTE_NEAR_FAR);

Then see what happens.

Robert.

On 15 September 2016 at 16:18, Bruno Oliveira
 wrote:
> Hello,
>
>
> I am trying to set my view and projection camera matrix. I do this inside a
> custom camera manipulator code I am building.
>
> I set the camera view matrix as
>
> camera->setViewMatrix(getInverseMatrix());
>
> After this, since I am using a perspective projection matrix, I know I need
> to update my projection matrix. I try to do this with
>
> camera->setProjectionMatrixAsPerspective(30.f, aspectRatio, 0.5f, 500.f);
>
> This results in the following projection matrix,
>
> 2.69691 0 0 0
>
> 0 3.73205 0 0
>
> 0 0 -1.002 -1
>
> 0 0 -1.001 0
>
>
> However this is wrong, my matrix should be something similar to
>
> 2.69691 0 0 0
>
> 0 3.73205 0 0
>
> 0 0 -50 -1
>
> 0 0 -1.01309e+06 0
>
>
> What am I doing wrong? What else do I need to correctly compute the
> projection matrix?
>
> ___
> 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] Can't update my projection matrix amnually

2016-09-15 Thread Bruno Oliveira
Hello,


I am trying to set my view and projection camera matrix. I do this inside a
custom camera manipulator code I am building.

I set the camera view matrix as

camera->setViewMatrix(getInverseMatrix());

After this, since I am using a perspective projection matrix, I know I need
to update my projection matrix. I try to do this with

camera->setProjectionMatrixAsPerspective(30.f, aspectRatio, 0.5f, 500.f);

This results in the following projection matrix,

2.69691 0 0 0

0 3.73205 0 0

0 0 -1.002 -1

0 0 -1.001 0

However this is wrong, my matrix should be something similar to

2.69691 0 0 0

0 3.73205 0 0

0 0 -50 -1

0 0 -1.01309e+06 0


What am I doing wrong? What else do I need to correctly compute the
projection matrix?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Feedback/guidance sought on move of osgQt out into it's own project/repository

2016-09-15 Thread tom spencer
Hi,

Here is my attempt to help. Here is a command that I have put together that 
seems to be accomplishing the task. from 14240 commits to 1204.


Code:
git filter-branch \
--prune-empty \
--index-filter '
git ls-tree -z -r --name-only --full-tree $GIT_COMMIT \
| grep -z -v "^AUTHORS.txt" \
| grep -z -v "^ChangeLog" \
| grep -z -v "^CMakeLists.txt" \
| grep -z -v "^CTestConfig.cmake" \
| grep -z -v "^LICENSE.txt" \
| grep -z -v "^NEWS.txt" \
| grep -z -v "^README.md" \
| grep -z -v "^CMakeModules/cmake_uninstall.cmake.in" \
| grep -z -v "^CMakeModules/ListHandle.cmake" \
| grep -z -v "^CMakeModules/ModuleInstall.cmake" \
| grep -z -v "^CMakeModules/OsgCPack.cmake" \
| grep -z -v "^CMakeModules/OsgCPackConfig.cmake.in" \
| grep -z -v "^CMakeModules/OsgDetermineCompiler.cmake" \
| grep -z -v "^CMakeModules/OsgMacroUtils.cmake" \
| grep -z -v "^CMakeModules/UtilityMacros.cmake" \
| grep -z -v "^doc/Doxyfiles/all_Doxyfile" \
| grep -z -v "^doc/Doxyfiles/auto_Doxyfile" \
| grep -z -v "^doc/Doxyfiles/auto_Mainpage" \
| grep -z -v "^doc/Doxyfiles/core_Doxyfile" \
| grep -z -v "^doc/Doxyfiles/custom_Footer.html" \
| grep -z -v "^doc/Doxyfiles/doxyfile.cmake" \
| grep -z -v "^examples/CMakeLists.txt" \
| grep -z -v "^examples/osgqfont" \
| grep -z -v "^examples/osgQtBrowser" \
| grep -z -v "^examples/osgQtWidgets" \
| grep -z -v "^examples/osgviewerQt" \
| grep -z -v "^include/osgQt" \
| grep -z -v "^packaging/pkgconfig/openscenegraph-osgQt.pc.in" \
| grep -z -v "^PlatformSpecifics" \
| grep -z -v "^src/CMakeLists.txt" \
| grep -z -v "^src/osgQt" \
| grep -z -v "^src/osgPlugins/CMakeLists.txt" \
| grep -z -v "^src/osgPlugins/qfont" \
| xargs -0 -r git rm --cached -r
' \
-- \
--all



I ran this with the HEAD reset back to '489860f Updated version number to 
3.5.5' and used Roberts cleanup commit as a reference. I pushed the results to 
'github blobfish osgQtCleaned01'. If you want to try this command, note that it 
works on all branches in the repo. You might want to clone a copy of your repo 
to experiment with. Keeping only relevant history on individual files (like 
CMakeLists.txt) will be more problematic.


Thank you!

Cheers,
tom[/code]

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





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


Re: [osg-users] Please send me GEOS static and dynamic libraries based on 64bit Windows

2016-09-15 Thread Fernando Theirs
Hi everyone,
I'm new in the forum and I found OSG because I'm looking for GEOS library for 
Android. I don't understand if GEOS is or isn't a dependency because I could 
find it in download-section/dependencies, the 3er Party libraries link is 
broken :/

My question is: has someone the GEOS library compiled for Android armeabi v7 
and can share it with me?



Thank you!

Cheers,
Fernando

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





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


[osg-users] Perspective Projection updateCamera does not work anymore

2016-09-15 Thread Bruno Oliveira
Hello,



I have a scene and I am using a Perspective Projection. I was using a Ortho
projection before.

Now, I am creating a new camera manipulator, in which I need to update the
camera zoom, and update the camera in that precise moment, in order to
check my scene for intersections of a ray from the mouse (in a way similar
to setCenterByMousePointerIntersection) . In Ortho mode, I used

camera->setViewMatrix(getInverseMatrix());

But this does not work in Perspective projection mode?
I get successful scene intersections before I set the Camera's view matrix,
but after that line of code, intersecting
Is this the problem?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: invalid use of incomplete type ‘std::ifstream in readNodeFile

2016-09-15 Thread kyungsoo hong
Hi Mike 

I'm using it on Linux not Windows but thank you anyway!

... 

Thank you!

Cheers,
kyungsoo

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





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