Re: [osg-users] Example osgTerrain compile error

2007-07-17 Thread sherman wilcox

On 7/17/07, Jean-Sébastien Guay [EMAIL PROTECTED] wrote:

Hi Robert,

 Oopps... a case bleery eyed checked in at the end of the day now
 fixed and checked in.

Seems to compile but now I get this linker error:

osgterrain.obj : error LNK2019: unresolved external symbol public:
__thiscall osgUtil::GLObjectsOperation::GLObjectsOperation(class
osg::Node *,unsigned int)
([EMAIL PROTECTED]@@[EMAIL PROTECTED]@osg@@[EMAIL PROTECTED]) referenced in
function public: virtual void __thiscall
MasterOperation::operator()(class osg::Object *)
(??RMasterOperation@@[EMAIL PROTECTED]@@@Z)

Seems you're missing the OSGUTIL_EXPORT in the class
GLObjectsOperation declaration in the osgUtil::GLObjectsVisitor header.

Once that's fixed it compiles and links correctly. Yeah, I know, damn
Windows... :-)


I'm having the same linker problem, but OSGUTIL_EXPORT is there.
Here's the first few lines of the header:


#ifndef OSGUTIL_GLOBJECTSVISITOR
#define OSGUTIL_GLOBJECTSVISITOR 1

#include osg/NodeVisitor
#include osg/Geode
#include osg/State

#include osgUtil/Export

namespace osgUtil {

/** Visitor for traversing scene graph and setting each
osg::Drawable's _useDisplayList flag,
 * with option to immediately compile osg::Drawable OpenGL Display lists and
 * osg::StateAttribute's.
 */
class OSGUTIL_EXPORT GLObjectsVisitor : public osg::NodeVisitor



What gives? Everythng compiles, but I'm getting the same linker error as you.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Example osgTerrain compile error

2007-07-17 Thread sherman wilcox

On 7/17/07, sherman wilcox [EMAIL PROTECTED] wrote:

On 7/17/07, Jean-Sébastien Guay [EMAIL PROTECTED] wrote:
 Hi Robert,

  Oopps... a case bleery eyed checked in at the end of the day now
  fixed and checked in.

 Seems to compile but now I get this linker error:

 osgterrain.obj : error LNK2019: unresolved external symbol public:
 __thiscall osgUtil::GLObjectsOperation::GLObjectsOperation(class
 osg::Node *,unsigned int)
 ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@osg@@[EMAIL PROTECTED]) referenced in
 function public: virtual void __thiscall
 MasterOperation::operator()(class osg::Object *)
 (??RMasterOperation@@[EMAIL PROTECTED]@@@Z)

 Seems you're missing the OSGUTIL_EXPORT in the class
 GLObjectsOperation declaration in the osgUtil::GLObjectsVisitor header.

 Once that's fixed it compiles and links correctly. Yeah, I know, damn
 Windows... :-)

I'm having the same linker problem, but OSGUTIL_EXPORT is there.
Here's the first few lines of the header:


#ifndef OSGUTIL_GLOBJECTSVISITOR
#define OSGUTIL_GLOBJECTSVISITOR 1

#include osg/NodeVisitor
#include osg/Geode
#include osg/State

#include osgUtil/Export

namespace osgUtil {

/** Visitor for traversing scene graph and setting each
osg::Drawable's _useDisplayList flag,
 * with option to immediately compile osg::Drawable OpenGL Display lists and
 * osg::StateAttribute's.
 */
class OSGUTIL_EXPORT GLObjectsVisitor : public osg::NodeVisitor



What gives? Everythng compiles, but I'm getting the same linker error as you.



Nevermind, misread that. GLObjectsOperation was missing
OSGUTIL_EXPORT, not GLObjectsVisitor. As the OP said, once
OSGUTIL_EXPORT is added to GLObjectsOperation, everything works fine.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] PointSprites = small feature culling = ClusterCullingCallback

2007-07-04 Thread sherman wilcox

On 7/4/07, Robert Osfield [EMAIL PROTECTED] wrote:

Hi Sherman,

The call setCullMode(osg::CullSettings::VIEW_FRUSTUM_SIDES_CULLING);
is enabling just view frustum culling for the sides of the frustum,
it'll switch off cluster culling along with all other culling at the
same time.

To just disable small feature culling do:

viewer.getCamera()-setCullingMode(
 viewer.getCamera()-getCullingMode() 
 ~osg::CullSettings::SMALL_FEATURE_CULLING);

Robert.


I built a prototype that has one point primitive on a globe. If I use
SMALL_FEATURE_CULLING the point disappears. But if I use
VIEW_FRUSTUM_SIDES_CULLING then the point is displayed. But, as you
pointed out using only VIEW_FRUSTUM_SIDES_CULLING will disable cluster
culling.

In the meantime, I've implemented my own over the horizon culling to
solve the original problem.

I suppose the question now becomes why does the point primitive
disappear when I use SMALL_FEATURE_CULLING with osgViewer?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] PointSprites = small feature culling = ClusterCullingCallback

2007-07-04 Thread sherman wilcox

On 7/4/07, Robert Osfield [EMAIL PROTECTED] wrote:

On 7/4/07, sherman wilcox [EMAIL PROTECTED] wrote:
 I built a prototype that has one point primitive on a globe. If I use
 SMALL_FEATURE_CULLING the point disappears. But if I use
 VIEW_FRUSTUM_SIDES_CULLING then the point is displayed. But, as you
 pointed out using only VIEW_FRUSTUM_SIDES_CULLING will disable cluster
 culling.

 In the meantime, I've implemented my own over the horizon culling to
 solve the original problem.

Cluster culling should work, my suggestion for disabling just small
feature culling is all that should be required to fix things.

 I suppose the question now becomes why does the point primitive
 disappear when I use SMALL_FEATURE_CULLING with osgViewer?

The bounding sphere of the geometry will be projected into screen
space, if its smaller than the small feature cutoff size then it'll be
culling.  A single point geometry will have a bounding sphere of 0
radius so will be culled.



Yes, it all works now. There was a mistake in my code. Sorry for the bother.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] PointSprites = small feature culling = ClusterCullingCallback

2007-07-03 Thread sherman wilcox

I'm using osg::PointSprites on an ellipsoid. To overcome terrain
intersection problems between the sprites and the ellipsoid I disabled
depth testing on the sprites. Problem solved. However, I then have the
problem of sprites showing through the ellipsoid when you spin the
globe around such that the sprites are on the other side of the globe.
So, I decided to use osg::ClusterCullingCallback to solve that
problem. Followed the example in osgfadetext but the cluster culling
didn't work. After some debugging I discovered that disabling small
feature culling was preventing the Cluster culling from working. But,
if I don't disable small feature culling the point sprites don't
display.

What should I do here?

BTW, I'm disabling small feature culling via:
viewer.getCamera()-setCullingMode(osg::CullSettings::VIEW_FRUSTUM_SIDES_CULLING);
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Billboard drawables and osg::Drawable::CullCallback

2007-06-28 Thread sherman wilcox

Question: do drawables that belong to billboards support cullcallbacks?

I can build a simple piece of geometry and the cullcallback works
fine. I can use an AutoTransform and attach a cullcallback to the
drawable within the geode, that works. However, if I attach a
cullcallback to a drawable that belonds to a Billboard, the
cullcallback is never called. I can attach a node callback to the
billboard itself. That gets called. But I need to know when a given
drawable is not culled within a Billboard object. I was hoping to use
osg::Drawable::CullCallback.

What am I missing here?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] billboards - resizing

2007-06-25 Thread sherman wilcox

I'm investigating how to make an osg::Billboard resize based upon eye
distance. Something similar to osgText::Text and its
OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT character
size mode.

My first question is this: does anything similar already exist in
osg::Billboard and I just missed it?

In my trivial example, I have a single quad with an attached texture.
This billboard is set to rotate to eye. I wish to resize the quad so
it shrinks as the eye moves closer to it.

I suppose a simpler way of asking this question is this:
How can I scale geometry in a leaf node at runtime?

I suppose I could use a node callback and scale the vertex data
directly. Is there a more elegant way?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] billboards - resizing

2007-06-25 Thread sherman wilcox

Thanks Paul. That should do the trick.

On 6/25/07, Paul Martz [EMAIL PROTECTED] wrote:

Instead of using a Billboard, use an AutoTransform node with a single Geode
child, and store your quad as a Drawable attached to the Geode.

AutoTransform has a mode that forces its children to face, and scale to, the
screen.

Hope that helps,

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


 I'm investigating how to make an osg::Billboard resize based
 upon eye distance. Something similar to osgText::Text and its
 OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT
 character size mode.

 My first question is this: does anything similar already
 exist in osg::Billboard and I just missed it?

 In my trivial example, I have a single quad with an attached texture.
 This billboard is set to rotate to eye. I wish to resize the
 quad so it shrinks as the eye moves closer to it.

 I suppose a simpler way of asking this question is this:
 How can I scale geometry in a leaf node at runtime?

 I suppose I could use a node callback and scale the vertex
 data directly. Is there a more elegant way?
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] performance of debug builds

2007-06-19 Thread sherman wilcox

Something to look into outside of rendering is iterator debugging.

http://msdn2.microsoft.com/En-US/library/aa985939(VS.80).aspx

On 6/19/07, Stefan Kombrink [EMAIL PROTECTED] wrote:

Thanks, Paul, I tried what you've suggested and it improved the fps.

But still something annoys me:
Under VirtualBox I get 25 fps, under native Win 7 fps ( twice as fast
as before).
This is not supposed to be that way, is it?

Now I'll rebuild openscenegraph maybe I've mangled something up with
the libs or whatever and write a NodeVisitor to change those render
bin attributes.

When I got news in the issue I'll post it here...

Stefan 8^)
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] performance of debug builds

2007-06-19 Thread sherman wilcox

On 6/19/07, Stefan Kombrink [EMAIL PROTECTED] wrote:

Anyone familiar with VS knows where to put a #define
_HAS_ITERATOR_DEBUGGING  0?
Must be possible somewhere in the Project Settings but build times
of a Debug configuration are too high to poke around.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



Under project properties = Configuration Properties = C/C++ =
Preprocessor = Preprocessor definitions Add
_HAS_ITERATOR_DEBUGGING  0

I believe that's the correct and proper location. One thing I'm unsure
of is if you have to add this to the OSG build as well and recompile.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] picking - what did I intersect?

2007-06-19 Thread sherman wilcox

I have some paged geometry that I'm trying to pick. I followed the
osgpick example. This works just fine presently. However, what happens
when I introduce other models to the scene? How do I distinguish
between what I want to pick from the other geometry? The obvious way
seems to be to name the nodes and cull away nodes that don't have the
correct name. Problem is that my paged data isn't named. I suppose I
could name the top-most node and walk the intersected data's parent
list and see if I stumble across a parent with the correct name, but
this seems like a terrible hack. Is there a more elegant way?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] automated CMake?

2007-06-18 Thread sherman wilcox

Again, on Windows, here's an excerpt out of a batch file I use to
build OSG. You should call this file from within the Visual Studio
command prompt. I use Vista x64 and Visual Stuion 2005 (8.0).

Note: the %1 is a command line argument I pass to this batch file.
That argument being either build or rebuild

***
cd\
cd 3rdparty\osg\OpenSceneGraph\

IF /I %1==rebuild cmake
-DCMAKE_INSTALL_PREFIX:PATH=C:\3rdparty\osg\common\OpenSceneGraph .

devenv OpenSceneGraph.sln /%1 Debug /project ALL_BUILD
devenv OpenSceneGraph.sln /%1 Debug /project INSTALL
devenv OpenSceneGraph.sln /%1 Release /project ALL_BUILD
devenv OpenSceneGraph.sln /%1 Release /project INSTALL
***

That's pretty much it. I have an OSG 3rdparty folder in
c:\3rdparty\osg\3rdparty.

On 6/18/07, Serge Lages [EMAIL PROTECTED] wrote:

Hi Andy,

On 6/18/07, Andy Skinner [EMAIL PROTECTED] wrote:
 Hi.  I need to get the Open Scene Graph into an automatic build system,
 which is how we keep our 3rd party software.  We'd like to check in the
 downloaded software plus minimal configuration stuff if we could.  We'd
 like to not have to run CMake manually, as well.  (An alternative would
 be to download a version of OSG, run cmake manually to produce all we
 need, and check all that in.  I'd rather not do it this way.)

 I see that on Unix I can run cmake instead of ccmake, and I'm trying
 that now.  If I wanted to specify some options, could I do so without
 using the UI?

 I need to build on Macs, Linux (32 and 64 bits), Windows (32 and 64
 bits), and Solaris 64 bits.  For now, I think we'd be happy for the Macs
 to build like Unix if they can.  So can I get all these to build
 automatically?

 I saw that I could use CMakeSetup.exe on Windows instead of ccmake.  Is
 there an equivalent that wouldn't use the UI (like cmake vs ccmake on
 linux)?


On Windows you can call cmake.exe with options like -D to specify options.

--
Serge Lages
http://www.magrathea-engine.org
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] 2.0 tomorrow, please test tonights SVN :-)

2007-06-14 Thread sherman wilcox

Tested latest on Vista x64 using Visual Studio 2005 Service Pack 1.
Compiled and ran an in-house sample app successfully.

On 6/14/07, Robert Osfield [EMAIL PROTECTED] wrote:

Hi All,

It would seem that 1.9.9 went OK on the major platforms.  I've been
fixing a few features today, as well as updating some shaders in the
OpenSceneGraph-Data, and have merged an few submissions from users.
These changes need testing so I'd appreciate if you could suffer me
one more time, and test test test ;-)

Many thanks for your assistance,
Robert.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Trackball, can't throw

2007-06-10 Thread sherman wilcox

Ditto that, just updated earlier today and I'm seeing the same problem.

On 6/10/07, Paul Martz [EMAIL PROTECTED] wrote:


Hi Robert -- I just did an update this evening and I'm now unable to perform
a throw with the TrackballManipulator. For example, osgviewer cow.osg,
left mouse motion and release while in motion -- no longer puts the cow into
a spin, as it used to.

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

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Database paging

2007-06-08 Thread sherman wilcox

Maybe I'm oversimplifying, but:

 osg::ref_ptrosg::Group root = new osg::Group();
 osg::ref_ptrosg::Node mars = osgDB::readNodeFile(marsfilename);
 root-addChild(mars.get());
 root-addChild(someOtherNode.get();
 viewer-setSceneData(root.get());

Where viewer == osgProducer::Viewer

On 6/8/07, K Galloway [EMAIL PROTECTED] wrote:

Hi,

I have a quick (hopefully) question about Database paging.  Basically, I
have a model made using osgdem (of Mars), and I have a viewer that needs to
be able to read the file from osgdem, as well as being able to add nodes to
it inside the viewer.

I know the 1.9.x viewer has built in support for this, but I'm afraid I'm
stuck using 1.2, because the 1.9.x series doesn't quite work on the setup we
have here.  So, where would be a good place to start to look at this
functionality?  I've been looking at the osgsimplepager example, but so far
have come up with little to work on it.

Any help would be much appreciated.

Thanks,
Kevin

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Re: intersection tests w/paged databases

2007-05-31 Thread sherman wilcox

On 5/31/07, Robert Osfield [EMAIL PROTECTED] wrote:

If you are willing to duplicate all the paged data then you could just
run a separate process in the background of the graphics app that
works entirely on its own scene graph, and has its own paging code.


Is it strictly necessary to duplicate all the paged data? Can the vis
app and the intersection app share the same paged database? If so,
could the sharing itself cause frame breaks on the vis app?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Re: intersection tests w/paged databases

2007-05-31 Thread sherman wilcox

On 5/31/07, Robert Osfield [EMAIL PROTECTED] wrote:

On 5/31/07, sherman wilcox [EMAIL PROTECTED] wrote:
 On 5/31/07, Robert Osfield [EMAIL PROTECTED] wrote:
  If you are willing to duplicate all the paged data then you could just
  run a separate process in the background of the graphics app that
  works entirely on its own scene graph, and has its own paging code.

 Is it strictly necessary to duplicate all the paged data? Can the vis
 app and the intersection app share the same paged database? If so,
 could the sharing itself cause frame breaks on the vis app?

Sharing brings in the issue of sycnronization of the DatabasePager and
the intersection codes which is where things start getting
complicated.

Robert.


Just to be clear, when I say sharing, I'm referring to sharing the
.ive files on disk and not sharing a single pager within the same
process, etc.

Consider the following scenario: 4 machines.

- Machine A: contains the terrain model
- Machine B  C: vis clients that are displaying the terrain model
from Machine A
- Machine D: Intersection server that performs intersection tests
against the terrain model on Machine A

Would synchronization issues erupt from such a configuration? I could
quickly test such an animal, but absence of any issues doesn't prove
that it's reliable!
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] converting between coordinate systems

2007-05-30 Thread sherman wilcox

I have Geode object that is loaded via a plugin. This geode has
thousands of drawables with each drawable containing a collection of
vertexes. The issue is that these vertexes are in the wrong coordinate
system. I need to convert these vertexes from coordinate system A to
coordinate system B. I know how to perform this conversion on paper.
As to performing this coordinate system conversion on the vertexes in
the drawables, the way that jumps out at me is to iterate through all
the drawables/vertexes and convert them one by one.

My questions is this: is there a proper method for converting these
vertexes from one coordinate system to another or is what I'm
proposing the way to do it? I'm wondering if I should be using some
sort of node visitor or some other way. I'd rather use the facilities
provided by the framework when possible.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Re: intersection tests w/paged databases

2007-05-30 Thread sherman wilcox

Since I didn't get any replies the first time around, I'd like to
offer a possible solution.

What if the main visualization app sent queries (TCP/IP, IPC, etc.) to
another process which performed all the intersection tests.
Admittedly, this isn't high-performance, but performing these
intersection tests from another app most certainly wouldn't result in
dropped frames. For my particular problem I can suffer through the
lazy intersection tests. One question I have is whether or not I can
share the same paged database between two different apps.

Thoughts...comments?

On 5/16/07, sherman wilcox [EMAIL PROTECTED] wrote:

Hello everyone. I'm presently working on performing accurate runtime
intersection tests of paged databases. I'm trying to perform these
tests in a manner that doesn't result in dropped frames.

My app uses an ellipsoid model of the earth that is paged. The terrain
model itself is several GB in size and was built using osgdem. I have
point data that I need to place just above the terrain @ runtime. I do
not know ahead of time the latitude/longitude of the points. I can get
as many as 20 a second at peak times. I wrote a small sample app using
osgSim::LineOfSight to get the correct height. This works, but I'm
told that running it on a background thread that isn't sync'ed with
the scenegraph is not safe. If I run it from the main rendering loop,
the intersection test can sometimes block for several seconds. Given
the quantity of points that are coming in, the performance hit could
make the app unusable.

My question for the community is this: how do you guys perform
accurate intersection tests against paged databases that don't result
in frame loss?


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] can someone reccomend a good starting point ?

2007-05-29 Thread sherman wilcox

Some advice, read Paul Martz's quick start guide. All of it. I don't
think there will be much difference between OSG 1.9.x and 2.0 as far
as the quick start guide is concerned. The guide is a very good intro
IMHO.

As to VRML and OSG. Just looked, there appears to be a VRML plugin.
Haven't tried it myself. Here's a note from the plugin directory:


# Replacement VRML plugin for  OpenSceneGraph. #
# (C) J.Ciger B.Herbelin T.Abaci 2003,2004 VRlab EPFL  #


- dependencies:
   OpenVRML (http://openvrml.org/)
   OpenSceneGraph (http://www.openscenegraph.org/)

CAUTION!
This version of the plugin requires OpenVRML 0.14.3. Version 0.16.2
*WILL NOT* work!


BTW, this plugin can be found in the source distribution @
./OpenSceneGraph/src/osgPlugins/vrml

If it were me I'd start with downloading the binary releases and see
if I can quickly visualize a VRML file from the command line like so:
osgviewer test.vrml

Here's the 1.2 binaries:
Windows: 
http://www.openscenegraph.org/downloads/binaries/osg1.2_setup_2006-09-13.exe

OSX: http://www.openscenegraph.org/downloads/binaries/OpenSceneGraph-1.2-2.dmg

Fedora Core 
4:http://www.openscenegraph.com/osgwiki/pmwiki.php/Downloads/FedoraCore4

There's also a dependencies page @
http://www.openscenegraph.com/osgwiki/pmwiki.php/Downloads/Dependencies

You can search this mailing list here:
http://openscenegraph.org/archiver/osg-users/

Bryan, in your address I see Torrey Pines. Is that THE Torrey Pines?

On 5/29/07, Bryan Berg [EMAIL PROTECTED] wrote:

Hi,

Apparently the book that I downloaded is not outdated, but rather indated
 (hah !), since osg 2.0 is not out yet.

So I am wondering if I can get some advice on where to start.

I've read that one should open up a preexisting application and go from
there.

I currently have OSG 1.9.

A little bit where I'm coming from:

I have written a 3D modelling program in matlab which creates a VRML file
after looping through a set of images taken from a microscope.

I would like to be able to view this model using OSG, since examples I've
seen show fast rendering among other things.

I have also written an animation of a growin neuron using matlab and
VRML's extrusion capabilites, which I believe osg has, and I would like to
recreate this in osg.

Any ideas ? - ie good sample apps to begin with or ...

Thanks so much,



Bryan

Bryan Berg
The Salk Institute LOG-G
10010 N. Torrey Pines Rd
La Jolla CA 92037
Phone: 858 453-4100 x 1435


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Re: OpenSceneGraph-1.9.6 release made

2007-05-28 Thread sherman wilcox

I'd like to keep the docs with the source. It's convenient and 14MB
isn't that much this day and age.

On 5/28/07, Robert Osfield [EMAIL PROTECTED] wrote:

On 5/28/07, Robert Osfield [EMAIL PROTECTED] wrote:
 In the release tarball I've included the
 doxygen refernence docs.

I just checked the size of the OpenSceneGraph-1.9.6.zip file and its a
whopping 14Mb, and the majority is down to the doxygen docs.  The
1.9.5.zip without docs is 4.6Mb, so that's quite a payload that
doxygen adds.

What do users think about the extra size?  Should we distributed the
ref docs separately?

Robert.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Re: Tessellator troubles

2007-05-27 Thread sherman wilcox

Found the issue. From my reading it appears the problem is indeed in
the Tessellator class and not the ESRI plugin, at least for this one
file I was attempting to load. The core of the problem is that I was
loading a model with a large number of points, a very large number.
The Tessellator class wasn't capable of handling that many points. A
small patch should repair the issue.

On 5/25/07, sherman wilcox [EMAIL PROTECTED] wrote:

I recently started to experiment with the ESRI shapefile plugin. The
first file I loaded was a shapefile of Alaska. This shapefile is a
polygon shapefile. The ESRI plugin loaded and displayed the file
without any problems. Overall, what was on-screen looked like the
state of Alaska. Upon closer examination of the data I noticed that
parts of the model looked odd. Some polygons simply shouldn't have
been there.

I loaded the same shapefile in ArcView and an in-house OpenGL based
shapefile  viewer. ArcView and the in-house app matched and displayed
the shapefile like you'd expect. No odd polygons out of place. More
importantly, the OSG output didn't match either app.

So I started to examine the ESRI plugin code. Nothing jumped out at
me. I limited my examination to just the code that handles polygons
(ESRIShape::Polygon). I then dumped all the points that this plugin
loaded to a text file. I modified the output of my in-house OpenGL
based shapefile viewer so it dumped loaded points to a text file as
well. The text files from both the in-house OpenGL app and OSG
matched. Hmmm.

At this point I have a shapefile that I believe to be valid, but the
visuals I'm seeing from OSG don't match my other apps. However, the
points that the OSG ESRI plugin produces seem to match the point
output of my other app. I'm starting to suspect a tessellation issue.

I then used the ESRI plugin to again dump the points of this Alaska
shapefile to a text file. I hacked up a small OpenGL app to display
the points from this text file and added code to tessellate the points
using OpenGL's built-in tessellation features. The output of this
display matched ArcView. I then modified a simple OSG app to ingest
the raw points and used osgUtil::Tessellator to tessellate them. The
output from this OSG app wasn't correct. It matched the output of my
original ESRI experiments.

At this point it appears that either I'm mis-using the
osgUtil::Tessellator class or something is broken. I believe I setup
the osgUtil::Tessellator correctly as to winding, boundaries, etc.

One last tidbit, I'm using the latest snapshot (as of last night) out of SVN.

Has anyone else experienced problems with OSG's tessellator? Would
anyone like my source, sample points, shapefile, etc.?


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] Tessellator troubles

2007-05-25 Thread sherman wilcox

I recently started to experiment with the ESRI shapefile plugin. The
first file I loaded was a shapefile of Alaska. This shapefile is a
polygon shapefile. The ESRI plugin loaded and displayed the file
without any problems. Overall, what was on-screen looked like the
state of Alaska. Upon closer examination of the data I noticed that
parts of the model looked odd. Some polygons simply shouldn't have
been there.

I loaded the same shapefile in ArcView and an in-house OpenGL based
shapefile  viewer. ArcView and the in-house app matched and displayed
the shapefile like you'd expect. No odd polygons out of place. More
importantly, the OSG output didn't match either app.

So I started to examine the ESRI plugin code. Nothing jumped out at
me. I limited my examination to just the code that handles polygons
(ESRIShape::Polygon). I then dumped all the points that this plugin
loaded to a text file. I modified the output of my in-house OpenGL
based shapefile viewer so it dumped loaded points to a text file as
well. The text files from both the in-house OpenGL app and OSG
matched. Hmmm.

At this point I have a shapefile that I believe to be valid, but the
visuals I'm seeing from OSG don't match my other apps. However, the
points that the OSG ESRI plugin produces seem to match the point
output of my other app. I'm starting to suspect a tessellation issue.

I then used the ESRI plugin to again dump the points of this Alaska
shapefile to a text file. I hacked up a small OpenGL app to display
the points from this text file and added code to tessellate the points
using OpenGL's built-in tessellation features. The output of this
display matched ArcView. I then modified a simple OSG app to ingest
the raw points and used osgUtil::Tessellator to tessellate them. The
output from this OSG app wasn't correct. It matched the output of my
original ESRI experiments.

At this point it appears that either I'm mis-using the
osgUtil::Tessellator class or something is broken. I believe I setup
the osgUtil::Tessellator correctly as to winding, boundaries, etc.

One last tidbit, I'm using the latest snapshot (as of last night) out of SVN.

Has anyone else experienced problems with OSG's tessellator? Would
anyone like my source, sample points, shapefile, etc.?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] OSG and Vista 64

2007-05-17 Thread sherman wilcox

OSG and Vista 64

Hello everyone, sorry to bring this up again but I wanted to get some
of your experiences using the latest OSG with Vista 64 bit edition.
The last substantial thread I read on the subject was dated late
February. Results seemed mixed then. I'm wondering how everyone is
getting along now.

I'm considering making several large hardware purchases and I have to
decide between XP-64 or Vista-64. I need the extra RAM that a 64-bit
OS provides (can't use Linux for this project.) The hardware itself
will be from Dell. I'm looking at purchasing quad-core systems to take
advantage of osgViewer's multi-thread model..well that and other
reasons.

Comments?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] intersection tests w/paged databases

2007-05-16 Thread sherman wilcox

Hello everyone. I'm presently working on performing accurate runtime
intersection tests of paged databases. I'm trying to perform these
tests in a manner that doesn't result in dropped frames.

My app uses an ellipsoid model of the earth that is paged. The terrain
model itself is several GB in size and was built using osgdem. I have
point data that I need to place just above the terrain @ runtime. I do
not know ahead of time the latitude/longitude of the points. I can get
as many as 20 a second at peak times. I wrote a small sample app using
osgSim::LineOfSight to get the correct height. This works, but I'm
told that running it on a background thread that isn't sync'ed with
the scenegraph is not safe. If I run it from the main rendering loop,
the intersection test can sometimes block for several seconds. Given
the quantity of points that are coming in, the performance hit could
make the app unusable.

My question for the community is this: how do you guys perform
accurate intersection tests against paged databases that don't result
in frame loss?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


[osg-users] cmake and windows

2007-04-12 Thread sherman wilcox

Thanks to everyone that worked on making OSG work with cmake under
Windows. Nicely done.

Using the latest code in SVN, I managed to get OSG compiling using
cmake. However, I did run into a couple of things I want to ask
everyone about now. First thing that jumps out is OpenThreads. When I
run cmake I get an error like so:

Please set the following variables:
OPENTHREADS_INCLUDE_DIR
OPENTHREADS_LIBRARY

I thought cmake was referring to environment variables, but running
set from the command line reveals:

OPENTHREADS_INCLUDE_DIR=C:\osg\common\openthreads\include
OPENTHREADS_LIBRARY=C:\osg\common\openthreads\lib

So, can anyone tell me how to repair this error that cmake is
referring to? I know of one way, which is to explicitly set the cache
value in the dialog, but I'd like to be able to automate things
(nightly builds and all) so eliminating or at least knowing more about
the error would be helpful.

Secondly, freetype. I notice that a freetype project is being
generated. Anyone else having this problem or might know what's going
on?
___
osg-users mailing list
[EMAIL PROTECTED]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] Windowing OpenSceneGraph

2007-02-19 Thread sherman wilcox

  - try a quick google search on osgQT
  - search the mailing list archives @
  http://openscenegraph.org/archiver/osg-users/ for help
  - get the latest out of CVS and look for osgsimpleviewerQT3 or
  osgsimpleviewerQT4 in examples

That's a start.


On 2/19/07, Jeremy [EMAIL PROTECTED] wrote:


I'm new to OpenSceneGraph and I'm having a hard to
time finding relevant documentation (or tutorials) on
the topic of interfacing a windowing toolkit to osg.
I would like to use Trolltech's QT as the gui, and
still make use of OSG.  I found that I'm to write a
GUIEventAdapter and GUIActionAdapter (part of the
osgGA namespace).  But since I'm new to OSG, this
seems a bit obfuscated.

I would appreciate any help or useful information.
For instance, any examples implementing GLUT, QT, etc
would be helpful.

Thanks,
pseudosig





Never Miss an Email
Stay connected with Yahoo! Mail on your mobile.  Get started!
http://mobile.yahoo.com/services?promote=mail
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] updating dynamic data - best practices

2007-02-18 Thread sherman wilcox

My question is this: what's the best way to update dynamic data within the
OSG framework?

In this particular instance, I have data that is organized in clumps all
tied to a specific moment in time. Aircraft position data is a good
illustration. For example, I could generate a database that contains
aircraft position information that spans hours if not days. This data is
often organized such that I can display the position of all aircraft in my
database for a specific time. For example, suppose I choose to display the
positions of all aircraft in my database @ 12:00 yesterday. After I retrieve
all that data and have it in memory, I could end up with thousands of
elements. If I increment the time to say 12:30, I get a slightly different
dataset, again with thousands of elements. If I increment the time rapid
enough, I can animate the paths of these aircraft on-screen. Problem is,
there are thousands upon thousands of elements that could be displayed
on-screen at any given time. I'm not so concerned with how to visualize this
data or even the performance of the rendering portion of the problem. In my
mind, rendering the data is the easy part. The more difficult portion of
this problem for me is how to update the nodes dynamically without dropping
frames.

I've worked with OSG long enough that I know of a couple of different ways
to tackle such a problem, but none seem elegant. For that matter, I suspect
I'd incur a performance penalty every time I try to update the nodes due to
the shear number of elements.

One method I've considered is to retrieve the new list of elements on a
background thread and update the node in question that holds all this data
to display after sync. But I'm not so sure this is the best way.

Does anyone have any suggestions of what's the proper way to go about
something like this? An OSG example or perhaps a bit of advice from someone
with more experience than myself would be helpful.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Debugging VS7

2007-02-08 Thread sherman wilcox

This happens to me from time to time.  Here's another thing to try, when you
startup the debugger, look in the output window look for a line like so:
'osgvislib_driver_console.exe': Loaded
'C:\bsi\3rdparty\osg\OpenSceneGraph\bin\win32\osgTextd.dll', No symbols
loaded.

Notice the part that says No symbols loaded. That line should read:
'osgvislib_driver_console.exe': Loaded
'C:\bsi\3rdparty\osg\OpenSceneGraph\bin\win32\osgTextd.dll', Symbols loaded.


The fix, at least for me, is to re-compile the module in question. Just open
OSG in Visual Studio and right click on the offending project and select
Project Only = Rebuild Only $PROJECTNAME

Another note, my path includes a reference to OpenSceneGraph\bin\win32

Let me know if that does the trick. If that fixes your problem as well, we
should probably include this in the FAQ.



On 2/8/07, Chuck Cole [EMAIL PROTECTED] wrote:


Zach,

In the project settings for Core osgViewer, change the C/C++ - General -
'Debug Information Format' setting to 'Program Database for Edit 
Continue
(/ZI)' (it is set to 'Program Database (/Zi)' by the CVS project file).
This is how VS8 is setup and I believe VS7 is the same, but the exact
names
and menu options may be slightly different.

After changing this setting, I was able to hit breakpoints within the
osgViewer::Viewer class whereas previously I was unable to do so.
Hopefully, this is your intent as well.

chuck

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:osg-users-
 [EMAIL PROTECTED] On Behalf Of Zach Deedler
 Sent: Wednesday, February 07, 2007 9:23 PM
 To: 'osg users'
 Subject: [osg-users] Debugging VS7

 Anybody have a clue why I can't step into osgViewer::Viewer code in
Visual
 Studio 7 when debugging OSG CVS?  Its driving me crazy!


 Zach

 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] const problem - inherit from osg::Drawable

2007-02-08 Thread sherman wilcox

I need to perform some raw OpenGL operations. So I took the teapot example
and used that. So far so good. Problem is that the drawImplementation
function is const. Since it's const, I can't get a non-const reference to a
my vector container that is a member of this class. Like so:

LabelPoint point = _labels[0]; //fails
const LabelPoint point = _labels[0]; //OK

What's the correct way to approach this problem? Another callback? I need
to modify members of this container @ runtime in the draw routine.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] const problem - inherit from osg::Drawable

2007-02-08 Thread sherman wilcox

Yes, well, I feel rather silly now. Here I was looking for a much more
exotic solution. Sorry for the post.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Re: Names for different threading models

2007-02-06 Thread sherman wilcox

I think if you had a count of the number are intently reading this
thread, the count would be very high.  I may not have anything to
contribute but I am watching with eager anticipation.

Ditto
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] lots and lots of text on an ellipsoid model

2007-02-04 Thread sherman wilcox

Just a note, The osgText::String uses ints rather shorts for each

character, I did this so that we could map any character sets beyond
even unicode two byte format.



Noted.




The memory load is indeed way overboard.  osgText hasn't so far been
an issue, and its design and evolution has focused at all on keep
memory overhead down to enable 100's of thousands of labels.

For your own purposes all the fancy feature probably don't mean much,
and could probably get away with a much lighter weight osgText::Text
implementation.




Actually, there are a lot of features in osgText::Text that I find
appealing. In fact, I'd like to use osgText::FadeText in the future. I'd
like to re-use a single osgText::Text object. More on that below.



I think the cleanest approach would be to have a more lightweight
osgText text implementation - you really shouldn't have to go round
jumping through hoops trying to do what you are doing.

Would such a text implementation compliment the exiting
implementation?  Have a base text class then a text + fancy features
subclass from it?

One of the most effective ways of reducing the overhead would be to
dynamically compute all the character quads on the fly.  This would be
slower to render, but probably fast enough for most purposes.  It'd be
interesting to see just what throughput you could achieve.  If you
only have say a couple of hundred text labels on screen at any one
time things might work just fine.

Another element to reducing the load would be sharing the text
options, rather than have each osgText::Text have all its own
settings.

Such a new class obviously takes some coding to implement. The actual
rendering part would be easy - its just a set of quads with tex coords
into one or more texture atlas', the positioning of the quads requires
support for kerning.




I thought about implementing my own lightweight version of osgText::Text,
but the more I considered it the more I realized I'd probably end up
re-inventing osgText::Text. There's a lot of functionality of osgText::Text
that I'd like to preserve. I think if I go the lightweight text class route
I will end up right where I'm at now.

I did a quick test this afternoon. I modified my simple quadtree class to
store GL_POINT primitives instead of osgText::Text for a label. Memory usage
was negligable and performance was
outstanding. Admittedly storing/rendering basic points instead
of osgText::Text objects isn't quite comparing apples to apples, but it was
encouraging to see all those points pop into view on cue as I hopped around
the planet.

What I'd like to do is use a single osgText::Text object when I need to
render a given label. I may have 150,000+ labels in memory, but I don't
believe there will be more than a few dozen ( 100) on screen at any
moment. I'm wondering if I can insert one proxy for each label into the
scenegraph. This proxy object would be hold the bare essentials information
wise. Perhaps positional information for culling, etc. and that would be
all.  When one of these proxy objects are not culled (most will be), render
an osgText::Text object @ runtime. Sort of like the osgteapot example only
instead of rendering raw OpenGL code, render an osgText::Text object. Does
this make sense? Possible? Advisable?

I'd like to use osgText to render my text but I obviously can't use one
osgText object per label.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] lots and lots of text on an ellipsoid model

2007-02-03 Thread sherman wilcox

About a week ago I posted a couple of questions relating to the display of
city names on an earth model is OSG. While I was working on the problems I
posed in that thread, I discovered a new problem: my approach to displaying
city names doesn't scale very well.

I'm hoping someone here can offer me some suggestions as to how best to
approach this problem.

Here's some background info:

- there are a total of 158,526 labels
- all labels have a total character count of 1,731,844 characters not
counting zero termination
- another note: these labels are unicode (UTF-16), each character will
consume 2 bytes
- each label has the following data associated with it:
--latitude (float)
--longitude (float)
--show range (double)
--cut off range (double)

If my math is correct then each label should consume about 48 bytes on
average. All the labels (stored in unicode UTF-16) and associated
data should consume about 8MB.

My current method (the one that doesn't scale well) consists of a quadtree
(about 4 levels deep) using a LOD to hold all the geodes. Each geode holds
all the labels (labels are stored as osgText::Text objects) in a given node
in the quadtree that have the same show and cutoff range. There are two main
problems with this method: memory usage and performance. The memory usage is
enormous. For these approximately 150,000 labels the memory usage is about
500MB (to see what I mean, modify the osgHUD example and add 100,000 text
objects, each holding a single character.) The performance isn't terrible,
mainly the update traversal lags on occasion. Someone told me that
performance issues might be related to the high memory load. Either way, I'm
most concerned with the memory usage at this point.

I'm not quite sure why the memory numbers are so high. A simple
sizeof(osgText::Text) reveals that each osgText::Text object consumes about
544 bytes all by itself. 150,000+ osgText::Text objects would consume about
100MB all by themselves. That's more than I can afford just for text.

Enough background, here's my question: what's the best way to approach this?
Simple enough huh? :)  I've written these types of apps before. First time
I've used OSG to do something like this. If I was writing straight
C++/OpenGL code I would know what to do, I've done it before. But this,
using OSG, I'm not sure which direction to go.

I ***think***  I need to store each label in a stripped down custom object
to conserve memory. The question then becomes how to handle culling and
rendering of the text @ runtime. I'm convinced (could be wrong here) that I
can't store these labels as osgText::Text objects. Too much memory is
consumed. Is it possible to re-use a single osgText::Text object?

I'd like to take advantage of the facilities provided by OSG as much as
possible.  I'm left wondering how else to do this? How can I draw these text
labels @ runtime without storing each label in the scenegraph as  an
osgText::Text object? I want to take advantage of the features that
osgText::Text offers like auto rotation to screen, etc. I also need to
adjust the altitude of a displayed label @ runtime so it doesn't sink and
become obscured by the terrain.

What to do?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] text on an ellipsoid model

2007-01-29 Thread sherman wilcox

I can't seem to find a straight-forward way to calculate the camera altitude
above an ellipsoid. Can I extract the camera position from the modelview
matrix or is there a more elegant/correct OSG method?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] text on an ellipsoid model

2007-01-29 Thread sherman wilcox

To answer my own question:


{
 Producer::Camera *camera = viewer.getCamera(0);
 osgProducer::OsgSceneHandler *sh = dynamic_castosgProducer::
OsgSceneHandler*(camera-getSceneHandler());
 osgUtil::SceneView *sv = sh-getSceneView();
 osg::Vec3 eye, center, up;
 sv-getViewMatrixAsLookAt(eye, center, up, 1.0);

 double lat, lon, alt;
 ellipsoid-convertXYZToLatLongHeight(eye.x(), eye.y(), eye.z(), lat, lon,
alt);
 printf( %f, %f, %f\n, osg::RadiansToDegrees(lat),osg::RadiansToDegrees(
lon),alt);
}
Is this the correct way? The results seem reasonable. Also, I assume
convertXYZToLatLongHeight(...)
returns height in meters. Correct?


On 1/29/07, sherman wilcox [EMAIL PROTECTED] wrote:


I can't seem to find a straight-forward way to calculate the camera
altitude above an ellipsoid. Can I extract the camera position from the
modelview matrix or is there a more elegant/correct OSG method?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] text on an ellipsoid model

2007-01-29 Thread sherman wilcox

Something is not quite right. I inserted this code into my app and the
altitude it returns seems a little high:

{
osg::Vec3 eye, center, up;
sv-getViewMatrixAsLookAt(eye, center, up, 1.0);
osg::ref_ptrosg::EllipsoidModel ellipsoid = new osg::EllipsoidModel();
double lat, lon, alt;
ellipsoid-convertXYZToLatLongHeight(eye.x(), eye.y(), eye.z(), lat, lon,
alt);
double miles = (alt / 1000.0) * 0.621371192237334;
printf( %f, %f - %f\n, osg::RadiansToDegrees(lat),osg::RadiansToDegrees(
lon),miles);
}


I downloaded google earth to compare my numbers against and here's what I
got:

OSG...aprox 11,000 miles
http://s91927682.onlinehome.us/osgE.JPG

Google Earth...approx. 5,000 miles
http://s91927682.onlinehome.us/ge.JPG

Admittedly, my method isn't scientific, but it appears that my calulcation
of the altitude is higher than that of google earth. Then again, it could be
just me.

Thoughts?

On 1/29/07, Robert Osfield [EMAIL PROTECTED] wrote:


Hi Sherman,

On 1/29/07, sherman wilcox [EMAIL PROTECTED] wrote:
 To answer my own question:

 {
   Producer::Camera *camera = viewer.getCamera(0);
   osgProducer::OsgSceneHandler *sh = dynamic_castosgProducer
 ::OsgSceneHandler*(camera-getSceneHandler ());
   osgUtil::SceneView *sv = sh-getSceneView();
   osg ::Vec3 eye, center, up;
   sv-getViewMatrixAsLookAt(eye , center, up, 1.0);

   double lat, lon, alt ;
   ellipsoid-convertXYZToLatLongHeight(eye .x(), eye.y(), eye.z(), lat,
lon,
 alt);
   printf( %f, %f, %f\n , osg::RadiansToDegrees(lat),
 osg::RadiansToDegrees(lon),alt );
 }Is this the correct way? The results seem reasonable. Also, I assume
 convertXYZToLatLongHeight(...) returns height in meters. Correct?

Yes height in meters.  I recommend using Vec3d's rather than Vec3 to
get the full precision that you'll need to accurate figures from
geocentric coords.  EllipsoidModel and the Camera's work with doubles
too so should work fine.

Robert.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] text on an ellipsoid model

2007-01-29 Thread sherman wilcox

On 1/28/07, Robert Osfield [EMAIL PROTECTED] wrote:


Hi Sherman,

On 1/28/07, sherman wilcox [EMAIL PROTECTED] wrote:
 I'm wondering how well the OSG can handle tens of thousands ( 100,000)
of
 these city names in terms of performance and memory consumption.

100,000 is quite a few, how it impacts on things on things depends on
how you manage the whole scene - at all 10,000 loaded at once?
Created on demand?  Are they LOD'd?



All 100,000 will be in memory at once. However, only about a hundred or so
should be on-screen at any given moment.

I have a question, seeing how this is just a text element on screen, how
would making the text objects LOD help? I've seen code written by someone
else doing basically the same thing I'm doing and their city name objects
inherited from osg::LOD. Never really understood that.


I'd suggest doing an experiment with loadeding all at once then bit by

bit add the various tricks to get things working sweetly.  You won't
ever have 100,000 names on screen at once so LOD and a good balanced
quad tree will probably do the trick.



Would placing all 100,000 objects in a single group and then running
Optimizer (SPATIALIZE_GROUPS) do the trick?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] text on an ellipsoid model

2007-01-28 Thread sherman wilcox

Yegor, Robert, thanks for the info. I'll take a closer look at this tomorrow
and get back if I have any more questions.

I'm wondering how well the OSG can handle tens of thousands ( 100,000) of
these city names in terms of performance and memory consumption.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] text on an ellipsoid model

2007-01-27 Thread sherman wilcox

I have an OSG app that can display city names @ a given lat/lon on an
ellipsoid model of the earth created with osgdem. I want to extend this a
bit in two ways. First, I want to control when a given city pops up into
view. Second I want to fade the text in when that threshold has been
reached.

First question: How do I trigger text to show or hide? I've considered using
the camera altitude above the earth as the reference point and fade a given
city name in when the camera reaches this altitude. Sound reasonable?
Second question: How do I fade the text in? Do I use a node callback?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] unicode woes

2007-01-25 Thread sherman wilcox

I found it. The problem was the font I was using didn't support korean text.
When using unicode it helps to use a unicode capable font! :)

I found some free unicode fonts @ http://www.wazu.jp/index.html
Good website.




On 1/25/07, Robert Osfield [EMAIL PROTECTED] wrote:


Hi Sherman,

Have a look at the osgText::String class, there are couple of options
for passing in various non ascii characters sets.

Robert.

On 1/24/07, sherman wilcox [EMAIL PROTECTED] wrote:
 I'm hoping someone can anwser a unicode/OSG question. I'm trying to
display
 Korean text using the osgHUD example. I'm using Visual C++ 8.0 (ie
visual
 studio 2005). Here's what I did:


 1) osghud.cpp: added #include tchar.h
 2) in osg::Node* createHUD () I modified the block that contains
 text-setText( Head Up Displays are simple :-)); to read:



 {
   osgText::Text* text = new osgText::Text;
   geode-addDrawable( text );
   text -setFont(timesFont);
   text -setPosition(position);

   typedef std::basic_string _TCHAR tstring;

   //서울 == Seoul
   tstring unicode_str = _TEXT(서울);
   wchar_t *unicode_wchar = _TEXT(서울 );
   text-setText(unicode_str .c_str()); //this doesn't work
   //text-setText(unicode_wchar); //neither does this
   position += delta;
 }

 3) I added _UNICODE to the preprocessor definition list and I set the
 Character Set under configuration properties to Unicode.

 What I get is two small squares on screen where the korean language
symbols
 should be.

 Ideas?
 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/



___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] unicode woes

2007-01-24 Thread sherman wilcox

I'm hoping someone can anwser a unicode/OSG question. I'm trying to display
Korean text using the osgHUD example. I'm using Visual C++ 8.0 (ie visual
studio 2005). Here's what I did:


1) osghud.cpp: added #include tchar.h
2) in osg::Node* createHUD() I modified the block that contains text-
setText(Head Up Displays are simple :-)); to read:


{
 osgText::Text* text = new osgText::Text;
 geode-addDrawable( text );
 text-setFont(timesFont);
 text-setPosition(position);

 typedef std::basic_string _TCHAR tstring;

 //서울 == Seoul
 tstring unicode_str = _TEXT(서울);
 wchar_t *unicode_wchar = _TEXT(서울);
 text-setText(unicode_str.c_str()); //this doesn't work
 //text-setText(unicode_wchar); //neither does this
 position += delta;
}

3) I added _UNICODE to the preprocessor definition list and I set the
Character Set under configuration properties to Unicode.

What I get is two small squares on screen where the korean language symbols
should be.

Ideas?
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] Producer-based viewer cleanup question

2006-10-18 Thread sherman wilcox
I'm using osgProducer::Viewer in a Win32 app and I'dlike to re-use the viewer object if possible. I've got things setup so I can hit a key to construct a viewer with the proper scene graph and hit another key to kill the viewer. Problem is, when I go to build another viewer after I've already built the first one I get this error message in my output window:


Producer::WGLExtensions: could not make the temporary window's context active

My viewer construction/service code resides on a separate thread. The thread loop looks like this

void threadEntry()
{

viewer-setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
viewer-setSceneData(loadRootNode());
viewer-realize();

while(run){
viewer.sync();
viewer.update();
viewer.frame();
}


viewer-sync();viewer-cleanup_frame();viewer-sync();
}

When this thread exits and viewer is deleted I get an exception:First-chance exception at 0x7c812a5b in osgvislib_driver_console.exe: Microsoft C++ exception: Win32ThreadCanceled at memory location 0x0352f967

This exception is generated by OpenThreads.

I thinking that I'm either not cleaning up things properly or I'm trying to do something that shouldn't be tried.
Suggestions?

P.S.
I'm running XP Pro using Visual Studio 2005.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Producer-based viewer cleanup question

2006-10-18 Thread sherman wilcox
One thing to add. It does seem to work...well let me clarify that: I haven't found any issues with my limited testing. But, the Producer error message and the thread exception makesmethinksomethinghasgoneoffintotheweeds.
 I'll go another route for the time being and disallowthereallocation.Don, let me know if you get around to this and I'll be glad to test things out for you.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Re: osgDB::Archive osga question

2006-10-14 Thread sherman wilcox
On 10/9/06, Sinisa Popovic [EMAIL PROTECTED] 
 wrote:
This is a blind shot; don't know if it will work for you, but it did for me  with the same problem when loading a Terrapage TXP archive via osgDB::readNodeFile(). See if this code prevents memory climbing.  
while(1) {  { const std::string  constantfilename = const.osga;   osg::ref_ptrosgDB::Archive archive2 =openArchive(constantfilename, osgDB::Archive::CREATE);  
  osgDB::Registry::instance()-clearArchiveCache();  } // In case of a debug build use  osgdb_osgad.dll.   osgDB::Registry::instance()-closeLibrary(osgdb_osga.dll);  
}Note:I added extra scoping due to experiencing a crash on scope exit  when my osg::Node (TXPNode) was trying to delete itself after  theTXPlibrary was closed. Might not be relevant for you. 
Best regards,SinisaThanks for the tip.I tried your suggestion but it didn't seem to make a difference. I'm using Visual Studio 2005 on XP Pro.Herearesomestats:
 Virtual memory @ startup:143,400 MBPhysical Working set110,736 MBI ran the code below 500,000 times and the stats were:Virtual memory:157,736 MBPhysical Working set118,576 MB
The numbers were the same ifIleftthecloselibrarycallinornot. It's a small amount of memory difference, but could add up to significant amounts over the lifetime of a process. Oh well, I'll debug this more later.
  int count = 0;  while(1){ count++;{   const std::string constantfilename = const.osga;   osg::ref_ptrosgDB::Archive archive2 = openArchive(constantfilename, 
osgDB::Archive::CREATE);osgDB::Registry::instance()-clearArchiveCache(); }osgDB::Registry::instance()-closeLibrary(osgdb_osga.dll);if(!(count % 1))
  printf(%d\n,count);   }
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] osgDB::Archive osga question

2006-10-07 Thread sherman wilcox

Hello all, got a question related to osg archives. 

If I do this:
osg::ref_ptrosgDB::Archive archive = osgDB::openArchive(test.osga, osgDB::Archive::CREATE, 4096);

I notice that the reference count to archive is immediately set to 2. When this object goes out of scope it appears the reference count only decrements to 1 and is not deleted. The osgDB::Archive destructor is not called when the object goes out of scope. The destructor is called when the program exits. What am I doing wrong?


Another question...related. If I make a osg::ref_ptrosgDB::Archive object a member of a class, how do properly close things out so I canre-use this object? Calling close doesn't seem to cut it. What's the proper way to close out this archive to make it re-usable?

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] Re: osgDB::Archive osga question

2006-10-07 Thread sherman wilcox

 osgDB::Registry::instance()-clearArchiveCache()

That seems like it would be defeating the purpose of the registry cache. Or not. :)

Calling close() doesn't seem to do what I want either. Here's some sample code of what I need to do:

while(list.size())
{
Data obj = *list.begin();

osg::ref_ptrosgDB::Archive archive = openArchive(obj.filename, osgDB::Archive::CREATE);
//do something with the archive
archive-close();
list.pop_front();
}

When archive goes out of scope, the pointer it holdsisn't released thanks to the registry. If obj.filename never changes openArchive seems to return the same pointer..again thanks to the registry, if 
obj.filename changes even though the extension remains .osga, then a new osgDB::Archive object is created...over and over again increasing memory usage with each passdue to keeping all those objects in memory.


So it appears that the registry caches each Archive object on a per file basis. Right? 

Is all this by design? It appears that the only way to remedy the situation is to call:
osgDB::Registry::instance()-clearArchiveCache()
at the end of the while loop.

I don't want to create any leaks or abuse things or such. So, what's the proper way of doing this?

I'm thinking:


while(list.size())
{
Data obj = *list.begin();

osg::ref_ptrosgDB::Archive archive = openArchive(obj.filename, osgDB::Archive::CREATE);
//do something with the archive
archive-close();
list.pop_front();
osgDB::Registry::instance()-clearArchiveCache();
}

But this involves calling:

osgDB::Registry::instance()-clearArchiveCache();

which seems less than elegant.


However, when I tried the code below my memory usage just kept climbing. With each pass of this loop the Archive destructor is called. Any ideas?

while(1)
{
char temp[64];
sprintf(temp, %d.osga,rand());
osg::ref_ptrosgDB::Archive archive2 = openArchive(temp, osgDB::Archive::CREATE);

//do something with the archive
archive2-close();
osgDB::Registry::instance()-clearArchiveCache();
}

Found it. Removing archive2-close() remedies the leak. I noticed that~OSGA_Archive calls close as well. 

OK, now my questions: Any downside tocalling osgDB::Registry::instance()-clearArchiveCache() or removeFromArchiveCache?Is this theproper way of doing things?

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] Re: osgDB::Archive osga question

2006-10-07 Thread sherman wilcox
I knew I hit that send button too soon.

while(1)
{
 const std::string constantfilename = const.osga;
 osg::ref_ptrosgDB::Archive archive2 = openArchive(constantfilename, osgDB::Archive::CREATE);
 osgDB::Registry::instance()-clearArchiveCache();
}
When the bottom curly bracket is reached, the destructor for OSGA_Archive is called. However, my memory usage continues to climb. Why is this?
On 10/7/06, sherman wilcox [EMAIL PROTECTED] wrote:


 osgDB::Registry::instance()-clearArchiveCache()

That seems like it would be defeating the purpose of the registry cache. Or not. :)

Calling close() doesn't seem to do what I want either. Here's some sample code of what I need to do:

while(list.size())
{
Data obj = *list.begin();

osg::ref_ptrosgDB::Archive archive = openArchive(obj.filename, osgDB::Archive::CREATE);
//do something with the archive
archive-close();
list.pop_front();
}

When archive goes out of scope, the pointer it holdsisn't released thanks to the registry. If obj.filename never changes openArchive seems to return the same pointer..again thanks to the registry, if 
obj.filename changes even though the extension remains .osga, then a new osgDB::Archive object is created...over and over again increasing memory usage with each passdue to keeping all those objects in memory.


So it appears that the registry caches each Archive object on a per file basis. Right? 

Is all this by design? It appears that the only way to remedy the situation is to call:
osgDB::Registry::instance()-clearArchiveCache()
at the end of the while loop.

I don't want to create any leaks or abuse things or such. So, what's the proper way of doing this?

I'm thinking:


while(list.size())
{
Data obj = *list.begin();

osg::ref_ptrosgDB::Archive archive = openArchive(obj.filename, osgDB::Archive::CREATE);
//do something with the archive
archive-close();
list.pop_front();
osgDB::Registry::instance()-clearArchiveCache();
}

But this involves calling:

osgDB::Registry::instance()-clearArchiveCache();

which seems less than elegant.


However, when I tried the code below my memory usage just kept climbing. With each pass of this loop the Archive destructor is called. Any ideas?

while(1)
{
char temp[64];
sprintf(temp, %d.osga,rand());
osg::ref_ptrosgDB::Archive archive2 = openArchive(temp, osgDB::Archive::CREATE);

//do something with the archive
archive2-close();
osgDB::Registry::instance()-clearArchiveCache();
}

Found it. Removing archive2-close() remedies the leak. I noticed that~OSGA_Archive calls close as well. 

OK, now my questions: Any downside tocalling osgDB::Registry::instance()-clearArchiveCache() or removeFromArchiveCache?Is this theproper way of doing things? 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] to beat a dead horse - win32 static linking

2006-10-02 Thread sherman wilcox
Win32 static linking question. Possible?  Assuming for a moment that it's possible, is it a good idea? I've read the mailing list archives and a commen theme seems to be it's possible but not advisable. Seems like the plug-in system throws a wrench in things. However, the messages I read aren't exactly recent. I noticed in the latest Win32 OSG source that static lib targets exist. I wouldn't think someone would have gone to all that trouble for nothing. 
So, have things changed or should I just stick with the DLL route?I'm really trying to avoid shipping a bunch of DLLs with my executable. 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] node / drawable culling

2006-09-25 Thread sherman wilcox
I'm trying to better understand culling in OSG. I've written two sample apps that each build 10 triangles. In application one, each triangle is stored in a osg::Geometry object which is owned by a unique osg::Geode object. Each osg::Geode object is stored in a group. So that's 10 osg::Geometry objects and 10 osg::Geode objects. When I run that app and toggle instrumentation, I see there are 10 drawables and 10 primitives. When I pan the scene around, each time a triangle goes out of view the drawable count goes down by one. I take this to mean that OSG has culled the drawable when it goes out of view. OK, so far so good, culling appears to work except I don't like storing each primitive in its own node. Which brings me to application two.
Application two stores all 10 triangles in one geode object. That is, I build 10 osg::Geometry objects. Each osg::Geometry object contains a single triangle. All 10 osg::Geomtry objects are stored in one osg::Geode object. When I run that app and toggle instrumentation, I see there is 1 drawable and 10 primitives. When I pan the scene around, nothing appears to be culled until all 10 triangles are off-screen. That is, my drawable count decrements by one when all 10 triangles are off-screen.
Why, in the second app, do I only see 1 drawable? I added 10 drawables to a osg::Geode object. Am I misunderstanding what is meant by a drawable? Culling...I thought culling was done at the node level AND at the drawable level. Correct? What am I doing wrong here? It appears that all 10 osg::Geometry objects are lumped together in application two, why?

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] node / drawable culling

2006-09-25 Thread sherman wilcox
I'm not performing any explicit optimizations. That isIdidnotrunosgUtil::Optimizer. However, I did set the environment variable OSG_OPTIMIZER=OFF, lo and behold my drawable count went to 10 as one would expect. OK, so the optimizer is running by default.FineIsuppose,solongasIknow.
 Thanks for the assistance.On 9/25/06, Farshid Lashkari 
[EMAIL PROTECTED] wrote:
 Hi Sherman,Are you performing optimizations on your node? There is aMERGE_GEOMETRY optimizationwhich might be combining all 10 geometryobjects into 1. Can you check if this is the case?-Farshid
 ___osg-users mailing listosg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/