Re: [osg-users] Terrain looking nicer

2008-11-09 Thread Robert Osfield
Hi Alejandro,

Is you question just about doing sky and clouds and not really
anything to do with terrain?  It does seem like most your email and
subject line is just thrown in to thrown one off.

Robert.

On Sun, Nov 9, 2008 at 5:06 AM, Alejandro Aguilar Sierra
[EMAIL PROTECTED] wrote:
 Hello:

 I made a new palette (cpt format from GMT) and created a new texture
 for my terrain, that resembles better the image from google earth
 (attached terrain and google earth images). I am using last minute osg
 an vpb from the repository.I am not sure if the way I created the
 geotiff file for the texture is the right way, but it works.

 gdal_translate -of GTiff -co TILED=YES -a_srs EPSG:4326 -a_ullr -99
 20 -97 19 volcanes_tx.png volcanes_tx.tif

 Now that my terrain is looking nicer, I want to add sky, clouds and
 navigate over it from a point of view of a low flight.

 Any suggestions will be welcome. :-)

 Best regards,

 -- A.

 ___
 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] osgDB::readNodeFile question.

2008-11-09 Thread YangXiao
Hi everyone
I write a  test.osg file and use osgviewer test.osg .It's OK.
   But   When i  osgDB::readNodeFile read a *.osg file and -
  viewer-setSceneData(model_geode);

   return viewer-run(); 
  It's a runtime error Below.
   
  Best Regards.
  YangXiao
   
   
   

   
-
 雅虎邮箱,您的终生邮箱!inline: a.JPG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgDB::readNodeFile question.

2008-11-09 Thread Robert Osfield
Hi YangXiao,

This is basic debugging... is model_geode a NULL??

Also why the word geode in the ptr, readNodeFile returns  Node* not
Geode*.   Most scene graphs will not have a Geode at the top of the
scene graph.  Since you don't supply the offending code we can't
really guess at what mistakes you've actually made.

Robert.

2008/11/9 YangXiao [EMAIL PROTECTED]:
 Hi everyone
   I write a  test.osg file and use osgviewer test.osg .It's OK.
  But   When i  osgDB::readNodeFile read a *.osg file and -
 viewer-setSceneData(model_geode);
  return viewer-run();
 It's a runtime error Below.

 Best Regards.
 YangXiao




 
 雅虎邮箱,您的终生邮箱!
 ___
 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] 回复: Re: 回复: Re: 回复: R e: osgDB::readNodeFile question.

2008-11-09 Thread Wang Rui
Hi YangXiao

I don't think it safe in a multi-thread program. The drawables' update
callbacks are handled in Viewer::updateTraversal(), and may conflict with
the last rendering traversal. Maybe you would change to single thread mode
or use setDataVariance() to set the drawable to be dynamic.

Wang Rui
2008/11/9 YangXiao [EMAIL PROTECTED]

 Thanks *Wang Rui I check color array size equal to vertex array size.*
 **
 I means can i update Drawable color array in DrawableUpdateCallback?

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


[osg-users] 回复: Re: osgDB::readNodeFil e question.

2008-11-09 Thread YangXiao
this is my model.osg file head.
   Geode {
nodeMask 0x
cullingActive TRUE
num_drawables 1
Geometry {
  useDisplayList TRUE
  useVertexBufferObjects FALSE
  PrimitiveSets 1
  {
DrawArrays TRIANGLES 0 844805
  }
  VertexArray UniqueID Vec3Array_0 Vec3Array 140803
  {
...
   
  }
  VertexIndices UIntArray 844806   {
  
   
  }
  

Robert Osfield [EMAIL PROTECTED] 写道:
  Hi YangXiao,

This is basic debugging... is model_geode a NULL??

Also why the word geode in the ptr, readNodeFile returns Node* not
Geode*. Most scene graphs will not have a Geode at the top of the
scene graph. Since you don't supply the offending code we can't
really guess at what mistakes you've actually made.

Robert.

2008/11/9 YangXiao :
 Hi everyone
 I write a test.osg file and use osgviewer test.osg .It's OK.
 But When i osgDB::readNodeFile read a *.osg file and -
 viewer-setSceneData(model_geode);
 return viewer-run();
 It's a runtime error Below.

 Best Regards.
 YangXiao




 
 雅虎邮箱,您的终生邮箱!
 ___
 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] rewrite glTexImage2D() with OSG

2008-11-09 Thread Robert Osfield
Hi RHX,

You just using an osg::Texture2D class.  Have a search throw the
example directories for instances of Texture2D.  Also have a browse
through the include/osg/Texture and include/osg/Texture2D headers as
this will provide lots of OpenGL familiar methods and enums so you
should feel at home.

Robert.

On Sun, Nov 9, 2008 at 7:49 AM, dmu_rhx [EMAIL PROTECTED] wrote:
 Hi!
 I wrote a program with opengl, now I want to rewrite the program with
 OSG. But I don't know how to rewrite the following code:

 glGenTextures(1, texture[l]);
 glBindTexture(GL_TEXTURE_2D, texture[l]);
 glTexParameteri(GL_TEXTURE_2D,GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB_FLOAT16_ATI, WaterTexSize,
 WaterTexSize, 0, GL_RGBA, GL_FLOAT, pBuf);

 This code generates a texture using the data saved in pBuf. How
 to rewrite this code with OSG?
 Thank you!
  RHX



 
 [广告] 金秋最关注楼盘-房不胜房
 ___
 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] 回复: Re: osgDB::readNodeFil e question.

2008-11-09 Thread YangXiao
Thanks  Robert.
   I confirm model_geode a not NULL,When i convert my model.osg--model.IVE   
return viewer-run() is OK. Why?
   
  

Robert Osfield [EMAIL PROTECTED] 写道:
  Hi YangXiao,

This is basic debugging... is model_geode a NULL??

Also why the word geode in the ptr, readNodeFile returns Node* not
Geode*. Most scene graphs will not have a Geode at the top of the
scene graph. Since you don't supply the offending code we can't
really guess at what mistakes you've actually made.

Robert.

2008/11/9 YangXiao :
 Hi everyone
 I write a test.osg file and use osgviewer test.osg .It's OK.
 But When i osgDB::readNodeFile read a *.osg file and -
 viewer-setSceneData(model_geode);
 return viewer-run();
 It's a runtime error Below.

 Best Regards.
 YangXiao




 
 雅虎邮箱,您的终生邮箱!
 ___
 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] 回复: Re: How to bind a osgGA ::TrackballManipulator to a scene node!

2008-11-09 Thread Robert Osfield
Hi YangXiao,

2008/11/9 YangXiao [EMAIL PROTECTED]:
 Thanks Robert .
 I means   to bind a osgGA::TrackballManipulator only  to
 a scene node, and others scene node i use PickHandler(). Can I achieve this
 function?

Sorry still non the wiser.   Do you mean track a node in the scene
graph like osgGA::NodeTrackerManipulator?

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


[osg-users] 回复: Re: 回复: Re: 回复: Re: osgDB::readNodeFile question.

2008-11-09 Thread YangXiao
Thanks Wang Rui I check color array size equal to vertex array size.
  
I means can i update Drawable color array in DrawableUpdateCallback?
  
Wang Rui [EMAIL PROTECTED] 写道:
Hi YangXiao,
  
I think you should enough elements (equals to the size of the vertex array) in 
the color array if using BIND_PER_VERTEX.
   
  Wang Rui
   
  2008/11/9 YangXiao [EMAIL PROTECTED]
Thanks Robert 
  Now i error is in my DrawableUpdateCallback
   
  void  DrawableUpdateCallback::update(osg::NodeVisitor* nv, osg::Drawable* 
drawable)
{
  osg::Geometry* polyGeom  = dynamic_castosg::Geometry* (drawable);
colors-push_back(osg::Vec4(1,0,0,1));  .
  polyGeom-setColorArray(colors.get());  
  polyGeom-setColorBinding(osg::Geometry::BIND_OVERALL); 
  
}
  This is ok.
  But when i use 
  {
 
colors-push_back(osg::Vec4(1,0,0,1));
  polyGeom-setColorArray(colors.get());  
  polyGeom-setColorBinding(osg::Geometry::BIND_PER_VERTEX); 
  }
   
  There is runtime error.That is when i computer my new colors per vertex, I 
can not bind these new color array to my Drawable in DrawableUpdateCallback
   
  Best Regards.
 


___
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] VPB: Superimposed or switch different textures possible?

2008-11-09 Thread Robert Osfield
On Sun, Nov 9, 2008 at 1:15 AM, Alejandro Aguilar Sierra
[EMAIL PROTECTED] wrote:
 Hi Robert and Umit,

 How should I run the osgmultitexturecontrol example?

You'll need to pass it a database with multiple texture in it.  We
don't have one provide in OpenSceneGraph-Data yet or one online.  I
wrote this example to test the combination of VPB built database with
mulitple layers and osgFX::MultiTextureControl feature.

I do plan on uploading a database with paged multiple layers to
openscenegraph.org, but this hasn't risen to the top of my todo list
yet.

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


Re: [osg-users] 回复: Re: 回复: Re: osgDB::r eadNodeFile question.

2008-11-09 Thread Wang Rui
Hi YangXiao,

I think you should enough elements (equals to the size of the vertex
array) in the color array if using BIND_PER_VERTEX.

Wang Rui

2008/11/9 YangXiao [EMAIL PROTECTED]

 Thanks *Robert *
 *Now i error is in my *DrawableUpdateCallback
 **
 void  DrawableUpdateCallback::update(osg::NodeVisitor* nv, osg::Drawable*
 drawable)
 {
   osg::Geometry* polyGeom  = dynamic_castosg::Geometry* (drawable);
   colors-push_back(osg::Vec4(1,0,0,1));  .
   polyGeom-setColorArray(colors.get());
   polyGeom-setColorBinding(osg::Geometry::BIND_OVERALL);

 }
 This is ok.
 But when i use
 {

   colors-push_back(osg::Vec4(1,0,0,1));
   polyGeom-setColorArray(colors.get());
   polyGeom-setColorBinding(osg::Geometry::BIND_PER_VERTEX);
 }

 There is runtime error.That is when i computer my new colors per vertex, I
 can not bind these new color array to my Drawable in DrawableUpdateCallback

 Best Regards.


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


[osg-users] 回复: Re: 回复: Re: osgDB:: readNodeFile question.

2008-11-09 Thread YangXiao
Thanks Robert 
  Now i error is in my DrawableUpdateCallback
   
  void  DrawableUpdateCallback::update(osg::NodeVisitor* nv, osg::Drawable* 
drawable)
{
  osg::Geometry* polyGeom  = dynamic_castosg::Geometry* (drawable);
colors-push_back(osg::Vec4(1,0,0,1));  .
  polyGeom-setColorArray(colors.get());  
  polyGeom-setColorBinding(osg::Geometry::BIND_OVERALL); 
   
}
  This is ok.
  But when i use 
  {
 
colors-push_back(osg::Vec4(1,0,0,1));
  polyGeom-setColorArray(colors.get());  
  polyGeom-setColorBinding(osg::Geometry::BIND_PER_VERTEX); 
  }
   
  There is runtime error.That is when i computer my new colors per vertex, I 
can not bind these new color array to my Drawable in DrawableUpdateCallback
   
  Best Regards.
  

Robert Osfield [EMAIL PROTECTED] 写道:
  2008/11/9 YangXiao :
 Thanks Robert.
 I confirm model_geode a not NULL,When i convert my model.osg--model.IVE
 return viewer-run() is OK. Why?

Why? If you can't answer it with all the code in front there is
almostly no way I can answer it without ANY of your code infront of
me. Am I omnipresent? No, I am human being.

My last email indicated that your original email had too little info,
and you follow up email totally lack any of the code that is causing.
Please think about reading the replies. Untill you provide sufficient
information I will not provide any further replies as it's pointless.

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] NodeKit integration in OpenSceneGraph-2.x series

2008-11-09 Thread Robert Osfield
Hi All,

There has been lots of discussion about various NodeKit or last month
or two.  In OSG-2.6 we saw the introduction of osgWidget from the
community, in OSG-2.8 we'll see the integration of new osgVolume
library.  OSG-2.10 is likely to see the integration of osgAnimation,
but if things converge quickly for this NodeKIt it might even make it
into OSG-2.8.

There are other NodeKits out into the community, some are up to date
and well maintained others rather dormant or even orphaned.  Each of
these NodeKit could be put forward for integration with the core OSG.
Whether any of these should be integrated and if so how one goes about
is something that is worthy of discussion. I don't think we need
heavily structured metrics to measure NodeKits against, but some
informal metrics might help provide some transparency in the process.
Here's a couple to get started with:

1) What overall feature set does the OpenSceneGraph need as it evolves
to better meet the common needs of the community?

   All NodeKits needs to be take as a step towards this goal, this
includes ones already in OpenSceneGraph trunk.

   But how to define the goals for the OpenSceneGraph for the 2.x and
3.x series and beyond?

2) All NodeKit to make into the core OpenSceneGraph need to be
portable across all platforms. (Or might there be exceptions??)

3) All NodeKit to make into the core OpenSceneGraph need to fit to the
C++ design and coding style

4) All NodeKit need to be activity used and supported by a range of
members in the community.

5) Granularity of NodeKits need to fit the function as well as the
breadth/complexity of functionality encompassed.

6) Where functionality of two NodeKits overlap then for integration to
occur the NodeKit need to be merged in some fashion,
this might be that osgOriginal and osgNew get merged into
osgOriginal, or even into a osgBetterNameForCombination.

Migration to new merged classes/NodeKits would require a system
for helping existing users migrate / provide deprecated functionality
for a defined period.

7) Naming of NodeKits should be descriptive of it's function, prefer
long descriptive name over short acronyms.

8) NodeKits should have ascii read/write support, but ideally binary
support too (we really need an extensible binary format).

9) NodeKits must be wrap-able via osgIntrospection/genwrapper.

10) NodeKit should facilitate collaboration and quell fragmentation of
code and developer resources.

11) NodeKit should be of solid design and implementation quality.

12) NodeKit and dependency proliferation should be deemed a negative
quality - a NodeKit must add real value to compensate for the
 extra complexity it introduces.

OK, feel free to add more/refine the above.  Once this discussion
reaches some kind of conclusion I'll put up a page on the WIKI
summarising it all.

Putting the above metric against the core OSG NodeKits we see a couple
of libs that perhaps could be renamed/refactored.  osgSim and osgGA
aren't descriptive names at all.  osgDB is not much better, put
probably not quite so bad and it's not a NodeKit so exempt from all
common sense :-)

osgGA is very old and clunky which could do with a revamp, such as
revamp might be a good time to merge the functionality it provides
into other NodeKits.  Perhaps some functionality going into core OSG,
some into osgUtil, the rest into osgWidget/and or osgViewer?  This
would give us one less NodeKit to worry
about.

osgSim is a bit of rag tag collection of functionality.  It's role is
primarily our osgVisualSimulation NodeKit, although some of the
functionality is bit more general than this.

--

Then we have functionality that it might be good to have in the core
OSG, animation, audio, physics and ephemeris models are all what I
would deem as worthy for inclusion to the OSG.   I mention these as
they are functionality that I believe meets item 1 above - they are
useful to a wide range of OSG users, they make the OSG more useful off
the shelf.

Animation is something that is under-way in the form of osgAnimation,
which started life as AnimTK and has evolved rapidly to tick many more
of the above items, so it looks to be rapidly becoming a good
candidate for inclusion.

Audio is something that could be filled by osgAL, but I've done
reviews of it before with a mind to merging it as an osgAudio library
but felt that it needed work before it was ready for inclusion.

Physics is an integration issue as we'll never attempt to do wholesale
physics ourselves, I haven't reviewed any strong candidates for this
role yet.

Ephemeris model - accurate day and night sky rendering is something
that osgEphemeris could serve as base for.  When I review it a couple
of years back I felt that it was it wasn't ready for integration, and
it's evolved little since.  The osgEphemeris distribution is rather
spread out and overly hard-wired for it to really
shine as an OSG NodeKit.   A tighter library which automatically
supports tracking of time 

Re: [osg-users] Need explanation about a strange behaviour with RenderBin

2008-11-09 Thread Sukender
Hi Robert and Jean-Sébastien,

Thanks for your ideas. My model is an .osg so I know there is a normal array 
and no texturing, and I manually replaced OPAQUE/DEFAULT.

You both said that I need a colour array with at least one overall colour.
Well, can you tell me why I need a colour array? I don't know why the color 
array from some other drawables will bleed into any other drawable which does 
not have a color array. Maybe an openGL consideration I'm not aware of...
Anyway, there is a Material in my object (as posted before), but no colour 
array. So I added:
  ColorArray 1 {
1.0 1.0 1.0 1.0
  }
  ColorBinding BIND_OVERALL
in each Geometry in the .osg, just as you both suggested, but it has no effect.

That's *really really* strange... As maybe noone has enough time for such a 
problem, I think I'm going to drop it and create a workaround by tweaking the 
Blender exporter. If I'm wrong (= someone has enough time), just tell me so 
that I send the code.

Thank you very much for your help.

-- 
Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Fri, 07 Nov 2008 10:51:19 +0100, Robert Osfield [EMAIL PROTECTED] a écrit:

 On Fri, Nov 7, 2008 at 12:14 AM, Sukender [EMAIL PROTECTED] wrote:
 Hi again Robert,

 I confirm that the strange behavior still exist while compiling against the 
 rev 9119 (branch osgWidget-dev).

 I don't have any further suggests beyond my earlier suggestion that
 some vertex data such as normals, texcoord or colour arrays aren't
 assigned to geometries that they should be.  Write you model out to
 .osg and have a look through them.  If you have lighting on then
 you'll need a normal array, if you are use default osg::Material
 you'll need at a colour array with at least one overall colour, if you
 are doing texturing then you'll need texture coords.

 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] NodeKit integration in OpenSceneGraph-2.x series

2008-11-09 Thread Erik den Dekker

  Animation is something that is under-way in the form of osgAnimation,
  which started life as AnimTK and has evolved rapidly to tick many more
  of the above items, so it looks to be rapidly becoming a good
  candidate for inclusion.
 
 Just a parenthesis - I gave quite a bit of feedback to Cedric about
 this. I think that there are some design issues that need to be
 addressed first, before it even reaches basic feature parity with
 existing code in osgCal or Replicant when concerning basic animation
 support (not the more advanced stuff in Replicant).

Jan, I followed your comments to Cedric and above with interest. You made
several important remarks to ensure that osgAnimation will properly support
character animation / skeletal animation. 

However, I wonder if you are not putting too much emphasis on just this
aspect while there may be more ways to do and use animation. It is my
understanding that animation means that a certain aspect of a scene is under
control so it can be changed over time. This aspect is usually orientation,
position or scale, but may also be color, a float weight, a bool, a string,
etc... maybe some custom type. IMHO osg should take a generic approach
towards animation, albeit probably not too generic :). Perhaps 3D studio max
(or similar - I just happen to have some experience with this app) can be
taken as an example how to approach animation. It uses animation controllers
and key frame animation to implement animation and in my experience this is
quite flexible. I wonder how far osgAnimation should go in replicating
similar functionality.

This said, I must admit that I have only quickly glanced over osgAnimation
in its current state, and I believe it already supports much of what I
mentioned.

Cheers,

Erik den Dekker



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


Re: [osg-users] controlling swap

2008-11-09 Thread Jean-Sébastien Guay

Hi Ed,

After reading osgViewer::Viewer vs osgViewer::CompositeViewer, I think 
I might need to use CompositeViewer at some point in the future of my 
project, but not at the outset.  Should I begin with the 
CompositeViewer, or make the necessary mods later?  How difficult is it 
to change from Viewer to CompositeViewer later?


If I remember correctly, at the end of that very thread it was mentioned 
that the switch is not hard at all.


However, using CompositeViewer is not that much overhead over Viewer, so 
if you will need it for sure I would start out with CompositeViewer at 
the start, so that everything is already there and you don't have any 
surprises.


Just my opinion, mind you.

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] DepthPartitionNode problems

2008-11-09 Thread Pasquale Tricarico
Hi,

I'm using the DepthPartitionNode code from the osgdepthpartition
example, OSG v2.6, to display complex scenes composed by many planets
and their relative orbits, that here for simplicity you can consider
as circles centered on the Sun. DPN does not seem to play well with
orbits. To reproduce the problem, I've attached a modified version of
osgdepthpartition.cpp that simply adds the Earth orbit to the original
scene. Just copy it on the original one and it should compile.

When you move the camera around, you will see that the orbit is not
displayed completely, especially the part on the opposite side of the
Sun. Also, arcs of the orbit seem to disappear and suddenly reappear
when moving slightly the camera, with no apparent reason. I would be
glad to hear if you can reproduce this issue, and help me find a way
around it.

Regards,
Pasquale
/* OpenSceneGraph example, osgdepthpartion.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the Software), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE 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
*  AUTHORS OR COPYRIGHT HOLDERS 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.
*/

#include osgUtil/UpdateVisitor

#include osgDB/ReadFile

#include osg/ShapeDrawable
#include osg/PositionAttitudeTransform

#include osgGA/TrackballManipulator

#include osgViewer/Viewer

#include DepthPartitionNode.h

const double r_earth = 6378.137;
const double r_sun = 695990.0;
const double AU = 149697900.0;

osg::Node* createScene()
{
// Create the Earth, in blue
osg::ShapeDrawable *earth_sd = new osg::ShapeDrawable;
osg::Sphere* earth_sphere = new osg::Sphere;
earth_sphere-setRadius(r_earth);
earth_sd-setShape(earth_sphere);
earth_sd-setColor(osg::Vec4(0, 0, 1.0, 1.0));

osg::Geode* earth = new osg::Geode;
earth-setName(earth);
earth-addDrawable(earth_sd);

// Create the Sun, in yellow
osg::ShapeDrawable *sun_sd = new osg::ShapeDrawable;
osg::Sphere* sun_sphere = new osg::Sphere;
sun_sphere-setRadius(r_sun);
sun_sd-setShape(sun_sphere);
sun_sd-setColor(osg::Vec4(1.0, 0.0, 0.0, 1.0));

osg::Geode* sun_geode = new osg::Geode;
sun_geode-setName(sun);
sun_geode-addDrawable(sun_sd);

// Move the sun behind the earth
osg::PositionAttitudeTransform *pat = new osg::PositionAttitudeTransform;
pat-setPosition(osg::Vec3d(0.0, AU, 0.0));

osg::Geometry * unitCircle = new osg::Geometry();
{
  osg::Vec4Array * colours = new osg::Vec4Array(1);
  (*colours)[0] = osg::Vec4d(1.0,1.0,1.0,1.0);
  unitCircle-setColorArray(colours);
  unitCircle-setColorBinding(osg::Geometry::BIND_OVERALL);
  const unsigned int n_points = 1024;
  osg::Vec3Array * coords = new osg::Vec3Array(n_points);
  const double dx = 6.28/n_points;
  double s,c;
  for (unsigned int j=0; jn_points; ++j) {
	sincos(dx*j,s,c);
	(*coords)[j].set(osg::Vec3d(c,s,0.0));
  }
  unitCircle-setVertexArray(coords);
  unitCircle-getOrCreateStateSet()-setMode(GL_LIGHTING,osg::StateAttribute::OFF);
  unitCircle-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINE_LOOP,0,n_points));
}

// Earth orbit
osg::Geode * earthOrbit = new osg::Geode;
earthOrbit-addDrawable(unitCircle);

osg::PositionAttitudeTransform * earthOrbitPAT = new osg::PositionAttitudeTransform;
earthOrbitPAT-setScale(osg::Vec3d(AU,AU,AU));
earthOrbitPAT-setPosition(osg::Vec3d(0.0, AU, 0.0));
earthOrbitPAT-addChild(earthOrbit);

osg::Group* scene = new osg::Group;
scene-addChild(earth);
scene-addChild(pat);
scene-addChild(earthOrbitPAT);
pat-addChild(sun_geode);

return scene;
}

int main( int argc, char **argv )
{

// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(argc,argv);

// construct the viewer.
osgViewer::Viewer viewer;

bool needToSetHomePosition = false;

// read the scene from the list of file specified commandline args.
osg::ref_ptrosg::Node scene = osgDB::readNodeFiles(arguments);

// if one hasn't been loaded create an earth and sun test model.
if (!scene) 
{
scene = createScene(); 
needToSetHomePosition = true;
}

// Create a 

Re: [osg-users] osgCairo and osgPango on Windows : some progress

2008-11-09 Thread Jean-Sébastien Guay

Hi Robert,


Getting
this libs working under a Linux distribution will be trivial as most
modern distributions will have them all precompiled with dev headers
in the repositories only a click away, for Windows and OSX we'll have
to explore how easy it is to build.  J-S's work on getting osgPango
and osgCairo compiling all good prep for this ;-)


Thanks, always glad to help open up new paths. :-)

Just for reference, gtk provides a binaries bundle for Win32 which 
includes everything needed, even pkg-config, prebuilt. I would not 
really have liked to have to build all the libs needed myself, so I was 
glad they provided this, even if it does include some unneeded libs as 
extra baggage...


I'm working on packing up my changes for osgCairo and osgPango now. Will 
send soon.


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] controlling swap

2008-11-09 Thread Ed
After reading osgViewer::Viewer vs osgViewer::CompositeViewer, I think 
I might need to use CompositeViewer at some point in the future of my 
project, but not at the outset.  Should I begin with the 
CompositeViewer, or make the necessary mods later?  How difficult is it 
to change from Viewer to CompositeViewer later?


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


Re: [osg-users] controlling swap

2008-11-09 Thread Rahul Jain
Hi Ed,

I would also recommend  to use osgViewer::CompositeViewer from the
starting. The reason is that   osgViewer::Viewer can be mimicked  by 
osgViewer::CompositeViewer containing a single osgViewer::View

RJ

Jean-Sébastien Guay wrote:
 Hi Ed,

 After reading osgViewer::Viewer vs osgViewer::CompositeViewer, I
 think I might need to use CompositeViewer at some point in the future
 of my project, but not at the outset.  Should I begin with the
 CompositeViewer, or make the necessary mods later?  How difficult is
 it to change from Viewer to CompositeViewer later?

 If I remember correctly, at the end of that very thread it was
 mentioned that the switch is not hard at all.

 However, using CompositeViewer is not that much overhead over Viewer,
 so if you will need it for sure I would start out with CompositeViewer
 at the start, so that everything is already there and you don't have
 any surprises.

 Just my opinion, mind you.

 J-S

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


Re: [osg-users] VPB: Superimposed or switch different textures possible?

2008-11-09 Thread J.P. Delport

Hi,

maybe have a look at this:
http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/ExampleClusterJPD

you don't have to worry about the cluster stuff, just run vpbmaster 
without the --machines option.


jp

Alejandro Aguilar Sierra wrote:

Hi Robert:

I will build one but I need some guidance. There is not much
documentation about it.

-- A.

On Sun, Nov 9, 2008 at 4:38 AM, Robert Osfield [EMAIL PROTECTED] wrote:

On Sun, Nov 9, 2008 at 1:15 AM, Alejandro Aguilar Sierra
[EMAIL PROTECTED] wrote:

Hi Robert and Umit,

How should I run the osgmultitexturecontrol example?

You'll need to pass it a database with multiple texture in it.  We
don't have one provide in OpenSceneGraph-Data yet or one online.  I
wrote this example to test the combination of VPB built database with
mulitple layers and osgFX::MultiTextureControl feature.

I do plan on uploading a database with paged multiple layers to
openscenegraph.org, but this hasn't risen to the top of my todo list
yet.

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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] NodeKit integration in OpenSceneGraph-2.x series

2008-11-09 Thread Wang Rui
Hi Robert.

I wonder if there is a plan to add a modeling library to the core OSG in
future. Not because I'm working on a similar library 'osgModeling', but also
from the experiences of other 3D graphics APIs. Take VRS3D for example, it
has a number of common functionalitys which help build user customized
models from curves and parameters, like extrusions (VRS::Extrusion),
revolutions (VRS::Hyperboloid), torus and the most important, Bezier and
NURBS.

Of course, OSG focuses on how to improve the efficiency of rendering and
most models are generated from external libraries and software (like
3dsmax). But some times we may need build models from curve and point data
of end-users. It is a trouble if these data should be converted by other
software and transferred back to OSG, especially on the network. Also a
modeling nodekit is a good place for some of existing classes to live in,
like Delaunay, Simplifier and SmoothingVisitor, and a good start for future
developments. Maybe we could create and assemble models using a modeling
nodekit and control them with an animation nodekit in comming days.

I would like to help develop such nodekits and share my existing code if
others have better plans and actions. Also I would keep on developing
osgModeling as a external project if a modeling library is not needed at
present, and be glad to do any work to improve and popularize OSG. There are
thousands of OSG members in China (statistics from the osgchina forum) and
it will be a great power of the OSG community in any time.

Best wishes,
Wang Rui
2008/11/10 Robert Osfield [EMAIL PROTECTED]

 Hi All,

 There has been lots of discussion about various NodeKit or last month
 or two.  In OSG-2.6 we saw the introduction of osgWidget from the
 community, in OSG-2.8 we'll see the integration of new osgVolume
 library.  OSG-2.10 is likely to see the integration of osgAnimation,
 but if things converge quickly for this NodeKIt it might even make it
 into OSG-2.8.

 There are other NodeKits out into the community, some are up to date
 and well maintained others rather dormant or even orphaned.  Each of
 these NodeKit could be put forward for integration with the core OSG.
 Whether any of these should be integrated and if so how one goes about
 is something that is worthy of discussion. I don't think we need
 heavily structured metrics to measure NodeKits against, but some
 informal metrics might help provide some transparency in the process.
 Here's a couple to get started with:

 1) What overall feature set does the OpenSceneGraph need as it evolves
 to better meet the common needs of the community?

   All NodeKits needs to be take as a step towards this goal, this
 includes ones already in OpenSceneGraph trunk.

   But how to define the goals for the OpenSceneGraph for the 2.x and
 3.x series and beyond?

 2) All NodeKit to make into the core OpenSceneGraph need to be
 portable across all platforms. (Or might there be exceptions??)

 3) All NodeKit to make into the core OpenSceneGraph need to fit to the
 C++ design and coding style

 4) All NodeKit need to be activity used and supported by a range of
 members in the community.

 5) Granularity of NodeKits need to fit the function as well as the
 breadth/complexity of functionality encompassed.

 6) Where functionality of two NodeKits overlap then for integration to
 occur the NodeKit need to be merged in some fashion,
this might be that osgOriginal and osgNew get merged into
 osgOriginal, or even into a osgBetterNameForCombination.

Migration to new merged classes/NodeKits would require a system
 for helping existing users migrate / provide deprecated functionality
for a defined period.

 7) Naming of NodeKits should be descriptive of it's function, prefer
 long descriptive name over short acronyms.

 8) NodeKits should have ascii read/write support, but ideally binary
 support too (we really need an extensible binary format).

 9) NodeKits must be wrap-able via osgIntrospection/genwrapper.

 10) NodeKit should facilitate collaboration and quell fragmentation of
 code and developer resources.

 11) NodeKit should be of solid design and implementation quality.

 12) NodeKit and dependency proliferation should be deemed a negative
 quality - a NodeKit must add real value to compensate for the
 extra complexity it introduces.

 OK, feel free to add more/refine the above.  Once this discussion
 reaches some kind of conclusion I'll put up a page on the WIKI
 summarising it all.

 Putting the above metric against the core OSG NodeKits we see a couple
 of libs that perhaps could be renamed/refactored.  osgSim and osgGA
 aren't descriptive names at all.  osgDB is not much better, put
 probably not quite so bad and it's not a NodeKit so exempt from all
 common sense :-)

 osgGA is very old and clunky which could do with a revamp, such as
 revamp might be a good time to merge the functionality it provides
 into other NodeKits.  Perhaps some functionality going into 

Re: [osg-users] Many RTT cameras, strange out of memory errors on Linux

2008-11-09 Thread J.P. Delport

Hi all,

if anyone has some spare time, please execute the attached test app 
under Linux. I am still unsure if our problems are related to NVidia 
driver, Linux distribution, ...


thanks
jp

J.P. Delport wrote:

Hi all,

a colleague of mine is trying to implement an image processing algorithm 
that requires many RTT cameras (+-150).


His algorithm runs on his Windows machine, but fails under Linux (I'm 
quite sad about it :) with some of the following errors:


--8--

Got an X11ErrorHandling call display=0x80a8c80 event=0xbf991100
BadAlloc (insufficient resources for operation)

Got an X11ErrorHandling call display=0x80a8c80 event=0xbf991160
BadDrawable (invalid Pixmap or Window parameter)

Warning: detected OpenGL error 'out of memory' after RenderBin::draw(,)
RenderStage::drawInner(,) FBO status= 0x8cd5

--8--

We've narrowed the problem down to just camera creation and frame 
rendering. Texture sizes do not seem to influence the error. I've made a 
small test application (attached) that creates the errors.


On my Linux laptop the errors start appearing at around 220 cameras. On 
another Linux machine we can get about 10 more. On Windows we've been 
able to test up to 3000 (the apps starts up too slowly if we add more).


Does anyone have any ideas about why and where the cameras are creating 
X resources?


Art (if you are around), does osgPPU use osg::Camera? Maybe we can move 
to osgPPU if not.


Any pointers to help us debug are welcome.

regards
jp





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] NodeKit integration in OpenSceneGraph-2.x series

2008-11-09 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Robert,

Robert Osfield wrote:

 Animation is something that is under-way in the form of osgAnimation,
 which started life as AnimTK and has evolved rapidly to tick many more
 of the above items, so it looks to be rapidly becoming a good
 candidate for inclusion.

Just a parenthesis - I gave quite a bit of feedback to Cedric about
this. I think that there are some design issues that need to be
addressed first, before it even reaches basic feature parity with
existing code in osgCal or Replicant when concerning basic animation
support (not the more advanced stuff in Replicant).

 Physics is an integration issue as we'll never attempt to do wholesale
 physics ourselves, I haven't reviewed any strong candidates for this
 role yet.

I wouldn't try to integrate physics as such - that is a monstrous job
and you would be tied to one engine that doesn't fit everyone (which
one? ODE? Bullet? Havoc? ...)

I would rather make things easy to integrate by the end users (e.g. an
easy way to get bounding boxes and meshes from  the nodes at runtime for
collision detection) and perhaps include a collision detection support
in the core scenegraph. This has been a persistent question over the
years and a good integration of collision detection needs support from
the scenegraph.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJFzQMn11XseNj94gRAkOqAKCR4c3hilM7YZg+3sKYneEQfUpAEACghzK5
iQp3QmTvjMbFanG8TypXsg4=
=ZgZE
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] A patch to enable making hardware extensions disabled in Texture.cpp

2008-11-09 Thread Tatsuhiro Nishioka
Hi there,

I received some crash reports on FlightGear/OSG from a user who uses nVidia 
7300GT on Macs.
Debugging on an iMac gave me that hardware mipmapping on its driver caused the 
crash.
so I once made a fix-it-only-for-this-issue kinda patch that simply disable 
hardware mipmapping when
the renderer is NVIDIA GeForce 7300GT OpenGL Engine,  and that actually fixed 
the problem.
(see http://www.mail-archive.com/[EMAIL PROTECTED]/msg18674.html
for more detail on this problem and the patch.)

However, I'm wondering if users can disable hardware extensions to avoid such 
problems.
I tried 
OSG_GL_EXTENSION_DISABLE=GL_SGIS_generate_mipmap;GL_EXT_framebuffer_object 
but nothing happened.
Taking a look at Texture.cpp tells me you can never disable hardware extensions 
if your OpenGL driver version = 1.4 (or 2.0) 
It calls isGLExtensionSupported to check if an extension is supported but these 
will never called.
For example, the following code is for checking hardware mipmapping extension:

_isGenerateMipMapSupported = (strncmp((const 
char*)glGetString(GL_VERSION),1.4,3)=0) ||
   
isGLExtensionSupported(contextID,GL_SGIS_generate_mipmap);

This means that isGLExtensionSupported will never be called when GL_VERSION = 
1.4, resulting that you cannot disable it
since environment variable is evaluated in isGLExtensionSupported.

Attached is the patch to make hardware extensions disabled using the 
environment variable.
I'm not so sure on the real purpose of the OR logic in the if statement above, 
but it is good to give users a choice.
Can anyone test this and check if this is a right solution?

Best,

Tat


Texture_disable_extensions.diff
Description: Binary data



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