Re: [osg-users] HowTo use UPDATE_TO_VERSION for custom osg::Object separate from osgVersion()

2013-04-18 Thread Peter Bako
Hello Wang.

Recently, I downloaded osg version 3.1.5 and I found out, that my 
UPDATE_TO_USER_VERSION macros don't work anymore. I digged into the osg source 
and found out that it is not there anymore, so I searched the forum but I 
didn't find any reason why was it removed.

I used osg 3.1.1 before. I don't want to force you, I just want to ask, why was 
it removed if it was already there once?

Thank you!

Cheers,
Peter

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





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


[osg-users] Testing call for experimental stereo support

2013-04-18 Thread Robert Osfield
Hi All,

I am currently working on moving stereo support from the low level
SceneView class up into the osgViewer library, the initial step for this
work has been to use the new osgkeystone example as the testbed for
creating the required viewer slave Camera's and configuration them to
handle the various types of stereo that the OSG supports via SceneView.  I
only have a pair of Anaglyphic classes here so can only directly test this
option, so need members of the community with the available hardware to
test the code I've written and report back success/failure/fixes.

To test you'll need the svn/trunk version of the OSG, if you need a dev
release I can tag one today, just let me know.  You'll need to compile the
OSG with examples enabled as my testbed osgkeystone is amongst the
examples.  Once you have everything built you can test things out via one
or more of the following:

osgkeystone cow.osg --stereo ANAGLYPHIC
osgkeystone cow.osg --stereo QUAD_BUFFER
osgkeystone cow.osg --stereo HORIZONTAL_SPLIT
osgkeystone cow.osg --stereo VERTICAL_SPLIT
osgkeystone cow.osg --stereo HORIZONTAL_INTERLACE
osgkeystone cow.osg --stereo VERTICAL_INTERLACE
osgkeystone cow.osg --stereo CHECKERBOARD

I have been able to run all of these options except the QUAD_BUFFER as my
OpenGL driver doesn't support quad buffer stereo, but as I don't have the
required hardware to test the options beyond ANAGLYPHIC I'm rather stuck in
knowing whether they are working correctly - I can run the options and they
run and behaves in a plausible way, but there is no way for me to know for
certain that everything is working fine.

I recall a long while back that the interlaced options were sensitive to
the viewport/window being moved resulting in the eyes getting swapped.
With the new code we should be able to add a small bit of code to
automatically odd/even positioning of the corner of the window+viewport and
they swap the eyes to avoid this glitch.  Again I can guess what the code
might be and write it but won't have any way of testing for it.

The final bit of the jigsaw is that if you want perfect aspect ratios and
fov set up the use the env vars OSG_SCREEN_HEIGHT, OSG_SCREEN_WIDTH and
OSG_SCREEN_DISTANCE to configure the stereo camera setup to perfectly fit
your display.

If there are other stereo options that you'd like to add to the mix then
have a look at the code in the osgkeystone.cpp and have a bash at adding
it, or just chip into this thread about how we might go about adding
support and getting it tested.

Another thing that could be open for discussion is alternative code paths
for OpenGL ES support - such as stencil buffer support or polygon stipple
that is currently used for the interlaced stereo approaches.

And... another area that we could look at is support for toggling on/off
stereo support, some apps will require this, let us know your usage model
so we can discuss how to best provide the ability.

Thanks in advance for your help,
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 build OpenSceneGraph for Android in Windows

2013-04-18 Thread Francesco Argese

S2LR wrote:
 
 [...]
  I'm getting the following error when I run the make...
 
 Android NDK: Parsing Application.mk
 Android NDK:   APP_PIE is
 C:/AndroidDevelopment/android-ndk-r8e/build/gmsl/__gmsl:512: *** non-numeric 
 second argument to `wordlist' function: ''.  Stop.
 make[2]: *** [Android-OpenSceneGraph] Error 2
 make[1]: *** [CMakeFiles/ndk.dir/all] Error 2
 make: *** [all] Error 2
 
 Any idea on what this error is referring to?
 [...]
 
 


With r8c the procedure gives the same error while with 
android-ndk-r8b-windows.zip compilation starts. That ndk can be found at the 
following link:
https://dl.google.com/android/ndk/android-ndk-r8b-windows.zip

Francesco

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





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


[osg-users] [ANN] GullsEye

2013-04-18 Thread Can T. Oguz
Hello Dear OSG-community,

Happy to announce GullsEye - our 3D Port Visualization System built on 
OpenSceneGraph.

Intro video at:

http://youtu.be/y1ANByGUNqc (HD required)

Best regards,

Can Oguz
Systems Analyst / SoftTech

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





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


Re: [osg-users] How to build OpenSceneGraph for Android in Windows

2013-04-18 Thread Trajce Nikolov NICK
Hi Francesco,

this top was discussed heavely last week (look for osgAndroidExample in the
archive). Here is a fix for that error - you have to edit a file

http://stackoverflow.com/questions/10285242/openssl-using-androids-ndk-problems/10295653#10295653


Cheers,
Nick


On Thu, Apr 18, 2013 at 12:14 PM, Francesco Argese kekk...@gmail.comwrote:


 S2LR wrote:
 
  [...]
   I'm getting the following error when I run the make...
 
  Android NDK: Parsing Application.mk
  Android NDK:   APP_PIE is
  C:/AndroidDevelopment/android-ndk-r8e/build/gmsl/__gmsl:512: ***
 non-numeric second argument to `wordlist' function: ''.  Stop.
  make[2]: *** [Android-OpenSceneGraph] Error 2
  make[1]: *** [CMakeFiles/ndk.dir/all] Error 2
  make: *** [all] Error 2
 
  Any idea on what this error is referring to?
  [...]
 
 


 With r8c the procedure gives the same error while with
 android-ndk-r8b-windows.zip compilation starts. That ndk can be found at
 the following link:
 https://dl.google.com/android/ndk/android-ndk-r8b-windows.zip

 Francesco

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





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




-- 
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] [ANN] GullsEye

2013-04-18 Thread Trajce Nikolov NICK
Very cool ! You might want to think of integrating Triton for your app for
the ocean

Nick


On Thu, Apr 18, 2013 at 12:39 PM, Can T. Oguz cto...@gmail.com wrote:

 Hello Dear OSG-community,

 Happy to announce GullsEye - our 3D Port Visualization System built on
 OpenSceneGraph.

 Intro video at:

 http://youtu.be/y1ANByGUNqc (HD required)

 Best regards,

 Can Oguz
 Systems Analyst / SoftTech

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





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




-- 
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] [ANN] GullsEye

2013-04-18 Thread Can T. Oguz
Thanks,

Sure it needs something for the ocean. it's in the todo list.

Can

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





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


[osg-users] Height of the terrain on a given lang/long

2013-04-18 Thread Zeki Yugnak
Hi everyone,

I am trying to calculate height value of the terrain on a given latitude and 
longitude. I am using a ive formatted terrain model that was converted using 
osgDem from Dted level-1 data. I searched a solution on whole osg forum and web 
but i could not find good one. Also I looked HeightAboveTerrain class and 
osgintersection sample but these class does not work only given a latitude and 
longitude values. 

I can get height on terrain with following code block,  is it a good solution?


Code:

osg::PagedLOD* pLod = 
dynamic_castosg::PagedLOD*(coordinateSystemNode-getChild(0));
osgTerrain::TerrainTile* pTopTile = 
dynamic_castosgTerrain::TerrainTile*(pLod-getChild(0));
osgTerrain::HeightFieldLayer* pLayer = 
dynamic_castosgTerrain::HeightFieldLayer*(pTopTile-getElevationLayer());

pLayer-getInterpolatedValidValue( osg::DegreesToRadians(langVal), 
osg::DegreesToRadians(longVal), height );




Cheers,

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





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


Re: [osg-users] Height of the terrain on a given lang/long

2013-04-18 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
The methods provided in osgSim work for geocentric databases. Is your
terrain built as a geocentric database?

If so, you can get the HAT/HOT with this...

earth-convertLatLongHeightToXYZ(osg::DegreesToRadians(lat),
osg::DegreesToRadians(lon), alt, X,Y,Z);
hat =
osgSim::HeightAboveTerrain::computeHeightAboveTerrain(terrain.get(),
osg::Vec3d(X,Y,Z));

If you're a flat earth with lat/lon only, then what you've got is
probably fine...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Zeki
Yugnak
Sent: Thursday, April 18, 2013 7:15 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Height of the terrain on a given lang/long

Hi everyone,

I am trying to calculate height value of the terrain on a given latitude
and longitude. I am using a ive formatted terrain model that was
converted using osgDem from Dted level-1 data. I searched a solution on
whole osg forum and web but i could not find good one. Also I looked
HeightAboveTerrain class and osgintersection sample but these class does
not work only given a latitude and longitude values. 

I can get height on terrain with following code block,  is it a good
solution?


Code:

osg::PagedLOD* pLod =
dynamic_castosg::PagedLOD*(coordinateSystemNode-getChild(0));
osgTerrain::TerrainTile* pTopTile =
dynamic_castosgTerrain::TerrainTile*(pLod-getChild(0));
osgTerrain::HeightFieldLayer* pLayer =
dynamic_castosgTerrain::HeightFieldLayer*(pTopTile-getElevationLayer(
));

pLayer-getInterpolatedValidValue( osg::DegreesToRadians(langVal),
osg::DegreesToRadians(longVal), height );




Cheers,

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





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


Re: [osg-users] Height of the terrain on a given lang/long

2013-04-18 Thread Robert Osfield
Hi Zeki,


On 18 April 2013 16:05, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
shayne.tuel...@hill.af.mil wrote:

 The methods provided in osgSim work for geocentric databases. Is your
 terrain built as a geocentric database?

 If so, you can get the HAT/HOT with this...

 earth-convertLatLongHeightToXYZ(osg::DegreesToRadians(lat),
 osg::DegreesToRadians(lon), alt, X,Y,Z);
 hat =


The missing bit of information here is that a geocentric database created
by VPB will be decorated by a osgTerrain::Terrain node that is subclassed
from osg::CoordindateSystemNode that provide the osg::EllipsoidModel that
has the covertLatLongHeightToXYZ method.

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


Re: [osg-users] reading dem/image files...

2013-04-18 Thread Shayne Tueller
Just a followup post to my original inquiry...

After appending the .gdal to my .dt1 files to get the 
readHeightFieldFile() to read the DTED file format, I also had to do the 
following to get the DTED to render correctly...

osg::HeightField *grid = osgDB::readHeightFieldFile(n41.dt1.gdal);
grid-setOrigin(osg::Vec3(0.0, 0.0, 0.0));
xsize = (radius * osg::PI * grid-getXInterval()) / 180.0;
ysize = (radius * osg::PI * grid-getYInterval()) / 180.0;
grid-setXInterval(xsize);
grid-setYInterval(ysize);

where radius is the mean radius of the Earth in meters.

Hopefully this help someone who wants to do simple display of raw DTED data 
(i.e. *.dt1 files) using the default osg viewer...

-Shayne

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





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


[osg-users] Need help with switching between manual and automatic camera movement

2013-04-18 Thread Martin Záleta
Hi,

In my OSG application, I am trying to implement a functionality, that would 
allow me to switch between usual manual movement and an automatic one (such as 
spinning on spot), but I haven't had any success yet.

My last attempt was to set an update callback to the camera, that would spin it 
around, such as this:


Code:
void CameraCallback::operator()(Node* node, NodeVisitor* nv)
{
Camera * cam = static_castCamera *(node);

if(cam  Settings::Instantiate()-getCameraMode() == CAMERA_ROTATE)
{
Matrixd oldMatrix = cam-getViewMatrix();

Matrixd cameraRotation;
cameraRotation.makeRotate(oldMatrix.getRotate());
cameraRotation.rotate(DegreesToRadians(5.0), 0, 0, 1);

Matrixd cameraTrans;
cameraTrans.makeTranslate(oldMatrix.getTrans());

Matrixd newMatrix = cameraRotation * cameraTrans;
cam-setViewMatrix(newMatrix);
}

traverse(node, nv);
}



... and then I had the viewer object registered by the class that handles 
keyboard events and tried to update it accordingly:


Code:
void registerViewer(Viewer* v)  { viewer = v; man = 
viewer-getCameraManipulator(); }

bool KeyboardEventHandler::handle(const GUIEventAdapter ea, GUIActionAdapter 
aa)
{
...
case 'n':
case 'N':
Settings::Instantiate()-ToggleCamera();

if(Settings::Instantiate()-getCameraMode() == CAMERA_MANUAL)
{
viewer-setCameraManipulator(man);
viewer-getCamera()-setAllowEventFocus(true);
}
else
{
viewer-setCameraManipulator(NULL);
viewer-getCamera()-setAllowEventFocus(false);
}

break;
...
}



Hopefully these snippets are enough for someone to explain me, what I am doing 
wrong and how to do it the right way.

Thank you!

Cheers,
Martin

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





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


Re: [osg-users] Need help with switching between manual and automatic camera movement

2013-04-18 Thread Trajce Nikolov NICK
Hi Martin,

what are you experiencing, where you see the problems? It is sort of not
stated in your email. in your first code snipped in the update I would do
this to have the matrices in the world space:

Matrixd oldMatrix = cam-getInverseViewMatrix();

.
.
 cam-setViewMatrix(osg::Matrixd::inverse(newMatrix));


This should setup your matrices correctly. Also once the matrixes are in
world space then you can easelly transition from automatic to manual state
by setting the camera manipulator by matrix. I think when you add and
remove camera manipulators, it goes to your home position of the
manipulator (see CameraManipulator::setHomePosition), so you have to take
into account this as well. If you want to spin it around between two
rotations try using quaternions (from the matrix, it is getRotate()) and
slerp (quaternion method) between two different orientation. These above is
just guessing since you havn't stated your problem. Maybe the best would be
if you put your whole code into sample and post it here, someone might have
time to look and help

Nick


On Thu, Apr 18, 2013 at 6:53 PM, Martin Záleta zal...@atlas.sk wrote:

 Hi,

 In my OSG application, I am trying to implement a functionality, that
 would allow me to switch between usual manual movement and an automatic one
 (such as spinning on spot), but I haven't had any success yet.

 My last attempt was to set an update callback to the camera, that would
 spin it around, such as this:


 Code:
 void CameraCallback::operator()(Node* node, NodeVisitor* nv)
 {
 Camera * cam = static_castCamera *(node);

 if(cam  Settings::Instantiate()-getCameraMode() ==
 CAMERA_ROTATE)
 {
 Matrixd oldMatrix = cam-getViewMatrix();

 Matrixd cameraRotation;
 cameraRotation.makeRotate(oldMatrix.getRotate());
 cameraRotation.rotate(DegreesToRadians(5.0), 0, 0, 1);

 Matrixd cameraTrans;
 cameraTrans.makeTranslate(oldMatrix.getTrans());

 Matrixd newMatrix = cameraRotation * cameraTrans;
 cam-setViewMatrix(newMatrix);
 }

 traverse(node, nv);
 }



 ... and then I had the viewer object registered by the class that handles
 keyboard events and tried to update it accordingly:


 Code:
 void registerViewer(Viewer* v)  { viewer = v; man =
 viewer-getCameraManipulator(); }

 bool KeyboardEventHandler::handle(const GUIEventAdapter ea,
 GUIActionAdapter aa)
 {
 ...
 case 'n':
 case 'N':
 Settings::Instantiate()-ToggleCamera();

 if(Settings::Instantiate()-getCameraMode() == CAMERA_MANUAL)
 {
 viewer-setCameraManipulator(man);
 viewer-getCamera()-setAllowEventFocus(true);
 }
 else
 {
 viewer-setCameraManipulator(NULL);
 viewer-getCamera()-setAllowEventFocus(false);
 }

 break;
 ...
 }



 Hopefully these snippets are enough for someone to explain me, what I am
 doing wrong and how to do it the right way.

 Thank you!

 Cheers,
 Martin

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





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




-- 
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] Need help with switching between manual and automatic camera movement

2013-04-18 Thread Martin Záleta
Hi,

I guess I kinda forgot to describe my problem in detail. In part it was because 
I was hoping, that someone would suggest me a better solution to this problem, 
since registering viewer handle in a keyboard event handler doesn't really seem 
to me like much of a good solution, but it was the best I could come up with.

Anyway, what you wrote has helped me resolve the issue I had, so at least it's 
working somehow.

Thank you!

Cheers,
Martin

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





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


Re: [osg-users] Height of the terrain on a given lang/long

2013-04-18 Thread Zeki Yugnak
Thank you for your answers.

Yes, I am using geocentric database. My input values are only latitude and 
longitude. I don't have altitude information. So result of the 
computeHeightAboveTerrain function conversion is not enough for 
computeHeightAboveTerrain. I need to find terrain elevation only with latitude 
and longitude inputs.

Rergards,

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





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


Re: [osg-users] Height of the terrain on a given lang/long

2013-04-18 Thread Shayne Tueller
If you want HOT (height of terrain) for a particular lat/lon, use the same code 
as above and do the following...


Code:

maxElevationInDatabase = 3962.0; // meters
earth-convertLatLongHeightToXYZ(osg::DegreesToRadians(lat), 
osg::DegreesToRadians(lon), maxElevationInDatabase, X,Y,Z);
hat = osgSim::HeightAboveTerrain::computeHeightAboveTerrain(terrain.get(), 
osg::Vec3d(X,Y,Z));
hot = maxElevationInDatabase - hat;




The caveat is that you need the maximum height in your database (Mt Everest 
perhaps?)

-Shayne

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





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