Re: [osg-users] Problem changing Stateset

2007-11-16 Thread Brian
Hi,

I'm having a similar problem and was wondering how to "simply find all the 
Drawables?"  I thought I knew, but after looking at the header files for a 
while, I'm not so sure.

Thanks,
Brian


>Are you using display lists? Your first try should work to change the
>state, but you won't see the effects unless you dirty the display list;
>simply find all the Drawables under the node and call
>dirtyDisplayList(), which will recompile the display list with the new
>state.
>
>If you are changing state more than once-in-a-while, you may want to
>disable display lists instead (see Drawable::setUseDisplayList());
>recompiling them all the time will slow things down (and is wasteful
>anyway).
>
>-- 
>Bryan Thrall
>FlightSafety International
>[EMAIL PROTECTED]
>___
>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] What is the correct way to create a "picture-in-picture" view?

2007-11-16 Thread Berg, Michael
I'm trying to use OSG 2.2 to create a main display of the primary scene
with a smaller "picture-in-picture"-style display of a completely
different scene in one of the corners.

The few examples that I've found so far have been for the older OSG 1.2
(using the old Producer interface).

I initially looked at using a slave camera, but got the impression from
some mailing list postings and the API that that was for a different
view of the same scene.

Based on that and other mailing list posts, I've been trying to use the
new CompositeViewer.
I've tried running the example "osgcompositeviewer" executable with
every combination of the -1, -2, and -3 flags possible from the code,
but I can only ever get it to show one scene on my single display.
http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/examples/osgcompositeviewer/osgcompositeviewer.cpp

If I use completely separate windows in my code, I can get each scene to
show up in a separate windows, but this isn't what I want.

By using an osg::GraphicsContext::Traits and
view->setUpViewOnSingleScreen(0), I've been able to get one scene to
show up in only the specified portion of the monitor, but I still can't
get two scenes on the monitor at the same time.

Below is a very stripped down skeleton of the basic code I've been
working with and trying to add different osg::GraphicsContext::Traits
and Viewports too.

==
#include 
#include 
#include 

#include 

#include 
#include 


int main (void)
{
  osg::ref_ptr cessna = osgDB::readNodeFile("cessna.osg");
  osg::ref_ptr cow = osgDB::readNodeFile("cow.osg");

  osgViewer::CompositeViewer viewer;

  // Main scene (fullscreen on a 1600x1200 screen)
  {
osg::ref_ptr view = new osgViewer::View();
view->setSceneData(cessna.get());

viewer.addView(view.get());
  }

  // Other scene in one corner ("picture-in-picture" style)
  {
osg::ref_ptr view = new osgViewer::View();
view->setSceneData(cow.get());
view->getCamera()->setViewport
  (new osg::Viewport(0, 512, 0, 512));

viewer.addView(view.get());
  }

  return (viewer.run());
}
==

I've tried putting the cessna in a viewport that doesn't overlap with
the cow viewport, but I only ever see either a fullscreen cessna.

Am I one the right track, or am I completely off base here?

Any pointers on how to achieve my desired picture-in-picture view of two
separate scenes would be greatly appreciated.

- Michael Berg

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


Re: [osg-users] osgViewer questions

2007-11-16 Thread Robert Balfour
I'm using NVidia graphics cards, and on at least one of my machines I
believe I have the most recent NVidia driver set, so this probably
doesn't explain it.  But it sounds like what you're saying is that the
errors are a result of some unsupported OGL feature?

Bob.


Roger James wrote:
> 
> These messages often appear with Intel motherboard renderers such as the
> 845G. An upgrade to the latest driver might help.
> 
> Roger
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:osg-users-
> > [EMAIL PROTECTED] On Behalf Of Robert Balfour
> > Sent: 16 November 2007 17:52
> > To: osg-users@lists.openscenegraph.org
> > Subject: [osg-users] osgViewer questions
> >
> > Three points of question:
> >
> > 1.  When running the simple osgViewer app (OSG 2.2.0) I consistantly see
> > this message during startup:
> > Warning: detected OpenGL error 'invalid enumerant' after
> > RenderBin::draw(,)
> > Both my installs of OSG 2.2.0 have this symptom with osgViewer app.  Is
> > there something I can do to overcome this warning?
> >
> > 2. In my custom OSG app (using osgViewer class), I use a custom drawable
> > to do some 2D HUD OGL drawing, which is working great.  BUT, when I
> > minimize the app window I get a continuous sequence of:
> > Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)
> > This warning stops when I re-open the window from the taskbar.  Would
> > someone have an idea of what causes this only when minimized?
> >
> > Which also begs the question:
> >
> > 3. When you minimize the app window, is OSG still drawing?  If so, as it
> > appears, what would be an effective approach to disable unnecessary
> > scenegraph drawing while the window is minimized? In osgGA I see window
> > quit, resize, close events, but no minimize (although I do see a
> > resize(1,1) event when minimized, which you could key off of).
> >
> > Thank you.
> >
> > Bob.
> > --
> > Robert E. Balfour, Ph.D.
> > Exec. V.P. & CTO,  BALFOUR Technologies LLC
> > 960 South Broadway, Suite 108, Hicksville NY 11801
> > Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED]
> > ___
> > osg-users mailing list
> > osg-users@lists.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 questions

2007-11-16 Thread Roger James
These messages often appear with Intel motherboard renderers such as the
845G. An upgrade to the latest driver might help.

Roger

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:osg-users-
> [EMAIL PROTECTED] On Behalf Of Robert Balfour
> Sent: 16 November 2007 17:52
> To: osg-users@lists.openscenegraph.org
> Subject: [osg-users] osgViewer questions
> 
> Three points of question:
> 
> 1.  When running the simple osgViewer app (OSG 2.2.0) I consistantly see
> this message during startup:
> Warning: detected OpenGL error 'invalid enumerant' after
> RenderBin::draw(,)
> Both my installs of OSG 2.2.0 have this symptom with osgViewer app.  Is
> there something I can do to overcome this warning?
> 
> 2. In my custom OSG app (using osgViewer class), I use a custom drawable
> to do some 2D HUD OGL drawing, which is working great.  BUT, when I
> minimize the app window I get a continuous sequence of:
> Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)
> This warning stops when I re-open the window from the taskbar.  Would
> someone have an idea of what causes this only when minimized?
> 
> Which also begs the question:
> 
> 3. When you minimize the app window, is OSG still drawing?  If so, as it
> appears, what would be an effective approach to disable unnecessary
> scenegraph drawing while the window is minimized? In osgGA I see window
> quit, resize, close events, but no minimize (although I do see a
> resize(1,1) event when minimized, which you could key off of).
> 
> Thank you.
> 
> Bob.
> --
> Robert E. Balfour, Ph.D.
> Exec. V.P. & CTO,  BALFOUR Technologies LLC
> 960 South Broadway, Suite 108, Hicksville NY 11801
> Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED]
> ___
> 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] osgViewer questions

2007-11-16 Thread Robert Balfour
Three points of question:

1.  When running the simple osgViewer app (OSG 2.2.0) I consistantly see
this message during startup:
Warning: detected OpenGL error 'invalid enumerant' after
RenderBin::draw(,)
Both my installs of OSG 2.2.0 have this symptom with osgViewer app.  Is
there something I can do to overcome this warning?

2. In my custom OSG app (using osgViewer class), I use a custom drawable
to do some 2D HUD OGL drawing, which is working great.  BUT, when I
minimize the app window I get a continuous sequence of:
Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)
This warning stops when I re-open the window from the taskbar.  Would
someone have an idea of what causes this only when minimized?

Which also begs the question:

3. When you minimize the app window, is OSG still drawing?  If so, as it
appears, what would be an effective approach to disable unnecessary
scenegraph drawing while the window is minimized? In osgGA I see window
quit, resize, close events, but no minimize (although I do see a
resize(1,1) event when minimized, which you could key off of).

Thank you.

Bob.
-- 
Robert E. Balfour, Ph.D.
Exec. V.P. & CTO,  BALFOUR Technologies LLC
960 South Broadway, Suite 108, Hicksville NY 11801
Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Thibault Genessay
Hi Akos

The Canvas class derives from wxGLCanvas, and is the glue between the
OSG and wxWidgets. It defines two child classes: View and
GraphicsContext.

Canvas::GraphicsContext derives from osgViewer::GraphicsWindow (pure
virtual). The OSG uses the GraphicsWindow to actually create the
window, showing it and query its status. There is not much to do in
the wxWidgets situation because the window itself is the Canvas. The
Canvas *could* have derived from both wxGLCanvas and
osgViewer::GraphicsContext, but since wxWidgets does not like multiple
inheritance for controls, I have chosen to create the child class
Canvas::GraphicsContext that mostly forwards the call to the Canvas.
This is also why the Canvas::GraphicsContext is private - the user
does not need to care about it.

Canvas::View derives from osgViewer::View (pure virtual too). An OSG
window can display multiple, independent views. The camera,
manipulators and all other view-dependent features are part of the
view. The view is also responsible for querying the graphics subsystem
to redraw the window and continuously update it. To my current
understanding, only osgGA::Manipulators actually perform those
queries. If your application needs it (e.g. if your physics model is
dependent on the OSG update traversal) you should also request
redraws/continuous updates from your OSG code. The Canvas::View
respond to those requests by asking wxWidgets to redraw the window -
continuously through idle events or a single time.

Have a look at the headers of osgViewer::GraphicsContext and
osgViewer::View to have a more in-depth understanding of their roles.

The simulation problem is quite unrelated. As Robert says, a real
simulation should run at a constant frame rate. If your application is
not a CAD software (or alike) and always needs redraws, you can use
the method Canvas::setUpdateWhenIdleOverride(true). This will
continuously update the window, thereby recreating the "normal" OSG
loop. Be certain that it will be slower than a pure OSG application,
though.

Thibault


On Nov 16, 2007 11:58 AM, Ákos Maróy <[EMAIL PROTECTED]> wrote:
> Mario Valle wrote:
> > No, methods from TrackballManipulator help you in understanding when you 
> > are interacting
> > with the viewer and so when you need to call frame().
>
> I'm looking at it, it's in the Canvas class, which is a descendant of
> wxGLCanvas - which is not an OSG class, or is it?
>
>
>
> Akos
>
> ___
> 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 changing Stateset

2007-11-16 Thread Thrall, Bryan
Enrico Villani wrote on Friday, November 16, 2007 4:38 AM:
> Hello, I have a osg::Node* that has applied a osg::StateSet*  with
> many Attribute, in particular an osg::Material*.  When I try to
> switch the stateset to another, no changes are visible.  
> 
> I tried with
> 
> node->setStateSet(TheOtherStateSet);
> 
> and
> 
> osg::stateSet* tmp = node.getOrCreateStateSet();
> tmp = TheOtherStateSet;
> 
> 
> but it doesn't work correctly.
> 
> Thank you Davide

Are you using display lists? Your first try should work to change the
state, but you won't see the effects unless you dirty the display list;
simply find all the Drawables under the node and call
dirtyDisplayList(), which will recompile the display list with the new
state.

If you are changing state more than once-in-a-while, you may want to
disable display lists instead (see Drawable::setUseDisplayList());
recompiling them all the time will slow things down (and is wasteful
anyway).

-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] About the plugins...

2007-11-16 Thread Emmanuel Roche
okay Robert,

and concerning the UserData object in each object ? How would I process if I
wanted this data to be dumped to my .osg files too when I save a node ?

Manu.


2007/11/14, Robert Osfield <[EMAIL PROTECTED]>:
>
> Hi Manu,
>
> Extending the .osg format with your own
> callbacks/nodes/state/drawables is pretty easy - just look to see how
> all the NodeKits do it i.e. they have src/osgPlugins/osgParticle,
> src/osgPlugins/osgText.
>
> The .ive format isn't extensible in the same way though, to extend it
> you have to go in a add support directly for you data type.  The is a
> flaw with the .ive format, and makes it inappropriate for the type of
> work you have in mind.
>
> Longer term I'd like a native osg binary format that is extensible,
> but alas its quite a chunk of work so not possible to introduce any
> time soon.
>
> Robert.
>
> On Nov 13, 2007 9:26 PM, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > Hi every one...
> >
> > Suppose I want to construct a special NodeCallback, call it
> "MyCallback",
> > then I load a scene graph from an .ive file, find a given node, assign
> my
> > famous callback to it and then want to write this graph back on the hard
> > drive BUT writing the info in MyCallback also to be able to load it
> again
> > the next time... How should I do this ??
> >
> > I mean, is there a way to "improve the Osg and Ive plugins for them to
> be
> > able to handle other chunk of data,  or do I have to write a full plugin
> > even in this case ? Will I ever be able to write the file as a .ive file
> ??
> > Or Am I bound to select an  other extension ?
> >
> > Sorry, I'm quite a beginner with the plugins writing... :-)
> >
> > regards,
> > Manu.
> >
> >
> > ___
> > 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] OSG CPU usage

2007-11-16 Thread Robert Osfield
On Nov 16, 2007 5:31 PM, Paul Martz <[EMAIL PROTECTED]> wrote:
> In a dedicated flight sim, I tend to agree with you. Go ahead and let it
> continuously redraw the scene, even if it is static -- the processor isn't
> used for anything else anyway. But for any type of desktop/PC rendering
> application, users expect the CPU to be free for other tasks when they pause
> or stop the animation.

As long as vsync is on, as it should almost should be then the CPU
load shouldn't be overwhelming with a standard frame loop.

> In my experience, dedicated rendering loops have actually generated end-user
> bug reports, claiming the CPU was occupied even when they had stopped the
> animation. After I modified the app to only render when needed, never once
> did I receive a single bug report along the lines of "this wrecked my
> suspension of disbelief".

Desktop users might not worry about an occassional dropped frame,
proper sims though, if you don't hit a solid 60Hz (or whatever vsync
is) then you will find users feeling nauseous or suffering from undue
fatigue, but they won't neccessarily know why - one of the reasons for
this is inconsistent/juttery framerate.  The more immersive the
simulator the more critical this issue is.

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


Re: [osg-users] osgdot - a tool to generate a picture ofascenegraph'sstructure

2007-11-16 Thread Alberto Luaces
It doesn't compile out of the box on 64bit, because of the casts from pointer 
to 'unsigned int'. Changing those casts to 'unsigned long' works, but it is 
an ugly hack.

El Thursday 15 November 2007 18:14:23 Mike Weiblen escribió:
> whups, moved it to
>
> http://osgtoy.svn.sourceforge.net/viewvc/osgtoy/osgtoy/trunk/application
> s/osgdot/
>
> -- mew
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf
> > Of Mike Weiblen
> > Sent: Thursday, November 15, 2007 10:58 AM
> > To: OpenSceneGraph Users
> > Subject: Re: [osg-users] osgdot - a tool to generate a
> > picture ofascenegraph'sstructure
> >
> > > -Original Message-
> > > On Nov 15, 2007 4:35 PM, Mike Weiblen <[EMAIL PROTECTED]>
> > >
> > > wrote:
> > > > Very cool!  Maybe whip up a plugin Writer wrapper around it,
> > > > permitting
> > > >
> > > > osgconv cow.osg cow.dot
> > > >
> > > > Then, what about enabling that osgdb_dot.dll plugin as a
> > >
> > > Reader as well?
> > >
> > > > ;-O
> > >
> > > I love the sound of some one volunteering :-D
> >
> > Heh, more than you think: I put the source in the osgToy SVN
> > for safekeeping and further refinement.  I'm glad to move it
> > to OSG core SVN later if you wish.
> >
> > See
> > http://osgtoy.svn.sourceforge.net/viewvc/osgtoy/osgtoy/trunk/s
> > rc/osgToy/
> > osgdot.cpp
> >
> > In the mean time, I'm glad to accept code submissions.  Pls
> > submit them via the osgToy SourceForge Tracker
> > http://sourceforge.net/tracker/?group_id=139833
> >
> > cheers
> > -- mew
>


/*

  osgdot -- Output the relations between scenegraph nodes and
drawables in graphviz's "dot" tool format.

   Paul E.C. Melis ([EMAIL PROTECTED]), November, 2007

This software is hereby placed in the public domain. Use in whichever
way you see fit.

HE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

This is a small tool that reads in a model file (in any format readable
by OSG) and outputs a text file (graph.dot) that describes the connections
between nodes and some other details. The text file is in a format that
can be read by the "dot" tool from the graphviz package. With dot you can
generate a picture representing the scenegraph. For example, to generate
a PNG file from the graph.dot file use the command:

dot -Tpng -ograph.png graph.dot

* osgdot takes a single argument, the model file to read
* The graph will show nodes and drawable as boxes, labeled with their OSG
  class name. If the node/drawable's getName() method returned a non-empty
  string this will also be shown in the node (below the horizontal line).
* Nodes are shown with a thick border, drawables with a thin border
* Nodes or drawables that have a stateset assigned to them will be filled
  with a grey color.
* Arrows between nodes/drawables indicate a parent -> child relationship.
  Arrows from node to node are shown with a solid line, arrows from node
  to drawable with a dashed line.
* For drawables of the class Geometry the number of primitive sets held
  by that object is shown below the horizontal line.

The graphviz package can be found at http://www.graphviz.org/.
Or check your Linux distro for the package. It also seems to be available
for Windows and MacOS.

Compile (on Linux and using gcc) with:

g++ -W -Wall -o osgdot osgdot.cpp -I /include -L /lib -losg -losgDB

Version used during development: OSG 2.1.1, graphviz 2.12

*/

#include 
#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 

class GraphNode
{
public:

GraphNode(osg::Node *node)
{
char s[1024];

_node = node;
mem_location = (unsigned long) node;

osg_class = node->className();
name = node->getName();

has_stateset = node->getStateSet() != NULL;

sprintf(s, "%s_%08x", osg_class.c_str(), mem_location);
		dot_id = std::string(s);

type = "node";
		extra_label = "";
}

GraphNode(osg::Drawable *drawable)
{
char s[1024];

_drawable = drawable;
mem_location = (unsigned long) drawable;

osg_class = drawable->className();
name = drawable->getName();

has_stateset = drawable->getStateSet() != NULL;

sprintf(s, "%s_%08x", osg_class.c_str(), mem_location);
		dot_id = std::string(s);

type = "drawable";

extra_label = "";
if (dynamic_cast(drawable))
{
// include count of primitive sets
sprintf(s, "%d psets", dynamic_cast(drawable)->getNumPrimitiveSets());
extra_label = std::string(s);
}
}

void

Re: [osg-users] OSG CPU usage

2007-11-16 Thread Robert Osfield
On Nov 15, 2007 7:16 PM, Bob Kuehne <[EMAIL PROTECTED]> wrote:
> we'll have to agree to disagree. i think rendering when data hasn't
> changed is a bad use of system resources. what matters ultimately
> isn't frame-rate, but _perceived_ frame-rate, and if the user is
> staring at an immobile object from an immobile view, 60Hz is no better
> than 1Hz.

In a simulator you don't have generally static views & scenes, and you
absolutely have to hit vsync, no frame drops or the suspension of
disbelief is broken.

Assuming that starting and stopping a sim visual update on demand is
OK is very bad assumption, things like usleep and similiar tricks
aren't at all reliable enough, as soon as you hand over responsibility
for frame scheduling to something else that is schedule by the
operating system or ever work windowing toolkit you have given any
hope of determinism, you are in the lap of the gods whether you hit
frame or not.

Not to mention all the other issues associated with paging, animations
and physics simulations...

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


Re: [osg-users] Getting nodes when reading .obj file

2007-11-16 Thread Rafa Gaitan
Hi Robert,

The best you can use is a NodeVisitor. Inside osgsimulation example
there is a FindNamedNodeVisitor that could help you in the task.

Rafa.

On 11/16/07, Robert Borchers <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to read in nodes from a .obj or .3ds file.
>
> For doing this I use
> osg::ref_ptr osgNode = osgDB::readNodeFile(snode.filename);
>
> Now I want to get the objects from this file. This shall be a Square, a
> Sphere and a Pyramid. I tried to do this by using:
>
> osg::ref_ptr myOsgGroup;
> myOsgGroup = osgNode->asGroup(); // returns NULL if not a group.
>
> for (unsigned int i = 0 ; i < myOsgGroup->getNumChildren(); i ++) {
>   osg::ref_ptr myTempNode = myOsgGroup->getChild(i);
>  cout << "nodename = " << myTempNode->getName() << endl;
> }
>
>
> But the result of this operation is that I get 12 Objects instead of the
> 3. 6 for the square, 5 for the pyramid and 1 for the sphere.
> What have I to do to get just the 3 Objects so I can play around with them ?
>
> Thanks
> Robert
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] The Next-Gen Game Engine Creature3D

2007-11-16 Thread Jean-Sébastien Guay
Hello WuCaihua,

With your fixes, the program runs for me. As you said, some textures  
are not found so they appear black or with what seems like "debugging  
drawing" on them. But the floor normal mapping looks good :-)

Also as a minor note, the mouse sensitivity seems very low, I have to  
move the mouse about a foot to get the view to turn about 45 degrees...

>   I will correct these errors soon and upload to the web of
> http://cid-cc7befe115bfbec3.skydrive.live.com/browse.aspx/Public

Looking forward to seeing the fixed result. Let us know when it's done.

Good luck,

J-S
-- 
__
Jean-Sebastien Guay [EMAIL PROTECTED]
 http://whitestar02.webhop.org/


This message was sent using IMP, the Internet Messaging Program.


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


Re: [osg-users] changing the ambient light in Viewer?

2007-11-16 Thread Robert Osfield
On Nov 16, 2007 3:51 PM, Ákos Maróy <[EMAIL PROTECTED]> wrote:
> this must be the lamest question, but I don't really find an answer on
> the OSG Trac wiki..
>
> when I use Viewer (from code), how do I change the ambient light from
> light blue to something else?

Do you mean the back ground colour?

 viewer.getCamera()->setClearColor(Vec4(r,g,b,a));

> also, when I rotate objects, they look different from the 'back' - may
> this be because of the default lighting?

I don't know what you mean.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Mario Valle
Look at:
Canvas::View::requestContinuousUpdate(bool needed)

Ciao!
mario

Ákos Maróy wrote:
> Mario Valle wrote:
>> No, methods from TrackballManipulator help you in understanding when you are 
>> interacting
>> with the viewer and so when you need to call frame().
> 
> I'm looking at it, it's in the Canvas class, which is a descendant of
> wxGLCanvas - which is not an OSG class, or is it?
> 
> 
> Akos
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

-- 
Ing. Mario Valle
Visualization Group  | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Collada build again

2007-11-16 Thread steven_thomas
"1. Changing the collada build files (VC8 project file in my case) to 
differentiate the collada release and debug build by library name not by 
directory."

I understand this is a problem for some people. The last "official" 
release of the Collada DOM (1.3) uses '_d' to differentiate debug and 
release libs, so they can be placed in the same directory if necessary. 
I took that out because I thought it was redundant, but that has proven 
unpopular, and for good reasons. Before the next official release I'll 
put that back in. Sorry for any inconvenience.

Steve


Roger James wrote:
>
> Anders,
>
>  
>
> I have exactly the same problem. I get round it by doing two things.
>
> 1. Changing the collada build files (VC8 project file in my case) to 
> differentiate the collada release and debug build by library name not 
> by directory.
>
> 2. Changing the osg collada plugin build files (VC8 project file) link 
> the different names.
>
>  
>
> This is very unsatisfactory as I have to reset all the osg  stuff 
> every time cmake is run. I admit that the easiest way to do that is 
> just to remove the cmake files from the collada plugin directory.
>
>  
>
> But I can just about live with it.
>
>  
>
> Roger
>
>  
>
> 
>
> *From:* [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] *On Behalf Of 
> *Anders Backman
> *Sent:* 16 November 2007 17:46
> *To:* OpenSceneGraph Users
> *Subject:* [osg-users] Collada build again
>
>  
>
> Hi all.
>
> I have a slight problem with the build of the collada plugin under 
> windows.
>
> The first is that its forced to be static, this I have reported 
> earlier, so there is a simple solution for that (the CMakeLIsts.txt is 
> submitted to Robert/osg-list/submission-list).
>
> The other is that one have to select either debug/release version of 
> the library in cmakesetup.
>
> This library is picked up and used for linking both release/debug 
> version of the dae plugin.
>
> This causes problems, as we are using the document created by the dae 
> plugin for reading physics from collada.
>
> We are using debug and release libraries in our buildsystem to be able 
> to step through code etc...
>
> So what happens is that during the osg build, either debug OR release 
> of libcolladadom13 is selected.
>
> Then we use libcolladadom13d.lib in our debug relases.
> Because of how collada is constructed (global/static variable shared 
> between all instances of collada) it crasches if you mix debug/release.
>
> Ok, with all that said.
> After investigating the cmakefiles of the dae plugin, I cant really 
> make out how to make it possible to use both debug as well as release 
> when building the plugin.
>
> Currently the variable
>
> SET(TARGET_LIBRARIES_VARS COLLADA_LIBRARY)
>
> is set, where COLLADA_LIBRARY Is the variable containing the full path 
> to the library file selected in cmakesetup.
>
> Without some major refactoring, I dont see how to make it possible to 
> use the ordinary debug optimized procedure of linking to libraries
>
> Any ideas, thoughts?
>
>
> -- 
>
>
> 
> Anders Backman   Email:[EMAIL PROTECTED] 
> 
> HPC2N/VRlab  Phone:+46 (0)90-786 9936
> Umea university  Cellular: +46 (0)70-392 64 67
> S-901 87 UMEA SWEDEN Fax:  +46 90-786 6126
>   http://www.cs.umu.se/~andersb 
> 
>
> 
>
> ___
> 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] Window titlebar icon/text

2007-11-16 Thread Robert Balfour
I'm using the osgViewer class on WinXP.  Is there a straightforward way
to set the application icon and text on the window titlebar? (or do I
get the native window handle and do it platform-specific)

Thanks.

Bob.
-- 
Robert E. Balfour, Ph.D.
Exec. V.P. & CTO,  BALFOUR Technologies LLC
960 South Broadway, Suite 108, Hicksville NY 11801
Phone: (516)513-0030  Fax: (516)513-0027  email: [EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Collada build again

2007-11-16 Thread Anders Backman
I actually found a partial solution.
It seems that underestimating the brains that have put together the cmake
system is dangerous
Only a large set of highly active brains  could have devised a system like
this :-)

If you add a variable named COLLADA_LIBRARY_DEBUG with the path to a debug
library, it works!

I guess the problem is to find a good way to actually find the debug library
without having to tell the user to pick that library too.
That is of course the simplest solution, just probing for the collada
library once again and letting the user select the debug version.

This can be done with just a few changes to the FindCollada.cmake and the
CMakeLists.txt in the dae directory.
However I think there is already too many libraries that one have to search
for manually

Ideas?

/Anders

On Nov 16, 2007 7:44 PM, Roger James <[EMAIL PROTECTED]> wrote:

>  Anders,
>
>
>
> I have exactly the same problem. I get round it by doing two things.
>
> 1. Changing the collada build files (VC8 project file in my case) to
> differentiate the collada release and debug build by library name not by
> directory.
>
> 2. Changing the osg collada plugin build files (VC8 project file) link the
> different names.
>
>
>
> This is very unsatisfactory as I have to reset all the osg  stuff every
> time cmake is run. I admit that the easiest way to do that is just to remove
> the cmake files from the collada plugin directory.
>
>
>
> But I can just about live with it.
>
>
>
> Roger
>
>
>   --
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Anders Backman
> *Sent:* 16 November 2007 17:46
> *To:* OpenSceneGraph Users
> *Subject:* [osg-users] Collada build again
>
>
>
> Hi all.
>
> I have a slight problem with the build of the collada plugin under
> windows.
>
> The first is that its forced to be static, this I have reported earlier,
> so there is a simple solution for that (the CMakeLIsts.txt is submitted to
> Robert/osg-list/submission-list).
>
> The other is that one have to select either debug/release version of the
> library in cmakesetup.
>
> This library is picked up and used for linking both release/debug version
> of the dae plugin.
>
> This causes problems, as we are using the document created by the dae
> plugin for reading physics from collada.
>
> We are using debug and release libraries in our buildsystem to be able to
> step through code etc...
>
> So what happens is that during the osg build, either debug OR release of
> libcolladadom13 is selected.
>
> Then we use libcolladadom13d.lib in our debug relases.
> Because of how collada is constructed (global/static variable shared
> between all instances of collada) it crasches if you mix debug/release.
>
> Ok, with all that said.
> After investigating the cmakefiles of the dae plugin, I cant really make
> out how to make it possible to use both debug as well as release when
> building the plugin.
>
> Currently the variable
>
> SET(TARGET_LIBRARIES_VARS COLLADA_LIBRARY)
>
> is set, where COLLADA_LIBRARY Is the variable containing the full path to
> the library file selected in cmakesetup.
>
> Without some major refactoring, I dont see how to make it possible to use
> the ordinary debug optimized procedure of linking to libraries
>
> Any ideas, thoughts?
>
>
> --
>
>
> 
> Anders Backman   Email:[EMAIL PROTECTED]
> HPC2N/VRlab  Phone:+46 (0)90-786 9936
> Umea university  Cellular: +46 (0)70-392 64 67
> S-901 87 UMEA SWEDEN Fax:  +46 90-786 6126
>   
> http://www.cs.umu.se/~andersb
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 



Anders Backman   Email:[EMAIL PROTECTED]
HPC2N/VRlab  Phone:+46 (0)90-786 9936
Umea university  Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax:  +46 90-786 6126
  http://www.cs.umu.se/~andersb
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Collada build again

2007-11-16 Thread Roger James
Anders,

 

I have exactly the same problem. I get round it by doing two things.

1. Changing the collada build files (VC8 project file in my case) to
differentiate the collada release and debug build by library name not by
directory.

2. Changing the osg collada plugin build files (VC8 project file) link the
different names.

 

This is very unsatisfactory as I have to reset all the osg  stuff every time
cmake is run. I admit that the easiest way to do that is just to remove the
cmake files from the collada plugin directory.

 

But I can just about live with it.

 

Roger

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anders
Backman
Sent: 16 November 2007 17:46
To: OpenSceneGraph Users
Subject: [osg-users] Collada build again

 

Hi all.

I have a slight problem with the build of the collada plugin under windows.

The first is that its forced to be static, this I have reported earlier, so
there is a simple solution for that (the CMakeLIsts.txt is submitted to
Robert/osg-list/submission-list).

The other is that one have to select either debug/release version of the
library in cmakesetup.

This library is picked up and used for linking both release/debug version of
the dae plugin. 

This causes problems, as we are using the document created by the dae plugin
for reading physics from collada.

We are using debug and release libraries in our buildsystem to be able to
step through code etc... 

So what happens is that during the osg build, either debug OR release of
libcolladadom13 is selected.

Then we use libcolladadom13d.lib in our debug relases.
Because of how collada is constructed (global/static variable shared between
all instances of collada) it crasches if you mix debug/release. 

Ok, with all that said.
After investigating the cmakefiles of the dae plugin, I cant really make out
how to make it possible to use both debug as well as release when building
the plugin.

Currently the variable 

SET(TARGET_LIBRARIES_VARS COLLADA_LIBRARY)

is set, where COLLADA_LIBRARY Is the variable containing the full path to
the library file selected in cmakesetup.

Without some major refactoring, I dont see how to make it possible to use
the ordinary debug optimized procedure of linking to libraries 

Any ideas, thoughts?


-- 



Anders Backman   Email:[EMAIL PROTECTED]
HPC2N/VRlab  Phone:+46 (0)90-786 9936
Umea university  Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax:  +46 90-786 6126
  http://www.cs.umu.se/~andersb 

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


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Ákos Maróy
Mario Valle wrote:
> The recently posted wxTabbed example has a method to block update till 
> they are needed. Look at it.

do you mean the sample in this message:

http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2007-October/003972.html

?

I glanced at it, but the 'block until updated needed' aspect of the code
sample wasn't obvious :(


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


[osg-users] FB RTT antialiasing quality downgrade

2007-11-16 Thread Zdeněk Kussior

Hi,
I'm having a bit strange problem with FrameBuffer rendering to texture, 
at least a problem for me, I'm new to OSG (1.2).


When I render my test scene standardly with Multisampling, output on 
screen is nice, smooth (see enclosed image).
What I need is to make a distortion - render the same scene firstly to 
the FrameBuffer (Multisampling still on), then copy it to the texture, 
map it on the plane which covers the whole screen and finally render it 
again on the screen. RenderTargetImplementation is FRAME_BUFFER. Man 
would expect that what has been rendered to FB will be copied to 
texture, rendered again on plane object and results are both the same.
Now here's the problem. They are not the same (as can be seen on 
enclosed image), the final antialiasing quality is downgraded, edges are 
not smooth but bumpy. The same effect arises with some higher types of 
Supersampling. It looks like some information has lost or has been 
"downsampled somehow" when copying from FB to texture.


I'm working on GF 8800GTX, the following lines list how it behaves with 
different AA settings:

AA off - both screens are the same
MS 2x - are the same
MS 4x - are the same (but insufficient quality)
MS 8xQ - rendered to texture and then displayed screen is worst
SS 2x2 - RTT screen not antialiased at all
SS 4x4 - RTT screen not antialiased at all
SS 4xS - both look the same (pretty acceptable for my project)
SS 8xS - RTT is worst, textured objects look a bit blurry
SS 16xS - RTT is worst, textured objects look a bit more blurry
SS 32xS - RTT even worst, almost looks like not antialiased (but still 
is a bit)


In project I'm working on I need to have nice smooth edges and good 
looking textures while using distortion. The SS 16xS is ideal for it, 
but suffers the same problem as described higher. I want to avoid 
pbuffer and FBO, which is not antialiased. With FBO I need to render 
image in much higher resolution, then shrink it on plane and render it 
which is what I want to avoid. I've read something about FBOs extension 
which allows AA, but I guess that OSG does not support it (sorry if I'm 
wrong).


To summarize it, my question is:
Is it possible to get both screens totally the same with SS 16xS (or MS 
8xQ)?




Thanks for any eventual advice.

Regards
Zdenek Kussior


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


Re: [osg-users] Taking screenshots using OSG 2.2

2007-11-16 Thread Ralph Kern
Use a PostDrawCallback. During the callback the OpenGL context is still
current in all multithreading settings.

You can do something like:

class ScreenShotCallback: public osg::Camera::DrawCallback
{
...
void operator() (const osg::Camera &camera) const
{
// x, y, width and height may be some class members of 
ScreenShotCallback

osg::Image *image = new osg::Image;
image->readPixels(x, y, width, height, GL_RGB, 
GL_UNSIGNED_BYTE);
osgDB::writeImageFile(*image, "capture.bmp");
}
};

viewer.getCamera()->setPostDrawCallback( new ScreenShotCallback() );

Eduardo Gutiérrez Sanmartín schrieb:
> Thanks Richard, but I put
> 
> viewer.setThreadingModel( osgViewer::ViewerBase::SingleThreaded );
> 
> and the capture is black again.
> 
> I'm using Windows XP in a Pentium IV with a GeForce 6600.
> 
> Another idea?
> 
> Edu
> 

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


[osg-users] Collada build again

2007-11-16 Thread Anders Backman
Hi all.

I have a slight problem with the build of the collada plugin under windows.

The first is that its forced to be static, this I have reported earlier, so
there is a simple solution for that (the CMakeLIsts.txt is submitted to
Robert/osg-list/submission-list).

The other is that one have to select either debug/release version of the
library in cmakesetup.

This library is picked up and used for linking both release/debug version of
the dae plugin.

This causes problems, as we are using the document created by the dae plugin
for reading physics from collada.

We are using debug and release libraries in our buildsystem to be able to
step through code etc...

So what happens is that during the osg build, either debug OR release of
libcolladadom13 is selected.

Then we use libcolladadom13d.lib in our debug relases.
Because of how collada is constructed (global/static variable shared between
all instances of collada) it crasches if you mix debug/release.

Ok, with all that said.
After investigating the cmakefiles of the dae plugin, I cant really make out
how to make it possible to use both debug as well as release when building
the plugin.

Currently the variable

SET(TARGET_LIBRARIES_VARS COLLADA_LIBRARY)

is set, where COLLADA_LIBRARY Is the variable containing the full path to
the library file selected in cmakesetup.

Without some major refactoring, I dont see how to make it possible to use
the ordinary debug optimized procedure of linking to libraries

Any ideas, thoughts?


-- 



Anders Backman   Email:[EMAIL PROTECTED]
HPC2N/VRlab  Phone:+46 (0)90-786 9936
Umea university  Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax:  +46 90-786 6126
  http://www.cs.umu.se/~andersb
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Thread politeness

2007-11-16 Thread sherman wilcox
On Nov 16, 2007 8:33 AM, Robert Osfield <[EMAIL PROTECTED]> wrote:
> The other thing you can do is try out an OS that can do
> multi-threading properly.
>
> Robert.

Yeah, like Windows Vista 64!

*jumps for cover*

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


[osg-users] Taking screenshots using OSG 2.2

2007-11-16 Thread Eduardo Gutiérrez Sanmartín
Thanks Richard, but I put

viewer.setThreadingModel( osgViewer::ViewerBase::SingleThreaded );

and the capture is black again.

I'm using Windows XP in a Pentium IV with a GeForce 6600.

Another idea?

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


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Ákos Maróy
Thibault,

Thanks for the detailed explanation. Now it's quite clear now..


Akos

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


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Paul Martz
> In a simulator you don't have generally static views & 
> scenes, and you absolutely have to hit vsync, no frame drops 
> or the suspension of disbelief is broken.
> 
> Assuming that starting and stopping a sim visual update on 
> demand is OK is very bad assumption, things like usleep and 
> similiar tricks aren't at all reliable enough, as soon as you 
> hand over responsibility for frame scheduling to something 
> else that is schedule by the operating system or ever work 
> windowing toolkit you have given any hope of determinism, you 
> are in the lap of the gods whether you hit frame or not.
> 
> Not to mention all the other issues associated with paging, 
> animations and physics simulations...

In a dedicated flight sim, I tend to agree with you. Go ahead and let it
continuously redraw the scene, even if it is static -- the processor isn't
used for anything else anyway. But for any type of desktop/PC rendering
application, users expect the CPU to be free for other tasks when they pause
or stop the animation.

In my experience, dedicated rendering loops have actually generated end-user
bug reports, claiming the CPU was occupied even when they had stopped the
animation. After I modified the app to only render when needed, never once
did I receive a single bug report along the lines of "this wrecked my
suspension of disbelief".
   -Paul

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


Re: [osg-users] changing the ambient light in Viewer?

2007-11-16 Thread Ákos Maróy
Robert Osfield wrote:
>  viewer.getCamera()->setClearColor(Vec4(r,g,b,a));

thanks! this works!

>> also, when I rotate objects, they look different from the 'back' - may
>> this be because of the default lighting?
> 
> I don't know what you mean.

see the attached files.

front.png - a view from the front, the lines are white
back.png - a view when the object is rotated and viewed from the back
   the lines are black

in between, it goes through gray


Akos

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


Re: [osg-users] The Next-Gen Game Engine Creature3D

2007-11-16 Thread 吴才华
Hi Jean-Sébastien,
  Mouse speed is controled by "Creature3DGame/res/personai1.cfg", Open it, find 
the key of "MouseSpeed", the default value is 0.1, try to increase it.
 
Thanks,
 
WuCaihua
2007.11.17
 
 

在2007-11-16,"Jean-Sébastien Guay" <[EMAIL PROTECTED]> 写道:

Hello WuCaihua,

With your fixes, the program runs for me. As you said, some textures  
are not found so they appear black or with what seems like "debugging  
drawing" on them. But the floor normal mapping looks good :-)

Also as a minor note, the mouse sensitivity seems very low, I have to  
move the mouse about a foot to get the view to turn about 45 degrees...

>   I will correct these errors soon and upload to the web of
> http://cid-cc7befe115bfbec3.skydrive.live.com/browse.aspx/Public

Looking forward to seeing the fixed result. Let us know when it's done.

Good luck,

J-S
-- 
__
Jean-Sebastien Guay [EMAIL PROTECTED]
 http://whitestar02.webhop.org/


This message was sent using IMP, the Internet Messaging Program.


___
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] I need more accuracy !

2007-11-16 Thread Stephane Lamoliatte
Hi everyone and thank you for your help.

I successfully made a little program working  with my matrices of real.
Like Serge said : For each osg::Geode in my scene, I add it an update 
callback that compute the MODELVIEW matrix using Matrixr and then, 
convert this Matrixr to Matrixd before sending it to OpenGL. In this way 
all matrix computations are made with a great accuracy and OpenGL 
understand it.
But now I have performance problem : OpenSceneGraph continue to do it 
MODELVIEW computations in double at during the update traversal. I can't 
stop it !

I already tried to use the depth partition that Mr Wright speaks about, 
but I met lot of problem with it :
 - bad clipping,
 - strange alpha blending,
 - performance issues (the scene is rendered multiple time each frame),
 - ...

Now I need to find a way to replace the OSG matrix computations by mine...

Stephane Lamoliatte a écrit :
> Dear mister Osfield,
>
> I currently develop a space simulator working with very hight dynamic 
> range data.
> During the development I met multiple floatting point number precision 
> problems.
>
> For now, I try to solve one of these that come from OpenSceneGraph :
> For my scene, I need to use Matrices, Vectors and Quaternions with a 
> very big accuracy. (I detail an exemple of osg accuracy problem below).
> I wrote a Matrixr, a matrix of real, wich is a Matrix using the GMP library.
> The problem is that I can't simply replace all matrices in the code of 
> OpenSceneGraph by my Matrixr.
> I try to change the "typedef Matrixd Matrix" by "typedef Matrixr Matrix" 
> in osg/Matrix, but It does not work because some class don't use the 
> Matrix but Matrixd or Matrixf.
> Another solution would be to develop new osg::Transform and 
> osg::MatrixTransform using the real type and the Matrixr class. But I 
> don't know how to make osg considers them as transform node without 
> inherit them from the original osg::Transform node.
> By the way, I want to know if someone have already try to do this kind 
> of thing, and/or if there is an accuracy node kit in development to help me.
>
> Best regard.
>
>
>
>
> Here is a detailed example of my problem :
> There is a star far far away from the center of the universe.
> For some reasons I MUST have this scene graph :
> [rootNode : osg::Group] -> [starTransform : osg::MatrixTransform] -> 
> [starModel : osg::Geode] -> ...
> The Matrix in the osg::MatrixTransform is a Matrixd that contains a very 
> big translation vector, for example at (x=10^20, y=0, z=0) from the 
> center of the universe.
> I want to move in the universe, close to this star at (x=10^5, y=0, z=0) 
> from the star and then at (x=10^20 + 10^5, y=0, z=0) from the center of 
> the universe.
> To compute the MODELVIEW matrix, osg implicitly compute (x=10^20 + 10^5, 
> y=0, z=0) - (x=10^20, y=0, z=0) .
> But in fact, osg works like if the camera is in the center of the 
> universe at (x=0, y=0, z=0).
> Why ? Because osg computes matrix transforms with float and double 
> values. In double : 10^20 + 10^5 = 10^20.
> So I can't freely move in my universe using Matrixd and that's why I 
> need more accuracy.
>
>
>
> --
> Lamoliatte Stephane.
> ___
> 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] changing the ambient light in Viewer?

2007-11-16 Thread Ákos Maróy
this must be the lamest question, but I don't really find an answer on
the OSG Trac wiki..

when I use Viewer (from code), how do I change the ambient light from
light blue to something else?

also, when I rotate objects, they look different from the 'back' - may
this be because of the default lighting?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FB RTT antialiasing quality downgrade

2007-11-16 Thread Ralph Kern
just some thought:

- do you disable multisampling when transferring the texture to the
screen? Otherwise you might have artifacts because of AA performed twice.

regards Ralph

Zdeněk Kussior schrieb:
> Hi,
> I'm having a bit strange problem with FrameBuffer rendering to texture,
> at least a problem for me, I'm new to OSG (1.2).
> 
> When I render my test scene standardly with Multisampling, output on
> screen is nice, smooth (see enclosed image).
> What I need is to make a distortion - render the same scene firstly to
> the FrameBuffer (Multisampling still on), then copy it to the texture,
> map it on the plane which covers the whole screen and finally render it
> again on the screen. RenderTargetImplementation is FRAME_BUFFER. Man
> would expect that what has been rendered to FB will be copied to
> texture, rendered again on plane object and results are both the same.
> Now here's the problem. They are not the same (as can be seen on
> enclosed image), the final antialiasing quality is downgraded, edges are
> not smooth but bumpy. The same effect arises with some higher types of
> Supersampling. It looks like some information has lost or has been
> "downsampled somehow" when copying from FB to texture.
> 
> I'm working on GF 8800GTX, the following lines list how it behaves with
> different AA settings:
> AA off - both screens are the same
> MS 2x - are the same
> MS 4x - are the same (but insufficient quality)
> MS 8xQ - rendered to texture and then displayed screen is worst
> SS 2x2 - RTT screen not antialiased at all
> SS 4x4 - RTT screen not antialiased at all
> SS 4xS - both look the same (pretty acceptable for my project)
> SS 8xS - RTT is worst, textured objects look a bit blurry
> SS 16xS - RTT is worst, textured objects look a bit more blurry
> SS 32xS - RTT even worst, almost looks like not antialiased (but still
> is a bit)
> 
> In project I'm working on I need to have nice smooth edges and good
> looking textures while using distortion. The SS 16xS is ideal for it,
> but suffers the same problem as described higher. I want to avoid
> pbuffer and FBO, which is not antialiased. With FBO I need to render
> image in much higher resolution, then shrink it on plane and render it
> which is what I want to avoid. I've read something about FBOs extension
> which allows AA, but I guess that OSG does not support it (sorry if I'm
> wrong).
> 
> To summarize it, my question is:
> Is it possible to get both screens totally the same with SS 16xS (or MS
> 8xQ)?
> 
> 
> 
> Thanks for any eventual advice.
> 
> Regards
> Zdenek Kussior
> 
> 
> 
> 
> 

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


Re: [osg-users] OpenFlight Multi-Texture

2007-11-16 Thread Paul Martz

Can you post a small file that reproduces the issue?

Sent from my iPhone

On Nov 16, 2007, at 3:55 AM, "Joseph Steel" <[EMAIL PROTECTED] 
> wrote:


In OSG2.2 is there a known issue with multiple textures in flight  
files. I've a terrain model with two textures but only the first  
appears.


Joseph Steel
___
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] Thread politeness

2007-11-16 Thread Robert Osfield
Hi,

The fact the OSG frame rate drops when other threads are hogging the
machine is not something the OSG can do much about itself, its largely
an issue of OS scheduling of threads, if it does it well then you
shouldn't see threads hanging completely, if it does it poorly then
you'll see what you are getting - some threads totally dominating the
machine.

The best you can do as app develop is to set priorities on the various
threads such that the non graphics threads have lower priority, and
set set processor affinity if you multiple cores.

The other thing you can do is try out an OS that can do
multi-threading properly.

Robert.

On Nov 16, 2007 2:21 PM,  <[EMAIL PROTECTED]> wrote:
> Hi everyone.  We are building a system that uses OSG and several additional 
> "job" threads (on windows XP sp2.)  Whenever one of these side jobs runs, the 
> frame rate on OSG drops, very often to zero.  Since some of these side jobs 
> may take several seconds, this is obviously a problem.  The behavior is worst 
> when one of the side threads is building an OSG object (and, therefore, I 
> assume is competing with the rendering thread for OSG locks), but the problem 
> is still severe even on threads that don't touch OSG.  For example, we have a 
> thread that makes calls into an XML parser, which, of course, doesn't even 
> know about OSG; but, whenever we are in the xml parser, OSG comes to a 
> complete standstill.  Is this an issue others have run into with OSG?  I have 
> noticed that OSG has several threading configuration options - is it just a 
> matter of picking the right threading option for OSG?  My guess is that this 
> is just an OS issue and has nothing to do with OSG,
>  but I'm asking here in hopes that someone might say "Oh, yeah, you just 
> gotta set this flag over here", or something along those lines.  Thanks.
> ___
> 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] Thread politeness

2007-11-16 Thread beelzebob999-osg
Hi everyone.  We are building a system that uses OSG and several additional 
"job" threads (on windows XP sp2.)  Whenever one of these side jobs runs, the 
frame rate on OSG drops, very often to zero.  Since some of these side jobs may 
take several seconds, this is obviously a problem.  The behavior is worst when 
one of the side threads is building an OSG object (and, therefore, I assume is 
competing with the rendering thread for OSG locks), but the problem is still 
severe even on threads that don't touch OSG.  For example, we have a thread 
that makes calls into an XML parser, which, of course, doesn't even know about 
OSG; but, whenever we are in the xml parser, OSG comes to a complete 
standstill.  Is this an issue others have run into with OSG?  I have noticed 
that OSG has several threading configuration options - is it just a matter of 
picking the right threading option for OSG?  My guess is that this is just an 
OS issue and has nothing to do with OSG,
 but I'm asking here in hopes that someone might say "Oh, yeah, you just gotta 
set this flag over here", or something along those lines.  Thanks.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Taking screenshots using OSG 2.2

2007-11-16 Thread Robert Osfield
Hi Edurado,

The osgViewer::Viewer can will run multi-threaded by default in you
have enough CPU cores available, and can open up multiple windows in
you have multiple screens, both these issues mean that the thread that
runs the main frame loop will not always have a valid graphics context
current so its not sensible to do OpenGL calls from the frame loop.

The way to do it is to add a post draw camera callback, this is called
after render of the camera contents.

Robert.

On Nov 16, 2007 12:46 PM, Eduardo Gutiérrez Sanmartín
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> While using OSG version 1.20, I was taking screenshots with the following
> code:
>
> while( !viewer.done() )
> {
> viewer.frame();
>
> // Here I get x, y, width and height.
>
> osg::Image *image = new osg::Image;
> image->readPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE);
> osgDB::writeImageFile(*image, "capture.bmp");
> }
>
> The obtained image was correct - however, with OSG 2.2 it is not.
>  I am obtaining a totally black image (and it seems that x, y, width and
> height are the right values).
>
> Is there something wrong here? How do I take a screenshot of my application?
>
> Thx!
>
> Edu
>
>
> ___
> 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] Taking screenshots using OSG 2.2

2007-11-16 Thread Schmidt, Richard, SDGE1
Depending on our hardware, the viewer may run in multithreaded mode, which 
means you can't access the openGL context everytime everywhere. Try setting 
your viewer into singlethreaded mode with ViewerBase::setThreadingModel( ... ) 
. The context should be available all the time now...

 

Richard

 



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eduardo 
Gutiérrez Sanmartín
Sent: Friday, November 16, 2007 1:47 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Taking screenshots using OSG 2.2

 

Hello,

While using OSG version 1.20, I was taking screenshots with the following code:

while( !viewer.done() )
{
viewer.frame();

// Here I get x, y, width and height.

osg::Image *image = new osg::Image; 
image->readPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE);
osgDB::writeImageFile(*image, "capture.bmp");
}

The obtained image was correct - however, with OSG 2.2 it is not.
I am obtaining a totally black image (and it seems that x, y, width and height 
are the right values).

Is there something wrong here? How do I take a screenshot of my application?

Thx!

Edu

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


[osg-users] Taking screenshots using OSG 2.2

2007-11-16 Thread Eduardo Gutiérrez Sanmartín
Hello,

While using OSG version 1.20, I was taking screenshots with the following
code:

while( !viewer.done() )
{
viewer.frame();

// Here I get x, y, width and height.

osg::Image *image = new osg::Image;
image->readPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE);
osgDB::writeImageFile(*image, "capture.bmp");
}

The obtained image was correct - however, with OSG 2.2 it is not.
I am obtaining a totally black image (and it seems that x, y, width and
height are the right values).

Is there something wrong here? How do I take a screenshot of my application?

Thx!

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


Re: [osg-users] Getting nodes when reading .obj file

2007-11-16 Thread Alberto Luaces
I also noticed this behaviour when loading a .OBJ file containing a single 
mesh. It was split by the loader into a group holding 70 geodes. I think it 
might be done so for performance reasons.

To address your problem you could try the following:

- Save each object into a different file, so you at least have a parent group 
to manage each object.
- Use the osgUtil::Optimizer in order to see if flags like 
REMOVE_REDUNDANT_NODES, MERGE_GEOMETRY, MERGE_GEODES can help you.

HTH,

Alberto

El Friday 16 November 2007 08:34:56 Robert Borchers escribió:
> I tried this but it's the same problem. I get also my 12 objects instead
> of the wanted 3. It's the same output as in my version.
> Is there an easy way to get the whole objects or do I have to run
> through the graph collecting the names an then adding all objects with
> the same name to one single transform to let them stay together? And
> what if a user give two objects the same name?
>
> Rafa Gaitan schrieb:
> > Hi Robert,
> >
> > The best you can use is a NodeVisitor. Inside osgsimulation example
> > there is a FindNamedNodeVisitor that could help you in the task.
> >
> > Rafa.
> >
> > On 11/16/07, Robert Borchers <[EMAIL PROTECTED]> wrote:
> >  
> >
> >> Hi,
> >>
> >> I want to read in nodes from a .obj or .3ds file.
> >>
> >> For doing this I use
> >> osg::ref_ptr osgNode = osgDB::readNodeFile(snode.filename);
> >>
> >> Now I want to get the objects from this file. This shall be a Square, a
> >> Sphere and a Pyramid. I tried to do this by using:
> >>
> >> osg::ref_ptr myOsgGroup;
> >> myOsgGroup = osgNode->asGroup(); // returns NULL if not a group.
> >>
> >> for (unsigned int i = 0 ; i < myOsgGroup->getNumChildren(); i ++) {
> >>       osg::ref_ptr myTempNode = myOsgGroup->getChild(i);
> >>      cout << "nodename = " << myTempNode->getName() << endl;
> >> }
> >>
> >>
> >> But the result of this operation is that I get 12 Objects instead of the
> >> 3. 6 for the square, 5 for the pyramid and 1 for the sphere.
> >> What have I to do to get just the 3 Objects so I can play around with
> >> them ?
> >>
> >> Thanks
> >> Robert


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


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Mario Valle
Look at the following code (Refresh fires OnPaint that fires viewer->frame())
void Canvas::OnIdle(wxIdleEvent& event)
{
if (_updateWhenIdle || _updateWhenIdleOverride)
{
Refresh();
event.RequestMore();
}
}
Without this logic the viewer was continually spinning.
Hope it helps
mario

Ákos Maróy wrote:
> Mario Valle wrote:
>> The recently posted wxTabbed example has a method to block update till 
>> they are needed. Look at it.
> 
> do you mean the sample in this message:
> 
> http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2007-October/003972.html
> 
> ?
> 
> I glanced at it, but the 'block until updated needed' aspect of the code
> sample wasn't obvious :(
> 
> 
> Akos
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

-- 
Ing. Mario Valle
Visualization Group  | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Getting nodes when reading .obj file

2007-11-16 Thread Robert Borchers
Hi Rafa,

I tried this but it's the same problem. I get also my 12 objects instead 
of the wanted 3. It's the same output as in my version.
Is there an easy way to get the whole objects or do I have to run 
through the graph collecting the names an then adding all objects with 
the same name to one single transform to let them stay together? And 
what if a user give two objects the same name?

Rafa Gaitan schrieb:
> Hi Robert,
>
> The best you can use is a NodeVisitor. Inside osgsimulation example
> there is a FindNamedNodeVisitor that could help you in the task.
>
> Rafa.
>
> On 11/16/07, Robert Borchers <[EMAIL PROTECTED]> wrote:
>   
>> Hi,
>>
>> I want to read in nodes from a .obj or .3ds file.
>>
>> For doing this I use
>> osg::ref_ptr osgNode = osgDB::readNodeFile(snode.filename);
>>
>> Now I want to get the objects from this file. This shall be a Square, a
>> Sphere and a Pyramid. I tried to do this by using:
>>
>> osg::ref_ptr myOsgGroup;
>> myOsgGroup = osgNode->asGroup(); // returns NULL if not a group.
>>
>> for (unsigned int i = 0 ; i < myOsgGroup->getNumChildren(); i ++) {
>>   osg::ref_ptr myTempNode = myOsgGroup->getChild(i);
>>  cout << "nodename = " << myTempNode->getName() << endl;
>> }
>>
>>
>> But the result of this operation is that I get 12 Objects instead of the
>> 3. 6 for the square, 5 for the pyramid and 1 for the sphere.
>> What have I to do to get just the 3 Objects so I can play around with them ?
>>
>> Thanks
>> Robert
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>> 
>
>
>   

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


[osg-users] OpenFlight Multi-Texture

2007-11-16 Thread Joseph Steel
In OSG2.2 is there a known issue with multiple textures in flight files.
I've a terrain model with two textures but only the first appears.

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


[osg-users] Problem changing Stateset

2007-11-16 Thread Enrico Villani
Hello, I have a osg::Node* that has applied a osg::StateSet*  with many
Attribute, in particular an osg::Material*.  When I try to switch the
stateset to another, no changes are visible.

I tried with

node->setStateSet(TheOtherStateSet);

and

osg::stateSet* tmp = node.getOrCreateStateSet();
tmp = TheOtherStateSet;


but it doesn't work correctly.

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


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Ákos Maróy
Mario Valle wrote:
> No, methods from TrackballManipulator help you in understanding when you are 
> interacting
> with the viewer and so when you need to call frame().

I'm looking at it, it's in the Canvas class, which is a descendant of
wxGLCanvas - which is not an OSG class, or is it?


Akos

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


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Mario Valle
No, methods from TrackballManipulator help you in understanding when you are 
interacting
with the viewer and so when you need to call frame().
Ciao!
mario


Ákos Maróy wrote:
> Mario Valle wrote:
>> Look at the following code (Refresh fires OnPaint that fires viewer->frame())
>> void Canvas::OnIdle(wxIdleEvent& event)
>> {
>>  if (_updateWhenIdle || _updateWhenIdleOverride)
>>  {
>>  Refresh();
>>  event.RequestMore();
>>  }
>> }
>> Without this logic the viewer was continually spinning.
> 
> I see, but these are not OSG calls, but wxWindows calls.
> 
> is it so that one cannot achieve this functionality with OSG, but has to
> look outside to a windowing API?
> 
> 
> Akos
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

-- 
Ing. Mario Valle
Visualization Group  | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] The Next-Gen Game Engine Creature3D

2007-11-16 Thread Thibault Genessay
Hi WuCaihua

I have just tested your app on my Dell D820 Laptop (NVIDIA Quadro NVS
110 M) and it went further than previously, but still crashed at some
point.
The graphics window showed up, but when the progress bar finished, the
whole system crashed. I suspect a video driver problem as those are
normally the causes of OS crashes. Anyway I had to reboot and my
display was screwed - a windowed mode, rather than only fullscreen at
a fixed resolution, would be cool.

I guess I'll wait for other people with real graphics card to test
your app before I crash my OS again :)

Cheers

Thibault

On Nov 16, 2007 9:54 AM, 吴才华 <[EMAIL PROTECTED]> wrote:
> Hi,
>   I tested my program in WinXP EN, and I found the causation. The file which
> has Chinese name can not be readed in EN version of Windows.
>   Copy TextAndMouse.cfg to the directory of Creature3DGame/res/.
>   Copy Mouse1.tga to the directory of Creature3DGame/res/image/.
>   Then run Creature3D.exe
>   There also has many images that named with Chinese letters, but it won't
> crashes the program.
>   I will correct these errors soon and upload to the web of
> http://cid-cc7befe115bfbec3.skydrive.live.com/browse.aspx/Public
>
>   Thinks to Jean-Sébastien and Thibault.
>
> WuCaihua
> 2007.11.16
> ___
> 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] Getting nodes when reading .obj file

2007-11-16 Thread Alberto Luaces
El Friday 16 November 2007 10:18:59 Robert Borchers escribió:
> Thanks a lot, I'll have a look at this. I didn't know that the obj file
> generation was the reason for this behaviour, but now I know where to
> search for a solution.

I don't know if the OBJ reader is the exact reason, because I currently only 
use this format. I should take a look to the source code, but I hadn't any 
time to do this.

> But the "automagic" function Robert mentioned would be a great tool :)

Yes it is. You can also do something similar in your program using the 
osgDB::writeNodeFile() function, so you can also dump only the subgraph you 
are interested in.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Getting nodes when reading .obj file

2007-11-16 Thread Robert Borchers
Thanks a lot, I'll have a look at this. I didn't know that the obj file 
generation was the reason for this behaviour, but now I know where to 
search for a solution.
But the "automagic" function Robert mentioned would be a great tool :)
> I also noticed this behaviour when loading a .OBJ file containing a single 
> mesh. It was split by the loader into a group holding 70 geodes. I think it 
> might be done so for performance reasons.
>
> To address your problem you could try the following:
>
> - Save each object into a different file, so you at least have a parent group 
> to manage each object.
> - Use the osgUtil::Optimizer in order to see if flags like 
> REMOVE_REDUNDANT_NODES, MERGE_GEOMETRY, MERGE_GEODES can help you.
>
> HTH,
>
> Alberto
>
> El Friday 16 November 2007 08:34:56 Robert Borchers escribió:
>   
>> I tried this but it's the same problem. I get also my 12 objects instead
>> of the wanted 3. It's the same output as in my version.
>> Is there an easy way to get the whole objects or do I have to run
>> through the graph collecting the names an then adding all objects with
>> the same name to one single transform to let them stay together? And
>> what if a user give two objects the same name?
>>
>> Rafa Gaitan schrieb:
>> 
>>> Hi Robert,
>>>
>>> The best you can use is a NodeVisitor. Inside osgsimulation example
>>> there is a FindNamedNodeVisitor that could help you in the task.
>>>
>>> Rafa.
>>>
>>> On 11/16/07, Robert Borchers <[EMAIL PROTECTED]> wrote:
>>>  
>>>
>>>   
 Hi,

 I want to read in nodes from a .obj or .3ds file.

 For doing this I use
 osg::ref_ptr osgNode = osgDB::readNodeFile(snode.filename);

 Now I want to get the objects from this file. This shall be a Square, a
 Sphere and a Pyramid. I tried to do this by using:

 osg::ref_ptr myOsgGroup;
 myOsgGroup = osgNode->asGroup(); // returns NULL if not a group.

 for (unsigned int i = 0 ; i < myOsgGroup->getNumChildren(); i ++) {
   osg::ref_ptr myTempNode = myOsgGroup->getChild(i);
  cout << "nodename = " << myTempNode->getName() << endl;
 }


 But the result of this operation is that I get 12 Objects instead of the
 3. 6 for the square, 5 for the pyramid and 1 for the sphere.
 What have I to do to get just the 3 Objects so I can play around with
 them ?

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

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


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Ákos Maróy
Mario Valle wrote:
> Look at the following code (Refresh fires OnPaint that fires viewer->frame())
> void Canvas::OnIdle(wxIdleEvent& event)
> {
>   if (_updateWhenIdle || _updateWhenIdleOverride)
>   {
>   Refresh();
>   event.RequestMore();
>   }
> }
> Without this logic the viewer was continually spinning.

I see, but these are not OSG calls, but wxWindows calls.

is it so that one cannot achieve this functionality with OSG, but has to
look outside to a windowing API?


Akos

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


Re: [osg-users] Getting nodes when reading .obj file

2007-11-16 Thread Rafa Gaitan
Hi Robert Borchers,

Anyway, you can implement your own NodeVisitor, to do all you need,
The example of FindNamedNodeVisitor is only an example, and you could
begin with it. I think there is no easy or generic solution, as Robert said you
should know how your scene is loaded.

You could get the intermediate transforms for any
object in the scene using osg::computeWorldToLocal(nv->getNodePath())
inside the node visitor. This maybe could also help you.


Rafa.

On 11/16/07, Robert Osfield <[EMAIL PROTECTED]> wrote:
> On Nov 16, 2007 7:34 AM, Robert Borchers <[EMAIL PROTECTED]> wrote:
> > Hi Rafa,
> >
> > I tried this but it's the same problem. I get also my 12 objects instead
> > of the wanted 3. It's the same output as in my version.
> > Is there an easy way to get the whole objects or do I have to run
> > through the graph collecting the names an then adding all objects with
> > the same name to one single transform to let them stay together? And
> > what if a user give two objects the same name?
>
> You scene will be stored as 12 objects, the OSG will be loading these.
>  Now you might be associating these twelve objects in some manner to
> logically be treated as just 3, but how are you doing this
> association?  By naming?  Is it something you are doing in the
> modeller?  How are you doing it?  The OSG can't "automagic"
> associations that it knows nothing about, and it can't recover things
> that are lost in export to some formats.
>
> To understand what the OSG is generating convert the file to a .osg
> ascii and that have a read through it with an editor.
>
>osgconv myfile.obj myfile.osg
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Getting nodes when reading .obj file

2007-11-16 Thread Robert Osfield
On Nov 16, 2007 7:34 AM, Robert Borchers <[EMAIL PROTECTED]> wrote:
> Hi Rafa,
>
> I tried this but it's the same problem. I get also my 12 objects instead
> of the wanted 3. It's the same output as in my version.
> Is there an easy way to get the whole objects or do I have to run
> through the graph collecting the names an then adding all objects with
> the same name to one single transform to let them stay together? And
> what if a user give two objects the same name?

You scene will be stored as 12 objects, the OSG will be loading these.
 Now you might be associating these twelve objects in some manner to
logically be treated as just 3, but how are you doing this
association?  By naming?  Is it something you are doing in the
modeller?  How are you doing it?  The OSG can't "automagic"
associations that it knows nothing about, and it can't recover things
that are lost in export to some formats.

To understand what the OSG is generating convert the file to a .osg
ascii and that have a read through it with an editor.

   osgconv myfile.obj myfile.osg

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


Re: [osg-users] The Next-Gen Game Engine Creature3D

2007-11-16 Thread 吴才华
Hi,
  I tested my program in WinXP EN, and I found the causation. The file which 
has Chinese name can not be readed in EN version of Windows. 
  Copy TextAndMouse.cfg to the directory of Creature3DGame/res/.
  Copy Mouse1.tga to the directory of Creature3DGame/res/image/.
  Then run Creature3D.exe
  There also has many images that named with Chinese letters, but it won't 
crashes the program.
  I will correct these errors soon and upload to the web of 
http://cid-cc7befe115bfbec3.skydrive.live.com/browse.aspx/Public
  
  Thinks to Jean-Sébastien and Thibault.
 
WuCaihua
2007.11.16

TextAndMouse.cfg
Description: Binary data


Mouse1.tga
Description: Binary data
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG CPU usage

2007-11-16 Thread Bob Kuehne
yes - osgviewer simply 'free runs', that is, renders new frames  
constantly, as fast as it can. hence, it's always busy doing  
something, even if that's just redrawing the same picture.

bob

On Nov 15, 2007, at 9:22 AM, Ákos Maróy wrote:

> Hi,
>
> I'm new to OSG..
>
> I compiled OSG on my Linux box, and I see that any OSG application I
> start, it maxes out the CPU, even when seemingly it doesn't do much
> like I open osgviewer with a model (say cow.osg), and then don't touch
> the window (no rotation, zoom,etc.) - and top shows the viewer taking
> all my CPU time
>
> is there a specific reason for this?
>
>
> Akos
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

bob kuehne
founder and ceo - blue newt software
www.blue-newt.com734/834-2696


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


Re: [osg-users] osgdot - a tool to generate a picture of a scenegraph's structure

2007-11-16 Thread Jean-Sébastien Guay
Hello Paul,

> I hereby post this tool to the list.

Nice, I'm sure this could be expanded easily. I hope Robert agrees to  
include this in the distribution (given its small size and usefulness  
as a learning tool).

Thanks!

J-S
-- 
__
Jean-Sebastien Guay [EMAIL PROTECTED]
 http://whitestar02.webhop.org/


This message was sent using IMP, the Internet Messaging Program.


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