[osg-users] [osgPlugins] DXF-Plugin SmoothingVisitor

2009-04-14 Thread Michael Hasler
Hi,

Im Using the OsgDXFPlugin to read DXF Files, i searched for an solution
to add more normals for better smoothing, and found the SmoothingVisitor. 

I applied it in the scene.h (osgdxfplugin) under the function createTriGeometry 
and createQuadGeometry osgUtil::SmoothingVisitor::smooth(*geom) and works fine.

But now i need to include the hole osgdfxplugin in my application 
how can i apply the smooth after the readNodeFile Operation ? 
So i would not need to include the hole dxfplugin and execeute
the smooth after the read out on the resulting Node.


Thank you.

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





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


[osg-users] [build] Postbuild error with ot11-OpenThreads??

2009-04-14 Thread John Montgomery
Hello All,

I am trying to compile the plain vanilla OSG with MSVC++ 9 (2008) on Vista 
(Home)
It all appears to compile fine until I build 'INSTALL', then I get the 
following output, and the Installer halts without having installed the files:

-- Build started: Project: INSTALL, Configuration: Release Win32 --
1 
1Performing Post-Build Event...
1-- Install configuration: Release
1-- Up-to-date: C:/Program Files/OpenSceneGraph/lib/pkgconfig/openscenegraph.pc
1-- Up-to-date: C:/Program Files/OpenSceneGraph/lib/pkgconfig/openthreads.pc
1-- Up-to-date: C:/Program Files/OpenSceneGraph/lib/OpenThreads.lib
1-- Installing: C:/Program Files/OpenSceneGraph/bin/ot11-OpenThreads.dll
1CMake Error at src/OpenThreads/win32/cmake_install.cmake:50 (FILE):
1  file INSTALL cannot copy file
1  D:/OSG/OpenSceneGraph/build/bin/Release/../../bin/ot11-OpenThreads.dll to
1  C:/Program Files/OpenSceneGraph/bin/ot11-OpenThreads.dll.
1Call Stack (most recent call first):
1  src/OpenThreads/cmake_install.cmake:36 (INCLUDE)
1  src/cmake_install.cmake:32 (INCLUDE)
1  cmake_install.cmake:36 (INCLUDE)
1Project : error PRJ0019: A tool returned an error code from Performing 
Post-Build Event...
1Build log was saved at 
file://d:\OSG\OpenSceneGraph\build\INSTALL.dir\Release\BuildLog.htm
1INSTALL - 1 error(s), 0 warning(s)
== Build: 0 succeeded, 1 failed, 195 up-to-date, 0 skipped ==

The file D:/OSG/OpenSceneGraph/build/bin/Release/../../bin/ot11-OpenThreads.dll 
exists in the path
D:\OSG\OpenSceneGraph\build\bin

...the convoluted path is theoretically pointing to the correct location.
( I have UAC swtiched on still - would that become an issue? )

Can anyone point me in the right direction for fixing this please?  I have 
searched for similar problems, but either get None or 1000+ off topic results.

Thanks.


8)
John Montgomery, Glassel, Scotland.

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





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


[osg-users] Camera control like in Google Earth - how to do that?

2009-04-14 Thread Christian Buchner
Hi everybody.

So far my 3D simulation and visualization uses the trackball
manipulator for controlling the camera.

Is there anything built into OpenSceneGraph that mimicks the way that
one can control the camera
in Google Earth?

Has anyone succeeded building such type of camera control with OpenSceneGraph?

Would anyone know about any patent issues with the way Google do it?

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


Re: [osg-users] [build] Postbuild error with ot11-OpenThreads??

2009-04-14 Thread John Montgomery
Hah! Thanks Ismail, That was the problem.

1INSTALL - 0 error(s), 0 warning(s)
== Build: 1 succeeded, 0 failed, 195 up-to-date, 0 skipped ==

I'm a happy bunny  :D


8)
John Montgomery, Glassel, Scotland.

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





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


Re: [osg-users] Is it possible to redrirct all readimage call to a customed method

2009-04-14 Thread Roger
Thanks,

Problem has been solved, and for others reference, code clue listed below:

class FileReadOnceCallback : public osgDB::Registry::ReadFileCallback
{
private:
typedef mapstring,osg::ref_ptrosg::Object PathPointerMap;
PathPointerMap pathpointermap;

public:

virtual osgDB::ReaderWriter::ReadResult readImage(const std::string 
filename, const osgDB::ReaderWriter::Options* options)
{
PathPointerMap::iterator itr=pathpointermap.find(filename);
if (itr==pathpointermap.end()) //没有找到,读取文件
{
osgDB::ReaderWriter::ReadResult result;

result=osgDB::Registry::instance()-readImageImplementation(filename,options);
osg::ref_ptrosg::Image refobj=result.getImage();
if (result.validImage()) 
pathpointermap[filename]=refobj; //将资源以ref_ptr形式记入map
return result;
}
else //找到,直接返回存贮的指针
{
osgDB::ReaderWriter::ReadResult 
result(itr-second.get(),osgDB::ReaderWriter::ReadResult::FILE_LOADED);
return itr-second.get();
}
}

~FileReadOnceCallback(){std::coutDestruct FileReadOnce CallBack.;}

};

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





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


[osg-users] Drawable optimization

2009-04-14 Thread Harold Comere
Hi all,

I am currently working on a kind of drawable optimizer.
My goal is to make primitive set groups and have only one drawable per group. ( 
grouping vertexs linked by any face of the group )
The effect will be to avoid to have separated objects in a same drawable.
In same way, i want to merge small drawables containing only few faces but are 
in the same object.
I have a node visitor wich will do this for all drawable in each geode.

When i look at primitive set types generated by any importer, i notice that 
sometimes it is drawArrays, and other times drawElements.
So my question is if there is any osg optimisation wich choose between 
drawArrays or drawElements alone ? drawElements is usually faster than 
drawArray calls, so i wonder if i can convert everything in drawElements type 
without lose fps ..

Another question, osg doesnt seem to use VBOs by default, is there any reason ?

thank you for your attention.
Regards,
Harold

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





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


Re: [osg-users] Initial cut at CMake support + branch of osgEphemeris

2009-04-14 Thread Philip Lowman
On Fri, Apr 10, 2009 at 11:33 AM, Robert Osfield
robert.osfi...@gmail.comwrote:

 Which goes pretty sweetly till it tries to link the plugin.  These are the
 errors I get:

 [ 86%] Building CXX object
 src/osgEphemeris/CMakeFiles/osgEphemeris.dir/StarField.o
 [ 93%] Building CXX object
 src/osgEphemeris/CMakeFiles/osgEphemeris.dir/sun_image.o
 Linking CXX shared library ../../lib/libosgEphemeris.so
 [ 93%] Built target osgEphemeris
 Scanning dependencies of target osgdb_osgephemeris
 [100%] Building CXX object
 src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/IO_EphemerisModel.o
 Linking CXX shared module /osgPlugins-2.9.2/osgdb_osgephemeris.so
 /usr/bin/ld: cannot open output file
 /osgPlugins-2.9.2/osgdb_osgephemeris.so: No such file or directory
 collect2: ld returned 1 exit status
 make[2]: *** [/osgPlugins-2.9.2/osgdb_osgephemeris.so] Error 1
 make[1]: ***
 [src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/all] Error 2


Hmm, server appears down for me so I can't have a look at this right now.
I'm guessing that the problem has something to do with setting the PREFIX
target property which I think is what OSG uses to force the plugins into an
osgPlugins-x.y.z folder?

Could you add the following after the declaration of
add_library(osgephemeris MODULE...)

message(CMAKE_LIBRARY_PATH = ${CMAKE_LIBRARY_PATH})
message(CMAKE_LIBRARY_OUTPUT_DIRECTORY =
${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
get_target_properties(the_prefix osgephemeris PREFIX)
message(the prefix is = ${the_prefix})

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


Re: [osg-users] simple water shader?

2009-04-14 Thread Serge Lages
Hi Martin,

I've made some time ago a simple water shader based on this article :

http://www.bonzaisoftware.com/wfs.html

It seems to directly provide a GLSL shader now.
Good luck !

On Tue, Apr 14, 2009 at 1:50 PM, Martin Scheffler osgfo...@tevs.eu wrote:

 Hi,

 For my project I need indoor water for puddles.
 Because I don't have much time to spend on this I would like your advice on
 how to do this the fastest way.

 I don't need scene reflections or even transparent water, a glossy animated
 normal map would be good enough for me.

 * Is there pre-existing stuff out there that I can use?
 * If not, how would I go at creating a shader for this? Is it necessary to
 have multiple normal maps or does it suffice to combine some sine functions
 to deform the local normal?

 Thank you.

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





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




-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] simple water shader?

2009-04-14 Thread Martin Scheffler
Hi,

For my project I need indoor water for puddles.
Because I don't have much time to spend on this I would like your advice on how 
to do this the fastest way.

I don't need scene reflections or even transparent water, a glossy animated 
normal map would be good enough for me. 

* Is there pre-existing stuff out there that I can use?
* If not, how would I go at creating a shader for this? Is it necessary to have 
multiple normal maps or does it suffice to combine some sine functions to 
deform the local normal?

Thank you.

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





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


Re: [osg-users] [build] Postbuild error with ot11-OpenThreads??

2009-04-14 Thread Ismail Pazarbasi
Hi John,

could it be a permission problem? Can you see other files written into
that folder? On Vista, one may need adminisrative priviliges to write
into program files folder.

You may try to run Visual C++ as Administrator. I am using Vista
Business with VC9 on my secondary laptop as well, but never tried to
*install* osg!

HTH
Ismail

On Tue, Apr 14, 2009 at 11:43 AM, John Montgomery
j.t.montgom...@abdn.ac.uk wrote:
 Hello All,

 I am trying to compile the plain vanilla OSG with MSVC++ 9 (2008) on Vista 
 (Home)
 It all appears to compile fine until I build 'INSTALL', then I get the 
 following output, and the Installer halts without having installed the files:

-- Build started: Project: INSTALL, Configuration: Release Win32 --
 1
 1Performing Post-Build Event...
 1-- Install configuration: Release
 1-- Up-to-date: C:/Program 
 Files/OpenSceneGraph/lib/pkgconfig/openscenegraph.pc
 1-- Up-to-date: C:/Program Files/OpenSceneGraph/lib/pkgconfig/openthreads.pc
 1-- Up-to-date: C:/Program Files/OpenSceneGraph/lib/OpenThreads.lib
 1-- Installing: C:/Program Files/OpenSceneGraph/bin/ot11-OpenThreads.dll
 1CMake Error at src/OpenThreads/win32/cmake_install.cmake:50 (FILE):
 1  file INSTALL cannot copy file
 1  D:/OSG/OpenSceneGraph/build/bin/Release/../../bin/ot11-OpenThreads.dll 
 to
 1  C:/Program Files/OpenSceneGraph/bin/ot11-OpenThreads.dll.
 1Call Stack (most recent call first):
 1  src/OpenThreads/cmake_install.cmake:36 (INCLUDE)
 1  src/cmake_install.cmake:32 (INCLUDE)
 1  cmake_install.cmake:36 (INCLUDE)
 1Project : error PRJ0019: A tool returned an error code from Performing 
 Post-Build Event...
 1Build log was saved at 
 file://d:\OSG\OpenSceneGraph\build\INSTALL.dir\Release\BuildLog.htm
 1INSTALL - 1 error(s), 0 warning(s)
 == Build: 0 succeeded, 1 failed, 195 up-to-date, 0 skipped ==

 The file 
 D:/OSG/OpenSceneGraph/build/bin/Release/../../bin/ot11-OpenThreads.dll
 exists in the path
 D:\OSG\OpenSceneGraph\build\bin

 ...the convoluted path is theoretically pointing to the correct location.
 ( I have UAC swtiched on still - would that become an issue? )

 Can anyone point me in the right direction for fixing this please?  I have 
 searched for similar problems, but either get None or 1000+ off topic results.

 Thanks.

 
 8)
 John Montgomery, Glassel, Scotland.

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





 ___
 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] Problem of points showing

2009-04-14 Thread Ismail Pazarbasi
Hi Lingyun,

std::bad_alloc is thrown when operator new cannot allocate memory,
which indicates there is not enough memory. You may reserve your array
before hand, as Paul mentioned, but it may throw as well. This could
reduce, if nothing, copy operations. It may also prevent exception,
because when expanding, std::vector will have two large copies at the
same time. That is:
e.g. old array length was 150
expand by 50
While allocating 200 elements, previous 150 elements will also
be alive/allocated, that requires room for 350 elements in total.
Resize may reduce this cost to 200 only, because vector will not
have to expand afterwards (i.e. during push_back), which requires a
copy operation. Note that C++ standard allocator doesn't do realloc().
Instead, vector will allocate a block of  N * sizeof(T) items (or
little more), copy existing block into new one, then free existing
block.

// instantiate vertices normally
vertices = new osg::Vec3Array;

// if number of parts is greater than 1000,
// reserve your items before.
if (NumPart  1000)
{
   try
   {
  vertices-reserve(NumPart);
   }
   catch (std::bad_alloc e)
   {
   // handle exception here; log and return error from this function.
   // alternatively, you can rethrow here, and catch in caller.
   }
}

// wrap your push_back calls in a try-catch block
try
{
   vertices-push_back(...);
}
catch (std::exception)
{
}

To be on the safe side, handle your exceptions and wrap your pointers
in a smart pointer class. If an exception is thrown and you
rethrow/return from function, you need to delete your Geode, Group and
other objects. You may get all these for free, if you use a smart
pointer (osg::ref_ptrT, in this case, as osg::Node's destructor is
protected, IIRC, which prevents it to be deleted externally, but
only when its ref count reaches 0).

HTH
Ismail

2009/4/13 Paul Martz pma...@skew-matrix.com:
 Hi Lingyun Yu --
 You don't have a variable named 'galaxy' defined, so the
 addDrawable(galaxy) is suspicious.

 I'd so a resize on the vertex and color arrays, rather than a push_back, for
 efficiency reasons.

 I don't think numParts100 should cause any problems. OpenGL doesn not
 place an upper limit on the number of primitives you can render with a
 single glDrawArrays call.

 I don't really see anything that would cause a crash so I guess you should
 use a debugger and look at the call stack, like you would any other crash.

 Paul Martz
 Skew Matrix Software LLC
 http://www.skew-matrix.com
 +1 303 859 9466


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sent:
 Monday, April 13, 2009 9:27 AM
 To: osg-users@lists.openscenegraph.org
 Subject: [osg-users] Problem of points showing

 Hi, everybody,

 I met a problem when I want to show huge amount of points, as you can see
 the code below, if my NumPart is 100, no problem, it shows points
 properly. But if the NumPart is 200, then it shows a lot of lines. If
 NumPart is even bigger, the program complained like this:Microsoft C++
 exception: std::bad_alloc at memory location 0x0030e898.

 I don't know that's because the dataset is too big or not? because while it
 shows not so many points, everything goes well.

 By the way, the data in P array are all right.

 osg::Geode *makeGalaxy()
 {
     osg::Geode *geode = new osg::Geode();
     osg::Geometry *geometry= new osg::Geometry();
     osg::Vec3Array *vertices = new osg::Vec3Array();
     osg::Vec4Array *colors = new osg::Vec4Array();
     osg::Vec4 ini(1,0.1,0.55,1);
     osg::Vec4 fin(0,1,0,1);

     for (int i = 1; i = NumPart; i++)
     {

 vertices-push_back(osg::Vec3(P[i].Pos[0],P[i].Pos[1],P[i].Pos[2]));
     colors-push_back(ini+(fin-ini)*(i*1/NumPart));
     }
     geometry-setVertexArray(vertices);
     geometry-setColorArray(colors);
     geometry-setColorBinding(osg::Geometry::BIND_PER_VERTEX);
     geometry-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POINTS,
 0, NumPart));
     geode-addDrawable(galaxy);
     return geode;
 }

 ...

 Thank you.

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





 ___
 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] Drawable optimization

2009-04-14 Thread Paul Martz
Yes, you can write a NodeVisitor to convert DrawArrays to DrawElements. I
wrote one just recently and saw a huge performance boost on NVIDIA's OS X
drivers for the GF8800.

The display list default is probably historical. OSG's Drawables predate
buffer objects.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Harold
Comere
Sent: Tuesday, April 14, 2009 5:38 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Drawable optimization

Hi all,

I am currently working on a kind of drawable optimizer.
My goal is to make primitive set groups and have only one drawable per
group. ( grouping vertexs linked by any face of the group ) The effect will
be to avoid to have separated objects in a same drawable.
In same way, i want to merge small drawables containing only few faces but
are in the same object.
I have a node visitor wich will do this for all drawable in each geode.

When i look at primitive set types generated by any importer, i notice that
sometimes it is drawArrays, and other times drawElements.
So my question is if there is any osg optimisation wich choose between
drawArrays or drawElements alone ? drawElements is usually faster than
drawArray calls, so i wonder if i can convert everything in drawElements
type without lose fps ..

Another question, osg doesnt seem to use VBOs by default, is there any
reason ?

thank you for your attention.
Regards,
Harold

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





___
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] Camera control like in Google Earth - how to do that?

2009-04-14 Thread Paul Martz
Try the TerrainManipulator.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Christian
Buchner
Sent: Tuesday, April 14, 2009 3:44 AM
To: OpenSceneGraph Users
Subject: [osg-users] Camera control like in Google Earth - how to do that?

Hi everybody.

So far my 3D simulation and visualization uses the trackball manipulator for
controlling the camera.

Is there anything built into OpenSceneGraph that mimicks the way that one
can control the camera in Google Earth?

Has anyone succeeded building such type of camera control with
OpenSceneGraph?

Would anyone know about any patent issues with the way Google do it?

Christian
___
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] HDR Skybox

2009-04-14 Thread Rob
I've tried it with both R32G32B32A32 DDS file and HDR files. I recently 
upgraded to 2.8, but no luck still. I'm wondering if it has something to do 
with the textures being coppied into the cube image from seperate files, so 
I'll see about loading those files into a non cube texture.

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





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


Re: [osg-users] Problem of points showing

2009-04-14 Thread Lingyun Yu
Thank you, Paul and Ismail!

I will try Ismail's solution, and will tell you the result.

On Tue, Apr 14, 2009 at 2:27 PM, Ismail Pazarbasi pazarb...@gmail.comwrote:

 Hi Lingyun,

 std::bad_alloc is thrown when operator new cannot allocate memory,
 which indicates there is not enough memory. You may reserve your array
 before hand, as Paul mentioned, but it may throw as well. This could
 reduce, if nothing, copy operations. It may also prevent exception,
 because when expanding, std::vector will have two large copies at the
 same time. That is:
 e.g. old array length was 150
 expand by 50
 While allocating 200 elements, previous 150 elements will also
 be alive/allocated, that requires room for 350 elements in total.
 Resize may reduce this cost to 200 only, because vector will not
 have to expand afterwards (i.e. during push_back), which requires a
 copy operation. Note that C++ standard allocator doesn't do realloc().
 Instead, vector will allocate a block of  N * sizeof(T) items (or
 little more), copy existing block into new one, then free existing
 block.

 // instantiate vertices normally
 vertices = new osg::Vec3Array;

 // if number of parts is greater than 1000,
 // reserve your items before.
 if (NumPart  1000)
 {
   try
   {
  vertices-reserve(NumPart);
   }
   catch (std::bad_alloc e)
   {
   // handle exception here; log and return error from this function.
   // alternatively, you can rethrow here, and catch in caller.
   }
 }

 // wrap your push_back calls in a try-catch block
 try
 {
   vertices-push_back(...);
 }
 catch (std::exception)
 {
 }

 To be on the safe side, handle your exceptions and wrap your pointers
 in a smart pointer class. If an exception is thrown and you
 rethrow/return from function, you need to delete your Geode, Group and
 other objects. You may get all these for free, if you use a smart
 pointer (osg::ref_ptrT, in this case, as osg::Node's destructor is
 protected, IIRC, which prevents it to be deleted externally, but
 only when its ref count reaches 0).

 HTH
 Ismail

 2009/4/13 Paul Martz pma...@skew-matrix.com:
  Hi Lingyun Yu --
  You don't have a variable named 'galaxy' defined, so the
  addDrawable(galaxy) is suspicious.
 
  I'd so a resize on the vertex and color arrays, rather than a push_back,
 for
  efficiency reasons.
 
  I don't think numParts100 should cause any problems. OpenGL doesn
 not
  place an upper limit on the number of primitives you can render with a
  single glDrawArrays call.
 
  I don't really see anything that would cause a crash so I guess you
 should
  use a debugger and look at the call stack, like you would any other
 crash.
 
  Paul Martz
  Skew Matrix Software LLC
  http://www.skew-matrix.com
  +1 303 859 9466
 
 
  -Original Message-
  From: osg-users-boun...@lists.openscenegraph.org
  [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sent:
  Monday, April 13, 2009 9:27 AM
  To: osg-users@lists.openscenegraph.org
  Subject: [osg-users] Problem of points showing
 
  Hi, everybody,
 
  I met a problem when I want to show huge amount of points, as you can see
  the code below, if my NumPart is 100, no problem, it shows points
  properly. But if the NumPart is 200, then it shows a lot of lines. If
  NumPart is even bigger, the program complained like this:Microsoft C++
  exception: std::bad_alloc at memory location 0x0030e898.
 
  I don't know that's because the dataset is too big or not? because while
 it
  shows not so many points, everything goes well.
 
  By the way, the data in P array are all right.
 
  osg::Geode *makeGalaxy()
  {
  osg::Geode *geode = new osg::Geode();
  osg::Geometry *geometry= new osg::Geometry();
  osg::Vec3Array *vertices = new osg::Vec3Array();
  osg::Vec4Array *colors = new osg::Vec4Array();
  osg::Vec4 ini(1,0.1,0.55,1);
  osg::Vec4 fin(0,1,0,1);
 
  for (int i = 1; i = NumPart; i++)
  {
 
  vertices-push_back(osg::Vec3(P[i].Pos[0],P[i].Pos[1],P[i].Pos[2]));
  colors-push_back(ini+(fin-ini)*(i*1/NumPart));
  }
  geometry-setVertexArray(vertices);
  geometry-setColorArray(colors);
  geometry-setColorBinding(osg::Geometry::BIND_PER_VERTEX);
  geometry-addPrimitiveSet(new
 osg::DrawArrays(osg::PrimitiveSet::POINTS,
  0, NumPart));
  geode-addDrawable(galaxy);
  return geode;
  }
 
  ...
 
  Thank you.
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=10166#10166
 
 
 
 
 
  ___
  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] OsgNode/SceneGraph in TreeView

2009-04-14 Thread Michael Hasler
Hello,

I need to show an complete SceneGraph in an TreeView (QT),
to browse trough the scene objects.

Im asking here, cause i hope somebody can give me examples
or some information how to solve that problem.

Google want give me more :(

Thankas a lot !

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





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


Re: [osg-users] Problem of points showing

2009-04-14 Thread Martin Beckett
The c++ standard also requires that the memory for vector is contiguous like 
a C array.
You can try reserving the memory soon after program start and keep the array 
around until you load the data, the memory has the least chance of being 
fragmented before anything else is allocated.
You can also split the data into smaller blocks and attach multiple geometries 
to the same geode - the 3dc plugin does this to limit the blocks to 10,000 
points

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





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


Re: [osg-users] ray tracing using OSG

2009-04-14 Thread Jean-Sébastien Guay

Hello Sajjad,


So far i have got from the forum Jean-Sébastien Guay did his Masters thesis
on that domain and it would be really nice
if he provide the link to the report, at least it would be a starting 
point for me.


My Masters thesis was written in French unfortunately, and translating 
it all would take too much time. Anyways, the subject was not really ray 
tracing but an extension to PRT (Precomputed Radiance Transfer) to be 
able to recompute shading interactively in dynamic scenes.


Ray tracing with OSG is actually pretty easy if you just want to 
raytrace a picture of your scene, just get your viewer camera's 
parameters, generate some rays and use the kdtree support in 
LineSegmentIntersector to trace through the scene. Of course, if you 
want to do global illumination or advanced effects then it's more 
complicated, but there's been a lot written on those subjects, and it's 
not OSG's main focus, so you're pretty much on your own...


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem of points showing

2009-04-14 Thread Lingyun Yu
Thanks Martin,

yes, this is also a solution.

thank you very much.

Yun

On Tue, Apr 14, 2009 at 4:04 PM, Martin Beckett m...@mgbeckett.com wrote:

 The c++ standard also requires that the memory for vector is contiguous
 like a C array.
 You can try reserving the memory soon after program start and keep the
 array around until you load the data, the memory has the least chance of
 being fragmented before anything else is allocated.
 You can also split the data into smaller blocks and attach multiple
 geometries to the same geode - the 3dc plugin does this to limit the blocks
 to 10,000 points

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





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




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


Re: [osg-users] ray tracing using OSG

2009-04-14 Thread Paul Melis

ami guru wrote:

Hello Forum,


I was wondering if there is anyone have done ray tracing using OSG.
I once made a very quick and dirty example that merely uses OSG's 
KD-tree support to do ray tracing.

See this thread:
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-July/014399.html

Regards,
Paul




So far i have got from the forum Jean-Sébastien Guay did his Masters 
thesis

on that domain and it would be really nice
if he provide the link to the report, at least it would be a starting 
point for me.


What do you think Jean?


Regards
Sajjad





___
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] Blueberry3D high detail terrain solution for OpenSceneGraph

2009-04-14 Thread Enrico Raue
Hello Christian,

Bionatics have several game developers as customers. But for the moment there 
are no games on the market using Blueberry3D technology.

All trees have been planted automatically according to procedural rules set 
by the user in the Editor.
Blueberry3D works with Terrain Classes (multi layered definition, ground, 
canopy, grass, bush, trees, of different types of terrain) that are linked to
a land use map.  Terrain Class information also contains information about the 
nature of the ground, if its, rough, bumpy, flat.
Blueberry3D is using fractal models for vegetation scattering, ground creation 
(filling in information in between elevation data to make it look realistic)

It is also possible to place trees and object manually, e.g. geo-specific 
Open-Flight models, that are important for the simulation environment.

The database from Mediterranean area you see in video is 50x30km big and took, 
one person, about 5 weeks to create from scratch using GIS data.

Regards,

Enrico

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





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


[osg-users] osgslice example can not run in windows vista?

2009-04-14 Thread Will Clock
Hi,

osgslice example can not run in windows vista? but linux works.
Error: unable to create graphics window

Thank you.

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





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


[osg-users] How to share texture object when loading a model many times?

2009-04-14 Thread Roger
Hi,

In my case,many trees models are readed in memory and they use the same image 
as their textures. I have realized all models in memory share the same image 
object.

as shown in :
http://forum.openscenegraph.org/viewtopic.php?t=2215

while in rendering stage, I found out that 1G or so memory were consumed.

is it because I  texture objects are not shared between models?
or
is it because mipmap are created during rendering stage?

could we have some remedy to solve this problem?

thank you!

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





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


Re: [osg-users] OsgNode/SceneGraph in TreeView

2009-04-14 Thread Paul Martz
Hi Michael -- I've seen many people ask for this, but no one has ever
explained how they would want the tree view to behave in the presence of
multiparenting.

Both osgEdit and Orihalcon have such tools, but I haven't played with them.

I have a NodeVisitor that creates a wx tree view. This is actually a trivial
programming task, quite simple to do as long as the code doesn't have to
support  multiparenting. The NodeVisitor just needs to keep a stack of
folder controls, top of stack is the parent of new folder controls that
get added for each node. Just push and pop the stack around each traverse()
call.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Michael
Hasler
Sent: Tuesday, April 14, 2009 7:55 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] OsgNode/SceneGraph in TreeView

Hello,

I need to show an complete SceneGraph in an TreeView (QT), to browse trough
the scene objects.

Im asking here, cause i hope somebody can give me examples or some
information how to solve that problem.

Google want give me more :(

Thankas a lot !

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





___
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] [build] Postbuild error with, ot11-OpenThreads??

2009-04-14 Thread Chris 'Xenon' Hanson

 Hah! Thanks Ismail, That was the problem.
 
 1INSTALL - 0 error(s), 0 warning(s)
 == Build: 1 succeeded, 0 failed, 195 up-to-date, 0 skipped ==
 
 I'm a happy bunny  :D
 
 
 8)
 John Montgomery, Glassel, Scotland.


  I had that problem too, under Vista, and noted it in the OSG build how-to on 
the wiki.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] any help would be appreciated - updating a group of cameras (UNCLASSIFIED)

2009-04-14 Thread Konkle, Daniel T AMRDEC/Dynetics
Classification:  UNCLASSIFIED 
Caveats: NONE

I am new to OSG and I am stuck and need help/insight.

I'm created a Heads up display by extending the group class.

My Hud is an osg::Group and has several cameras in it.

The Hud displays fine.

The Hud class has several variables that control how information is
displayed such as the heading.

I've written a callback and attached it to my Hud.

After attaching my Hud to my scene, I want to the callback for the Hud
to change its variables but the cameras in my Hud don't use the updated
variables to redraw themselves.

I've used osg::notify to show that the callback is getting executed and
to print out the value of the heading variable I am changing.

I realize I'm not showing any code only because there is so much of it.

Can anyone give me an idea of where to look to figure out why all the
children in my HUD class aren't updating?

My HUD (an osg::Group) class constructor creates several cameras that
draw a variety of elements on the screen.


I've looked through most of the examples but I'm not sure what I'm
looking for.

Any help would be greatly appreciated.

Danny Konkle
Classification:  UNCLASSIFIED 
Caveats: NONE

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


Re: [osg-users] any help would be appreciated - updating a group of cameras (UNCLASSIFIED)

2009-04-14 Thread Jean-Sébastien Guay

Hello Danny,


Can anyone give me an idea of where to look to figure out why all the
children in my HUD class aren't updating?


Perhaps you're using an osg::Geometry and you're not calling 
dirtyDisplayList() on it? osg::Geometry by default uses display lists, 
so if you change the geometry you need to tell OSG to update the display 
lists. If you're modifying the geometry once per frame then you might as 
well disable display lists by calling useDisplayList(false) otherwise 
you'll waste time updating the display lists each frame.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] terrain database popping...

2009-04-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Just a quick question for the experts out there.

 

When I'm flying through my terrain database, I'm seeing a lot of popping
as the database pager brings in higher LODs of terrain. My question is, is
there a way to minimize this popping? Is there any geomorphing support in
the way OSG pages in the terrain? If there's no geomorphing support to
smooth out the LOD transitions across several rendering frames, that would
be a nice feature to have in a future release.J

 

Thanks in advance.

-Shayne



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgViewer in a FLTK window...

2009-04-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Another question.

 

Can you have an osgViewer embedded in a FLTK windowing framework? If so, can
osgViewer still render with multi-threading? I know there are some
limitations along this line when an osgViewer is embedded in a GLUT window.
I'm wondering if having an osgViewer in a FLTK window suffers from the same
limitations.

 

Any input would be appreciated.

 

-Shayne



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] terrain database popping...

2009-04-14 Thread Chris 'Xenon' Hanson
Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote:
 Just a quick question for the experts out there…
 When I’m flying through my terrain database, I’m seeing a lot of
 “popping” as the database pager brings in higher LODs of terrain. My
 question is, is there a way to minimize this popping? Is there any
 geomorphing support in the way OSG pages in the terrain? If there’s no
 geomorphing support to smooth out the LOD transitions across several
 rendering frames, that would be a nice feature to have in a future release…J

  The basic LOD/PagedLOD doesn't do any magic to conceal the transition.

  There was some work to create a FadeLOD years ago:
http://archive.netbsd.se/?ml=openscenegraph-usersa=2005-02t=1628815

  But I'm not sure where it stands. I couldn't find FadeLOD last time I looked.

  If you want geomorphing, you should consider using a library like libmini or 
VTP (which
can use libmini and supplies other nice frills too).

http://vterrain.org

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] any help would be appreciated - updating a group ofcameras (UNCLASSIFIED)

2009-04-14 Thread Paul Martz
Hi Danny -- There really isn't much info to go on here. You don't describe
the mechanism that is doing the drawing. Cameras don't draw, they only set
the matrices.

Assuming you are changing a Drawable in your scene graph... One thing to
check would be to make sure that you have setUseDisplayLists( false ). You
don't want to use display lists for dynamic geometry.

If your code is too large to debug, then write a small piece of code to
reproduce the problem outside of your larger app, making it as small and
simple as possible. This will increase the odds that someone on the list
will take the time to look at it.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Konkle,
Daniel T AMRDEC/Dynetics
Sent: Tuesday, April 14, 2009 9:32 AM
To: OpenSceneGraph Users
Subject: [osg-users] any help would be appreciated - updating a group
ofcameras (UNCLASSIFIED)

Classification:  UNCLASSIFIED
Caveats: NONE

I am new to OSG and I am stuck and need help/insight.

I'm created a Heads up display by extending the group class.

My Hud is an osg::Group and has several cameras in it.

The Hud displays fine.

The Hud class has several variables that control how information is
displayed such as the heading.

I've written a callback and attached it to my Hud.

After attaching my Hud to my scene, I want to the callback for the Hud to
change its variables but the cameras in my Hud don't use the updated
variables to redraw themselves.

I've used osg::notify to show that the callback is getting executed and to
print out the value of the heading variable I am changing.

I realize I'm not showing any code only because there is so much of it.

Can anyone give me an idea of where to look to figure out why all the
children in my HUD class aren't updating?

My HUD (an osg::Group) class constructor creates several cameras that draw a
variety of elements on the screen.


I've looked through most of the examples but I'm not sure what I'm looking
for.

Any help would be greatly appreciated.

Danny Konkle
Classification:  UNCLASSIFIED
Caveats: NONE

___
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] ray tracing using OSG

2009-04-14 Thread ami guru
Thanks for all  the feedback


I wondering if osgvolume is doing ray tracing and what is its type.


Did that framework follow any published paper?

Sajjad

On Tue, Apr 14, 2009 at 4:12 PM, Paul Melis p...@science.uva.nl wrote:

 ami guru wrote:

 Hello Forum,


 I was wondering if there is anyone have done ray tracing using OSG.

 I once made a very quick and dirty example that merely uses OSG's KD-tree
 support to do ray tracing.
 See this thread:

 http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-July/014399.html

 Regards,
 Paul



 So far i have got from the forum Jean-Sébastien Guay did his Masters
 thesis
 on that domain and it would be really nice
 if he provide the link to the report, at least it would be a starting
 point for me.

 What do you think Jean?


 Regards
 Sajjad



 

 ___
 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] osgViewer in a FLTK window...

2009-04-14 Thread Eric Sokolowsky
I have been busy playing with this. You can have an osgViewer embedded in a
FLTK window. I haven't tried to render with multiple threads yet, but it
works for a single thread. You can draw FLTK windows in multiple threads but
you have to use a mutex (part of the FLTK system) so you can only draw in
one window at a time. I am not sure if this also applies to OpenGL (and thus
OSG) drawing in FLTK windows.

Under Linux (and Windows I think) you can have an OSG window that processes
OSG events in a separate thread from your FLTK window in the FLTK thread
processing FLTK events. This approach does not work on the Mac, and I'm not
entirely sure why. I had to combine my two event processing threads into one
to get it to work on the Mac. One annoying limitation in this approach is
that if you are selecting an FLTK menu, OSG rendering stops in your other
window. There seems to be no way around this.

I am playing with an improved FLTK viewer which expands upon the
osgviewerFLTK example, but it is still in progress.

-Eric

On Tue, Apr 14, 2009 at 12:03 PM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC shayne.tuel...@hill.af.mil wrote:

  Another question…



 Can you have an osgViewer embedded in a FLTK windowing framework? If so,
 can osgViewer still render with multi-threading? I know there are some
 limitations along this line when an osgViewer is embedded in a GLUT window.
 I’m wondering if having an osgViewer in a FLTK window suffers from the same
 limitations…



 Any input would be appreciated…



 -Shayne

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


Re: [osg-users] any help would be appreciated - updating a groupofcameras (UNCLASSIFIED)

2009-04-14 Thread Konkle, Daniel T AMRDEC/Dynetics
Classification:  UNCLASSIFIED 
Caveats: NONE

thanks. that helps.

so if my camera in my group have drawables attached to them how would i
get them to be updated?

i'm taking your approach and trying to make a useful example that is
small.

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-
 boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
 Sent: Tuesday, April 14, 2009 12:30 PM
 To: 'OpenSceneGraph Users'
 Subject: Re: [osg-users] any help would be appreciated - updating a
 groupofcameras (UNCLASSIFIED)
 
 Hi Danny -- There really isn't much info to go on here. You don't
 describe
 the mechanism that is doing the drawing. Cameras don't draw, they only
 set
 the matrices.
 
 Assuming you are changing a Drawable in your scene graph... One thing
 to
 check would be to make sure that you have setUseDisplayLists( false ).
 You
 don't want to use display lists for dynamic geometry.
 
 If your code is too large to debug, then write a small piece of code
to
 reproduce the problem outside of your larger app, making it as small
 and
 simple as possible. This will increase the odds that someone on the
 list
 will take the time to look at it.
 
 Paul Martz
 Skew Matrix Software LLC
 http://www.skew-matrix.com
 +1 303 859 9466
 
 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
 Konkle,
 Daniel T AMRDEC/Dynetics
 Sent: Tuesday, April 14, 2009 9:32 AM
 To: OpenSceneGraph Users
 Subject: [osg-users] any help would be appreciated - updating a group
 ofcameras (UNCLASSIFIED)
 
 Classification:  UNCLASSIFIED
 Caveats: NONE
 
 I am new to OSG and I am stuck and need help/insight.
 
 I'm created a Heads up display by extending the group class.
 
 My Hud is an osg::Group and has several cameras in it.
 
 The Hud displays fine.
 
 The Hud class has several variables that control how information is
 displayed such as the heading.
 
 I've written a callback and attached it to my Hud.
 
 After attaching my Hud to my scene, I want to the callback for the Hud
 to
 change its variables but the cameras in my Hud don't use the updated
 variables to redraw themselves.
 
 I've used osg::notify to show that the callback is getting executed
and
 to
 print out the value of the heading variable I am changing.
 
 I realize I'm not showing any code only because there is so much of
it.
 
 Can anyone give me an idea of where to look to figure out why all the
 children in my HUD class aren't updating?
 
 My HUD (an osg::Group) class constructor creates several cameras that
 draw a
 variety of elements on the screen.
 
 
 I've looked through most of the examples but I'm not sure what I'm
 looking
 for.
 
 Any help would be greatly appreciated.
 
 Danny Konkle
 Classification:  UNCLASSIFIED
 Caveats: NONE
 
 ___
 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
Classification:  UNCLASSIFIED 
Caveats: NONE

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


Re: [osg-users] osgViewer in a FLTK window...

2009-04-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Thanks Eric for the information.

Keep me posted on how things progress for your project...

-Shayne 

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Eric
Sokolowsky
Sent: Tuesday, April 14, 2009 12:26 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgViewer in a FLTK window...

I have been busy playing with this. You can have an osgViewer embedded in a
FLTK window. I haven't tried to render with multiple threads yet, but it
works for a single thread. You can draw FLTK windows in multiple threads but
you have to use a mutex (part of the FLTK system) so you can only draw in
one window at a time. I am not sure if this also applies to OpenGL (and thus
OSG) drawing in FLTK windows.

Under Linux (and Windows I think) you can have an OSG window that processes
OSG events in a separate thread from your FLTK window in the FLTK thread
processing FLTK events. This approach does not work on the Mac, and I'm not
entirely sure why. I had to combine my two event processing threads into one
to get it to work on the Mac. One annoying limitation in this approach is
that if you are selecting an FLTK menu, OSG rendering stops in your other
window. There seems to be no way around this.

I am playing with an improved FLTK viewer which expands upon the
osgviewerFLTK example, but it is still in progress.

-Eric


On Tue, Apr 14, 2009 at 12:03 PM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC shayne.tuel...@hill.af.mil wrote:


Another question.

 

Can you have an osgViewer embedded in a FLTK windowing framework? If
so, can osgViewer still render with multi-threading? I know there are some
limitations along this line when an osgViewer is embedded in a GLUT window.
I'm wondering if having an osgViewer in a FLTK window suffers from the same
limitations.

 

Any input would be appreciated.

 

-Shayne




smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] updating a camera's children? (UNCLASSIFIED)

2009-04-14 Thread Konkle, Daniel T AMRDEC/Dynetics
Classification:  UNCLASSIFIED 
Caveats: NONE

So from helpful comments, I believe I know what I'm doing wrong.
I am creating a group and adding cameras to the group.
in the cameras I have various drawables that I'd like to update with my
program.

i can't get the camera's children to update and can't find an example
that works.

for an example of what i'm trying to do, 
i took the osghud example and created a few geometries on it.

i added a callback that should change a scale factor for the triangles
that i'm adding 
and update the text in one of the screens.

i tried to versions.  one that had the callback on the camera and one
that has the callback on one of the geodes.

I appreciate any help anyone might be able to give.

Danny





 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-
 boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
 Sent: Tuesday, April 14, 2009 12:30 PM
 To: 'OpenSceneGraph Users'
 Subject: Re: [osg-users] any help would be appreciated - updating a
 groupofcameras (UNCLASSIFIED)
 
 Hi Danny -- There really isn't much info to go on here. You don't
 describe
 the mechanism that is doing the drawing. Cameras don't draw, they only
 set
 the matrices.
 
 Assuming you are changing a Drawable in your scene graph... One thing
 to
 check would be to make sure that you have setUseDisplayLists( false ).
 You
 don't want to use display lists for dynamic geometry.
 
 If your code is too large to debug, then write a small piece of code
to
 reproduce the problem outside of your larger app, making it as small
 and
 simple as possible. This will increase the odds that someone on the
 list
 will take the time to look at it.
 
 Paul Martz
 Skew Matrix Software LLC
 http://www.skew-matrix.com
 +1 303 859 9466
 
 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
 Konkle,
 Daniel T AMRDEC/Dynetics
 Sent: Tuesday, April 14, 2009 9:32 AM
 To: OpenSceneGraph Users
 Subject: [osg-users] any help would be appreciated - updating a group
 ofcameras (UNCLASSIFIED)
 
 Classification:  UNCLASSIFIED
 Caveats: NONE
 
 I am new to OSG and I am stuck and need help/insight.
 
 I'm created a Heads up display by extending the group class.
 
 My Hud is an osg::Group and has several cameras in it.
 
 The Hud displays fine.
 
 The Hud class has several variables that control how information is
 displayed such as the heading.
 
 I've written a callback and attached it to my Hud.
 
 After attaching my Hud to my scene, I want to the callback for the Hud
 to
 change its variables but the cameras in my Hud don't use the updated
 variables to redraw themselves.
 
 I've used osg::notify to show that the callback is getting executed
and
 to
 print out the value of the heading variable I am changing.
 
 I realize I'm not showing any code only because there is so much of
it.
 
 Can anyone give me an idea of where to look to figure out why all the
 children in my HUD class aren't updating?
 
 My HUD (an osg::Group) class constructor creates several cameras that
 draw a
 variety of elements on the screen.
 
 
 I've looked through most of the examples but I'm not sure what I'm
 looking
 for.
 
 Any help would be greatly appreciated.
 
 Danny Konkle
 Classification:  UNCLASSIFIED
 Caveats: NONE
 
 ___
 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
  Classification:  UNCLASSIFIED 
Caveats: NONE



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


Re: [osg-users] terrain database popping...

2009-04-14 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Thanks for the input. I'm somewhat familiar with VTP but not with libmini. I'll 
poke around to get more info...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' 
Hanson
Sent: Tuesday, April 14, 2009 11:16 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] terrain database popping...

Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote:
 Just a quick question for the experts out there…
 When I’m flying through my terrain database, I’m seeing a lot of
 “popping” as the database pager brings in higher LODs of terrain. My
 question is, is there a way to minimize this popping? Is there any
 geomorphing support in the way OSG pages in the terrain? If there’s no
 geomorphing support to smooth out the LOD transitions across several
 rendering frames, that would be a nice feature to have in a future release…J

  The basic LOD/PagedLOD doesn't do any magic to conceal the transition.

  There was some work to create a FadeLOD years ago:
http://archive.netbsd.se/?ml=openscenegraph-usersa=2005-02t=1628815

  But I'm not sure where it stands. I couldn't find FadeLOD last time I looked.

  If you want geomorphing, you should consider using a library like libmini or 
VTP (which
can use libmini and supplies other nice frills too).

http://vterrain.org

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] terrain database popping...

2009-04-14 Thread Chris 'Xenon' Hanson
Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote:
 Thanks for the input. I'm somewhat familiar with VTP but not with libmini. 
 I'll poke around to get more info...

  Libmini is one of the lower-level APIs VTP uses. VTP is certainly a good base 
to build a
geosimulation app on, depending on your requirements. You can try to stick 
libmini into
plain OSG as well, but VTP already has done the integration for you.

 -Shayne

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
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 the cursor

2009-04-14 Thread tien dat
Thank you Robert, I've got it works now. Awesome.
Dat

On Tue, Apr 14, 2009 at 12:33 AM, Robert Osfield
robert.osfi...@gmail.comwrote:

 On the graphics window do gw-setCursor(false);  See osgcatch or
 osgstereimage for example usage.

 On Mon, Apr 13, 2009 at 11:08 PM, tien dat tienda...@gmail.com wrote:

 Hi all,
 I'm writing my own viewer class inherited from osgViewer class. It
 works fine except that the cursor doesn't disappear (it does display
 full screen, that's great). Could any of you tell me how to simply
 make the cursor disappear?
 Thank you very much,
 Dat
 ___
 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




-- 
-
Dat Tien Nguyen
PhD student, Computer Science Department
The University of Iowa, IA 52242
http://cs.uiowa.edu/~tinguyen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Erratic intersections with long line segments

2009-04-14 Thread Tomlinson, Gordon
HI All
 
I posting this for one of my folks who's is having some erratic results
when using a long vertical line segment and the standard
osgUtil::LineSegmentIntersector
 
Basically when he sets a line segment up with  end X,Y, 100 and
start X,Y, -100 , occasionally we fail to get a hit even though we
are in the middle of the terrain skin, although moving the X,Y several
meters in any direction and we get a hit.
 
If we reduce the Z of the line segment to 500k and -500k this happens
less errant fails, 
 
if we reduce the Z's to 1k, -1k then we never get a fail, 
 
further when we are failing with the intersections if the camera is
further away from the intersection the less fails we get, the more we
move closer to  the intersection point the more fails we get.
 
Our Near and Far clip are fixed, 1 to 10-20k , the terrain skin is
stanard OSG geometry, nothing fancy, some lods, but the level and which
lod is showing does not seem to be the issue
 
I'm at at a loss to why this may be happening, we are not doing anything
out the oridnary in this case that I can think that would cause this
erratic behaviour ,
 
 any one seen anything like this  before ? 
 
 
thanks
 
 

Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival 
- Master Tambo Tetsura

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


[osg-users] [vpb] Building a geocentric database with heigh data

2009-04-14 Thread Mauricio
Hi,

I tryed to build a geocentric database with heigh data from several input 
images but I did not succeed.

I issued the following command line:

osgdem --geocentric --whole-globe -t texture_2048.tif -d height_2048.tif -l 4 
-v 0.1 -o earth.ive

This command causes osgdem to crash.

I used the following data, among others, in tiff format:

heigh field (fliped vertically!?): 
http://picasaweb.google.com.br/mauricio.hofmam/Earth#5324691195386557506

texture: 
http://picasaweb.google.com.br/mauricio.hofmam/Earth#5324691052559797922

The following command works fine (without heigh field):

osgdem --geocentric --whole-globe -t texture_2048.tif -l 4 -v 0.01 -o earth.ive

The following command also works fine (with heigh field but not geocentric):

osgdem -t texture_2048.tif -d height_2048.tif -l 4 -v 0.01 -o earth.ive

Am I missing someting?

I am using the lastest versions of OpenSceneGraph (2.8.0) and VPB (0.9.10).
... 

Thank you.

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





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


[osg-users] How to compile VPB in Windows With MinGW?

2009-04-14 Thread zhuliangxiong
I download VPB 0.9.10 from SVN.and have set all required include path and 
library path/file,

when compile ,fellowing error break the compile process.
#error GCC no longer implements varargs.h
#error Revise your code to use stdarg.h


how can I fix it?


sincerely

zhu liangxiong



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