Re: [osg-users] CameraPreDrawCallback

2008-01-16 Thread Robert Osfield
On Jan 16, 2008 1:16 AM, Charles Han [EMAIL PROTECTED] wrote:
 What i have done so far is to create a myCameraPreDrawCallback which extends
 from Drawcallback. In this class i override the operator to create a
 GLObjectsVisitor. Also, when the callback is constructed i keep a reference
 to the sub graph and then in the call back operator i let the sub graph
 accepts the visitor.

 I am not sure this is a right approach but i am puzzled with one thing is
 how do you know the sub graph is complied and how to remove the call back?

You shouldn't need a reference to the subgraph, as the
DrawCallback::operator(..) takes the Camera that it's assigned to, and
the Camera contains the scene graph, and the Camera being just a Node.
 In fact it takes less words in code...


struct CompileCallback : public osg::Camera::DrawCallback
{
virtual void operator() (const osg::Camera camera)
{
 osgUtil::GLObjectVisitor gov;
 const_castosg::Camera(camera).accept(gov);
}
};


 Also, where should i get the camera from? is this just a camera i create or
 i should get from the viewer?

viewer.getCamera()-setDrawCallback(new CompileCallback);
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VPB in SVN

2008-01-16 Thread Robert Osfield
Hi J-S,

On Jan 16, 2008 12:11 AM, Jean-Sebastien Guay
[EMAIL PROTECTED] wrote:
  Yes, the gaps between tiles of different levels is usual right now.
  The --terrain feature is very new to VPB, its not yet productive ready
  so one would expect little items to not work 100%.  It'll be working
  fully pretty soon though ;-)

 It's not just different levels though - all tiles seem to have black borders.
 Even when I'm zoomed all the way in and all tiles are at the highest LOD, 
 there
 are still those black lines.

O.K. this isn't the lack of skirts then.

 And I totally understand about --terrain. Without knowing the details, I'd say
 that faster generation is always welcome! I'm just giving feedback to make 
 sure
 it's not something in my setup or something platform-specific.

Feedback is useful, especially when it uncovers problems that I not
able to reproduce myself which does seem to be the case here.

A black line around the border suggests either a source texture,
texture coordinate issue or normal generation issue.  The later two
possibilities would be related to the core OSG, the first would be an
osgdem issue.  Could you package up you model again and make it
available for download so I can at least discount/confirm the source
texture as being at fault.

Robert.

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


Re: [osg-users] VPB in SVN

2008-01-16 Thread Jean-Christophe Lombardo
Hi,

I have exactly the same black tile border problem on windows side with 
my own data set.
On linux side it seems ok.

jcl




 
 

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals  computer 
viruses.




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


[osg-users] Some Code

2008-01-16 Thread GuiYe
 
 
 
  Hello~~
 
  I once wrote some in OpenSceneGraph1.2.Now I use OpenSceneGraph2.2,I want to 
rewrite it.But I can't find some functions to replace some code:
 
   osgProducer::Viewer::SceneHandlerList::iterator sh_it = 
viewer.getSceneHandlerList().begin();
   osgProducer::OsgSceneHandler* sh =sh_it-get();
 
 
Who can give me some code to replace all above code in OpenSceneGraph2.2??
 
Thank you~~
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Some Code

2008-01-16 Thread Robert Osfield
Hi GuiYei,

The osgViewer doesn't have an OsgSceneHandler and their isn't an equivalent.

Perhaps you could provide a bit of information about what you were
doing with the OsgSceneHandler then we might be able to suggest how to
replace this code.

Robert.


2008/1/16 GuiYe [EMAIL PROTECTED]:



   Hello~~

   I once wrote some in OpenSceneGraph1.2.Now I use OpenSceneGraph2.2,I want
 to rewrite it.But I can't find some functions to replace some code:

osgProducer::Viewer::SceneHandlerList::iterator sh_it =
 viewer.getSceneHandlerList().begin();
osgProducer::OsgSceneHandler* sh =sh_it-get();


 Who can give me some code to replace all above code in
 OpenSceneGraph2.2??

 Thank you~~


  

  又过年了,千万别忘了把你的爱带回家
 为爱珍选,唯有金典
 ___
 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] Loading data into the osg database

2008-01-16 Thread Felix Bwire
What I mean is that I have a network dataset. I believe it first has to be
stored in the osg database before it can be dispalyed in osg. Or is there
any other way I can be able to load this into osg. The main aim is that I
want to be able to display this dataset in osg and make use of the
functionality offered by osg in viewing it.

On Jan 15, 2008 6:38 PM, Robert Osfield [EMAIL PROTECTED] wrote:

 On Jan 15, 2008 3:24 PM, Felix Bwire [EMAIL PROTECTED] wrote:
  Hi guys,
 
  Can some one help me with the procedure of how I can load data into the
 osg
  database and be able to query it.

 Could you someone help you by being much more specific what you mean
 by load data into the osg database and be able to query it as
 there are just so many thousands of ways one can interpret this.

 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] Loading data into the osg database

2008-01-16 Thread Robert Osfield
On Jan 16, 2008 10:10 AM, Felix Bwire [EMAIL PROTECTED] wrote:
 What I mean is that I have a network dataset.

What do you mean by a network dataset?

Local network?  Internet?

Imagery?  Terrain?  3D models?  What formats

I believe it first has to be
 stored in the osg database before it can be dispalyed in osg.

The OSG has a net plugin for reading files over http, your can load
various formats, but the most efficient would the native .ive binary
format.

 Or is there
 any other way I can be able to load this into osg. The main aim is that I
 want to be able to display this dataset in osg and make use of the
 functionality offered by osg in viewing it.

Almost all the OSG examples load data, its a single line of code :
osgDB::readNodeFIle(filename), constructing a viewer is just a couple
of lines of code as well.  Its all in the examples.

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


Re: [osg-users] Loading data into the osg database

2008-01-16 Thread Felix Bwire
I mean a biological network dataset, or it could be an internet dataset. It
is in 3D. So far the one I have data which is in .gdf format.

On Jan 16, 2008 1:23 PM, Robert Osfield [EMAIL PROTECTED] wrote:

 On Jan 16, 2008 10:10 AM, Felix Bwire [EMAIL PROTECTED] wrote:
  What I mean is that I have a network dataset.

 What do you mean by a network dataset?

 Local network?  Internet?

 Imagery?  Terrain?  3D models?  What formats

 I believe it first has to be
  stored in the osg database before it can be dispalyed in osg.

 The OSG has a net plugin for reading files over http, your can load
 various formats, but the most efficient would the native .ive binary
 format.

  Or is there
  any other way I can be able to load this into osg. The main aim is that
 I
  want to be able to display this dataset in osg and make use of the
  functionality offered by osg in viewing it.

 Almost all the OSG examples load data, its a single line of code :
 osgDB::readNodeFIle(filename), constructing a viewer is just a couple
 of lines of code as well.  Its all in the examples.

 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] Loading data into the osg database

2008-01-16 Thread Robert Osfield
On Jan 16, 2008 11:38 AM, Felix Bwire [EMAIL PROTECTED] wrote:
 I mean a biological network dataset,  or it could be an internet dataset.

  What do you mean by a biological network dataset, or even an
internet dataset???

Could you please start trying to be precise on what on earth your are
trying to do, people can't climb inside your head and know what you
are trying to do, and we should haven't try a claw it out.  If you
want people to help you then you need to help them understand what you
are trying to do.

 It
 is in 3D. So far the one I have data which is in .gdf format.

Ahhh at least something, a small nugget of what you might be trying to
do.   I'm afraid .gdf isn't one of the formats supported by the OSG.
Perhaps members of the OSG community have coded up solutions to.

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


Re: [osg-users] osgconv batch processing

2008-01-16 Thread J.P. Delport
Hi,

you could prob use some python scripts. Thy work nicely cross-platform too.

Here's a teaser, google for some of the modules/functions.

cheers
jp

#!/usr/bin/env python

import glob, os, sys

file_pattern = '*.3ds'
search_pattern = '.oldname.'
replace_pattern = '.newname.'

if __name__ == __main__:
 # get all files
 names = glob.glob(file_pattern)
 for n in names:
 newn = n.replace(search_pattern, replace_pattern)
 if newn != n:
 cmd = mv  + n +   + newn
 print cmd
 ret = os.popen(cmd).read()
 print ret

Paul Pocock wrote:
 I have a number of objects I would like to convert to .ive and was
 wondering if there is a way to do batch processing with osgconv?
 
 
 IMPORTANT: This email remains the property of the Australian Defence 
 Organisation and is subject to the jurisdiction of section 70 of the CRIMES 
 ACT 1914.  If you have received this email in error, you are requested to 
 contact the sender and delete the email.
 
 
 ___
 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] Adding shadow to an existing scenegraph

2008-01-16 Thread Wojciech Lewandowski
For tests, you may derive your ShadowMap from osgShadow::ShadowMap, override
init and cull methods. In this way you will be able to check if init was
called. Of course I have not tested it but the code should look more or less
like this:

#include cassert

class MyShadowMap: public osgShadow::ShadowMap {
public :
/** initialize the ShadowedScene and local cached data structures.*/
virtual void init()
{
assert( getShadowedScene() ); // ShadowMap::init does nothing 
if this not
set

osgShadow::ShadowMap::init();

// now check if all vital resources were created
assert( osgShadow::ShadowMap::_stateset );
assert( osgShadow::ShadowMap::_camera );
assert( osgShadow::ShadowMap::_texture );
}

/** run the cull traversal of the ShadowedScene and set up the
rendering for this ShadowTechnique.*/
virtual void cull( osgUtil::CullVisitor cv )
{
// check if all vital resources were created by init
assert( osgShadow::ShadowMap::_stateset );
assert( osgShadow::ShadowMap::_camera );
assert( osgShadow::ShadowMap::_texture );

osgShadow::ShadowMap::cull( cv );
}
};


You may additionally call ShadowedScene-dirty() method. But I doubt it
helps, dirty flag is set anyway on creation, its generally used for
refreshing shadow params. What type of viewer uses your App ? J-S Guay
recently observed some issues with initialization of Shaders in ShadowMap
with CompositeViewer. Maybe this is related somehow.

Cheers,
Wojtek

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of DKa
Sent: Wednesday, January 16, 2008 11:17 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Adding shadow to an existing scenegraph


 If crash happens,  its probably in some function on
 Stack called as result
 of from ShadowMap::cull. I bet getDataVariance is
 called with stateset being
 NULL ? Right ?

Hi, sorry for the late feedback on your new
suggestions. I pretty much do it like in your code
(sm-init after attaching the shadow technique). Still
you're right that the stateset being null is the
problem and this is still not solved.

Something must go wrong in the initialization. I am
building against the library so I cannot put a
breakpoint into the OSG-Code for the init function.

Previously I did not set the texture size for the
shadow map. But it seems this is the only difference
to the stuff you do in order to initialize and set
everything for the shadow.

Cheers,
D.


  __
__
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

___
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] Some Code

2008-01-16 Thread GuiYe
 
 
 
  Hello,robert!
  I want to use the code:
 
osgProducer::Viewer::SceneHandlerList::iterator sh_it =
 viewer.getSceneHandlerList().begin();
osgProducer::OsgSceneHandler* sh =sh_it-get();

 
to  load the nodes from the commandline arguments.
 
  What should I do ?
  
  Thank you~~~
 

 
Hi GuiYei,

The osgViewer doesn't have an OsgSceneHandler and their isn't an equivalent.

Perhaps you could provide a bit of information about what you were
doing with the OsgSceneHandler then we might be able to suggest how to
replace this code.

Robert.


2008/1/16 GuiYe [EMAIL PROTECTED]:



   Hello~~

   I once wrote some in OpenSceneGraph1.2.Now I use OpenSceneGraph2.2,I want
 to rewrite it.But I can't find some functions to replace some code:

osgProducer::Viewer::SceneHandlerList::iterator sh_it =
 viewer.getSceneHandlerList().begin();
osgProducer::OsgSceneHandler* sh =sh_it-get();


 Who can give me some code to replace all above code in
 OpenSceneGraph2.2??

 Thank you~~


  

  又过年了,千万别忘了把你的爱带回家
 为爱珍选,唯有金典
 ___
 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] Some Code

2008-01-16 Thread Robert Osfield
2008/1/16 GuiYe [EMAIL PROTECTED]:



   Hello,robert!
   I want to use the code:


 osgProducer::Viewer::SceneHandlerList::iterator sh_it =
  viewer.getSceneHandlerList().begin();
 osgProducer::OsgSceneHandler* sh =sh_it-get();


 to  load the nodes from the commandline arguments.

   What should I do ?

To assign a loaded file :

  viewer.setSceneData(osgDB::readNodeFile(cow.osg));

To assign files loaded from command line

  osg::ArgumentParser arguments(argc,argv)
  viewer.setSceneData(osgDB::readNodeFile(arguments));

All of this is exactly the same as in 1.2 osgProducer::Viewer, and
exactly how almost all the OSG examples do things.  None have anything
whatsoever to do with OsgSceneHandler which makes me perplexed about
exactly what you were trying to do.

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


Re: [osg-users] osgText Blending

2008-01-16 Thread Lucas Goss
 Did anyone have any ideas on this? Is there any additional information I
 can provide that may be helpful?

  Hello all! Working on creating a fancy osgHUD::Label example, and I had
  a question about using alpha blending with osgText::Text.

Is the code anywhere I can look at? Is this in svn? Wish someone else
had an idea as I'm still learning OSG, but I'll fiddle around with it
if you can post the code or put it in svn.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] openscenegraph.org's Chinese mirror will be run after the new year.

2008-01-16 Thread FreeSouth
 
Hello all:
 
  Openscenegraph.org's Chinese mirror will be run after the new year.
 
  It will include most of  the official www.openscenegraph.org's content , some 
articles in Chinese,  tutorials notes in Chinese.
 
  Mutiple language mirror maybe needed in many countys as openscenegraph more 
and more popular in the world.
 
Yang ShiXing
 
 
 ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgHUD compilation on Windows

2008-01-16 Thread Jean-Sebastien Guay
Hello Jeremy,

  Is there any way you could send me the output of svn diff so I can see
  what was necessary?

 Sure, I'll do that when I get back to my desk tomorrow morning.

Here it is. I haven't yet started working on the std::bad_alloc I'm getting,
will get back to you on that later.

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

osgHUD.diff
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] VPB in SVN

2008-01-16 Thread Robert Osfield
On Jan 16, 2008 1:12 PM, Jean-Christophe Lombardo
[EMAIL PROTECTED] wrote:
 Just to go a little further on this black contour problem:
 I've transfered my scene generated on linux side to windows, and the
 black contour appears...

 Is there any difference in the default texture parameters between linux
 and windows ?

Shouldn't be an difference.  Perhaps its the OpenGL drivers show small
variations of interpretation of the same settings.

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


Re: [osg-users] openscenegraph.org's Chinese mirror will be run after the new year.

2008-01-16 Thread Robert Osfield
Hi Yang ShiXing et al,

For everyone else's benefit, Yang and myself have been exchanging
emails over the past few days of his and he's colleague  plans to
create a Chinese language mirror of the openscenegraph.org website.
I'm supportive of this effort, and requested we start up a discussion
here in osg-users to keep the community informed and to see if the
community has any wisdom on practicalities of multi-language support
and how one might make it easier to maintain these varients of the
base English language website.

2008/1/16 FreeSouth [EMAIL PROTECTED]:

 Hello all:

   Openscenegraph.org's Chinese mirror will be run after the new year.

Just for clarification, this is the Chinese new year, which I believe
will be on the 7th February this year.

   It will include most of  the official www.openscenegraph.org's content ,
 some articles in Chinese,  tutorials notes in Chinese.

Do you have a domain assigned for the Chinese website yet?  If so what
is it?  What website technologies do you plan to use?

   Mutiple language mirror maybe needed in many countys as openscenegraph
 more and more popular in the world.

What languages would you like to see?  Keep in mind you might well be
required to help this effort... :-)

I am also curious about the practicalities.  Does Tracs help us here?
Do you know of any other Tracs websites that support multiple
languages?   Would the RSS feed support on the Tracs website help out?

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


[osg-users] Performance Problem

2008-01-16 Thread Jin WZ
Hi,

I have written a viewer on Window XP using MFC based on osviewerMFC example 
code.  I add eighteen IVE-format models(about 1.15GB on harddisk) as children 
node to the scene's root group node, then, the rendering process gives a sharp 
slowdown and the FPS decrease to less than 1.0 . Could anyone give me some help 
on how to enhance the rendering performance?

I am using OSG 2.0. The code I used to add a IVE-format model to scene is:

..
 // Load the model from the model name
osg::ref_ptrosg::Node m_pNewModel;
 m_pNewModel = osgDB::readNodeFile(strModel.GetString());//strModel is 
CString variable contains the model's full path.
 if (m_pNewModel.get())
 {
  osgUtil::Optimizer optimizer;
  optimizer.optimize(m_pNewModel.get());
  optimizer.reset();

  // Add the model to the scene
  mRoot-addChild(m_pNewModel.get());
//mRoot is the scene's root node defined as osg::ref_ptrosg::Group 
 }
..
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Performance Problem

2008-01-16 Thread Adrian Egli
Hi Jin,

quit hard to say what exactly going wrong or not. you just mention the size
of the database, but nothing about the structure of it. 1.15GB is a huge
database if you have to hold the hole in your local memory. the ive is more
or less a memory dump, when you like to open a file it gets hole loaded or
nothing. so i guess your application consume a lot of memory. may the GPU is
the bottle neck (nbr of primitives, triangles,...) or just the CPU or
memory. so what kind of data are you working on? paged? LOD? ...

/adegli

2008/1/16, Jin WZ [EMAIL PROTECTED]:

 Hi,

 I have written a viewer on Window XP using MFC based on osviewerMFC
 example code.  I add eighteen IVE-format models(about 1.15GB on harddisk)
 as children node to the scene's root group node, then, the rendering process
 gives a sharp slowdown and the FPS decrease to less than 1.0 . Could
 anyone give me some help on how to enhance the rendering performance?

 I am using OSG 2.0. The code I used to add a IVE-format model to scene is:

 ..
 // Load the model from the model name
 osg::ref_ptrosg::Node m_pNewModel;
 m_pNewModel = osgDB::readNodeFile(strModel.GetString());//strModel
 is CString variable contains the model's full path.
 if (m_pNewModel.get())
 {
   osgUtil::Optimizer optimizer;
   optimizer.optimize(m_pNewModel.get());
   optimizer.reset();

   // Add the model to the scene
   mRoot-addChild(m_pNewModel.get());
 //mRoot
 is the scene's root node defined as osg::ref_ptrosg::Group
 }
 ..
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 

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


Re: [osg-users] openscenegraph.org's Chinese mirror will be run after the new year.

2008-01-16 Thread Adrian Egli
Hi all,

greate to get a world wide community, but there's also a danger if you have
a english, chinese,... website. the best is to share all the documents,
informations globally and not in a local language. unfortunattely it's
allways english, but it's life. i would prefer swiss german  :-) . no, don't
joke: of course it's a challenge, chance and a danger to hold the community
uptodate. but if the site is just a mirror of the english (main page) no
problem. otherwise my we need some translators, i can't understand any
chinese words. :-(

regards

2008/1/16, Robert Osfield [EMAIL PROTECTED]:

 Hi Yang ShiXing et al,

 For everyone else's benefit, Yang and myself have been exchanging
 emails over the past few days of his and he's colleague  plans to
 create a Chinese language mirror of the openscenegraph.org website.
 I'm supportive of this effort, and requested we start up a discussion
 here in osg-users to keep the community informed and to see if the
 community has any wisdom on practicalities of multi-language support
 and how one might make it easier to maintain these varients of the
 base English language website.

 2008/1/16 FreeSouth [EMAIL PROTECTED]:
 
  Hello all:
 
Openscenegraph.org's Chinese mirror will be run after the new year.

 Just for clarification, this is the Chinese new year, which I believe
 will be on the 7th February this year.

It will include most of  the official www.openscenegraph.org's content
 ,
  some articles in Chinese,  tutorials notes in Chinese.

 Do you have a domain assigned for the Chinese website yet?  If so what
 is it?  What website technologies do you plan to use?

Mutiple language mirror maybe needed in many countys as openscenegraph
  more and more popular in the world.

 What languages would you like to see?  Keep in mind you might well be
 required to help this effort... :-)

 I am also curious about the practicalities.  Does Tracs help us here?
 Do you know of any other Tracs websites that support multiple
 languages?   Would the RSS feed support on the Tracs website help out?

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




-- 

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


Re: [osg-users] openscenegraph.org's Chinese mirror will be run after the new year.

2008-01-16 Thread Robert Osfield
Hi Adrian,

On Jan 16, 2008 2:26 PM, Adrian Egli [EMAIL PROTECTED] wrote:
 greate to get a world wide community, but there's also a danger if you have
 a english, chinese,... website. the best is to share all the documents,
 informations globally and not in a local language. unfortunattely it's
 allways english, but it's life. i would prefer swiss german  :-) . no, don't
 joke: of course it's a challenge, chance and a danger to hold the community
 uptodate. but if the site is just a mirror of the english (main page) no
 problem. otherwise my we need some translators, i can't understand any
 chinese words. :-(

In the case of Chinese they have two issues to contend with the first,
is a bit of show stopper - openscenegraph.org is often blocked so
there is no access to any website, the second is obviously the
language barrier.

Other countries will probably have less problem with access to
openscenegraph.org, here the language barrier is the hurdle to cross.

I am curious about any web technologies that can help both of these
problems - physically mirroring and multi-language support.  Tracs is
obviously on constraint, but possible also an asset.

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


Re: [osg-users] OpenSceneGraph-2.3.2 dev release tagged.

2008-01-16 Thread Andy Skinner
This was all on our end.  I still had a previous SVN version in the
place I should have had our checked-in version, and it confused the
integration.  I'm all set now.

I was pleased to not have to make any changes for Solaris.

thanks,
andy

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Tuesday, January 15, 2008 9:43 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OpenSceneGraph-2.3.2 dev release tagged.

On Jan 15, 2008 2:37 PM, Andy Skinner [EMAIL PROTECTED]
wrote:
 I wonder whether something got merged incorrectly (we've store what we
 get from OSG in Perforce, then update it with changes when we update).

Could you investigate this and let us know if you've sorted the
problem out, so at least I know that there isn't a remaining issue on
the OSG side.

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


Re: [osg-users] osgText Blending

2008-01-16 Thread Jeremy Moles
It's the osghudlabel example currently in osgHUD.

http://osghud.googlecode.com

I'm putting in some changes now from Jean-Sebastian Guay that make it
compile a bit cleaner on Windows. I believe you're using Windows if I'm
not mistaken, so these changes to osgHUD will certainly help 'ya
there. :)

On Wed, 2008-01-16 at 08:33 -0500, Lucas Goss wrote:
  Did anyone have any ideas on this? Is there any additional information I
  can provide that may be helpful?
 
   Hello all! Working on creating a fancy osgHUD::Label example, and I had
   a question about using alpha blending with osgText::Text.
 
 Is the code anywhere I can look at? Is this in svn? Wish someone else
 had an idea as I'm still learning OSG, but I'll fiddle around with it
 if you can post the code or put it in svn.
 ___
 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 in SVN

2008-01-16 Thread Jean-Sebastien Guay
Hello Robert,

 I've been comparing the texture setup up code in both VPB and
 osgTerrain and found that VPB uses CLAMP_TO_EDGE while
 osgTerrain::GeometryTechnique itself just used defaults.  I've changed
 osgTerrain::GeometryTechnqiue to use CLAMP_TO_EDGE, testing under
 linux doesn't show any difference, but there is a chance that it might
 change things under Windows.  The change is now checked in.

Just updated OSG from SVN to get the changes to osgTerrain::GeometryTechnique,
recompiled, and regenerated the terrain, and it's fixed. No more black lines.
Thanks Robert.

I don't think there are any other issues right now, unless you want me to
download some other data set and do some tests on it... The next step seems to
be documenting and testing the distributed database generation.

Thanks for your help,

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


Re: [osg-users] osgHUD compilation on Windows

2008-01-16 Thread Jeremy Moles
Okay, changes are all merged! Thanks a ton! There's really nothing more
rewarding to a fledgling developer than having proof that other people
are looking at your code. :)

On Wed, 2008-01-16 at 08:44 -0500, Jean-Sebastien Guay wrote:
 Hello Jeremy,
 
   Is there any way you could send me the output of svn diff so I can see
   what was necessary?
 
  Sure, I'll do that when I get back to my desk tomorrow morning.
 
 Here it is. I haven't yet started working on the std::bad_alloc I'm getting,
 will get back to you on that later.

I run all the examples in valgrind pretty religiously and if I ever see
anything weird I'll usually fix it right away. So far there aren't any
warnings or anything in osgHUD itself, although the NVidia driver has a
few issues as do some of the xlibs Fedora provides.

At any rate, a few years or so back, I started learning graphics/game
programming with DirectX, thinking it was the only viable API for the
job (foolish!). I remember having issues back then relating to something
with the use of STL in a DLL--perhaps this is related to that? It's also
possible that I'm not using some necessary CMake magic, so the library
isn't being compiled correctly...

 J-S
 --
 __
 Jean-Sebastien Guay [EMAIL PROTECTED]
 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgHUD compilation on Windows

2008-01-16 Thread Jeremy Moles

On Wed, 2008-01-16 at 09:05 -0500, Jean-Sebastien Guay wrote:
 Hi again,
 
   OpenSceneGraph HUD Library 0.1.4 (pre-alpha)
 
  OK, I'll check that out tomorrow.
 
 This seems to be caused by the stringstream not holding on to the result of 
 its
 str() method. The version was fine in osgHUDGetVersion(), but once it 
 returned,
 the memory was a jumble of illegible characters. I solved it by making a 
 static
 std::string (instead of a static std::stringstream) and returning that. I also
 added code so the version string is generated only once, like in OSG, but if
 you had good reasons to not do that, it's not significant anyways (for a
 function that will likely only be called once in the life of a program).
 
 It now prints the same thing for me as it does for you. Diff attached.
 
 Still trying to figure out what's happening for the other problem. BTW, what
 about the images? I asked if it was possible for you to make them available 
 (as
 an osgHUD-Data package or a directory in your SVN or whatever)...

Once I get serious textured examples I'll certainly put them in SVN.
Right now they're just randome images off my machine, and it would be
safe to replace them with anything out of the osgdata SVN project
itself. In fact, I think I'll do that right now. :)

 J-S
 --
 __
 Jean-Sebastien Guay [EMAIL PROTECTED]
 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PBO and updating textures

2008-01-16 Thread Gerrick Bivins
Hi all,
I apologize in advance for the wordy post!

I've recently ventured down the path of learning about the use of PBO's in
GL. I've come to
the conclusion that we could probably use this functionality in some of our
texture-based pipelines.
Anyway, I've run into an issue when trying to use them with 3D textures and
I think it's just because
3D textures aren't used nearly as much as 2d textures in this community(at
least until recently!).
I think the problem we're facing is that currently,the PixelBufferObject
class only updates based on data set to an osg::Image.
However, for our 3D texture pipelines, we update our textures via a
subloadcallback. We eventually call
glTexSubImage3D to update the texture data with external data similar to
below:

*void cfdUpdateTextureCallback::subload( const osg::Texture3D texture,
osg::State state ) const
{
   if( !textureDataHolder )
   {
   return;
   }

   if( **textureDataHolder**-TimeToUpdateTextureData()  )
   {
   texture.getExtensions( state.getContextID(), false
)-glTexSubImage3D( GL_TEXTURE_3D,
   0,
   0, 0, 0,
   _textureWidth,
   _textureHeight,
   _textureDepth,
   GL_LUMINANCE_ALPHA,
   GL_UNSIGNED_BYTE,
   ( unsigned char* )**textureDataHolder**-GetTextureData()
);

   }
   }
}

*I looked at osg::Texture::applyTexImage2D_subload for an example of how to
use PBO's with textures and implemented this in
my subload callback but my data only displays the original image data.
Looking in the function for PixelBufferObject::compileBuffer,
I found that the buffer data is only updated on the data in the image that
the PBO is associated with.

So...how do I update the image data or the PBO? Ideally, I'd like to be
able to set the data to use for updating the PBO.
We were using the subload callback to manage the data in the texture but now
it seems like
somehow we'll have to manipulate the data in image but I don't see an
interface for that. Am I missing something or has this situation
not been addressed? I have some ideas on how to fix it but they all seem
like a hack so any input/advice there would be greatly appreciated.
biv
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgHUD compilation on Windows

2008-01-16 Thread Jean-Sebastien Guay
Hello Jeremy,

 Still trying to figure out what's happening for the other problem.

Problem figured out. It was once again an issue of linking release libs with a
debug executable (which is bad(tm) on Windows). I added in the modifications to
the CMake files to be able to compile with a 'd' suffix (both libs and
executables), and link to the libs with 'd' in them. You could choose to do it
conditionally on Windows only, but that's how OSG works as well.

Now, it compiles and most examples run well.

One issue I have is that I'm getting an assertion in
osgHUD::Window::_forEachAssignOrApply() which is only used in osghudframe and
osghudtable. It looks like the Windows C++ runtime doesn't like incrementing
past the last element. I'll add a check for that.

The other thing is that I don't know if the examples give the visual output you
expect. I'll try to make a screenshot of each example's initial state, at least
that will give us something to go on.

I'll wait until you've merged the other diffs I sent you before sending you
these CMake changes, so the diffs don't overlap.

Oh, and I (finally!) understood that the images you used for your examples came
from the OSG-Data package... Sorry about that.

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


Re: [osg-users] osgHUD compilation on Windows

2008-01-16 Thread Jean-Sebastien Guay
Hello Jeremy,

 Okay, changes are all merged!

Looks good, except for one thing: I mentioned that -DOSG_LIBRARY should only be
set for the lib, not for the examples (it's related to the
_declspec(dllimport)/_declspec(dllexport) stuff in OSG's include/osg/Export
header). So in the diff attached, I moved the WIN32 block back to the end of
the file, after the ADD_SUBDIRECTORY() lines.

Anyways, here is the next batch of changes, with that change added as well.

  I haven't yet started working on the std::bad_alloc I'm getting,
  will get back to you on that later.

 I run all the examples in valgrind pretty religiously and if I ever see
 anything weird I'll usually fix it right away.

Yeah, don't worry, I didn't think it was anything in your code - memory leaks
rarely have any visible effect, especially with 3GB of RAM! It was obviously
something related to DLLs and such, and as it turns out it was the usual
problem of linking a debug executable to release libs (and vice versa). The
necessary changes are attached.

I'll fix the iterator issue and then make some screenshots next.

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

osgHUD2.diff
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] osgHUD compilation on Windows

2008-01-16 Thread Jean-Sebastien Guay
Hello Jeremy,

 I'll fix the iterator issue and then make some screenshots next.

Ok, fixed. It's a bit sad that I have to use the indices instead of iterators,
but in MS's C++ runtime, an assert is generated whenever you try to increment
an iterator past the end of the vector.

_Myt operator+=(difference_type _Off)
{// increment by integer
_SCL_SECURE_VALIDATE(this-_Mycont != NULL);
_SCL_SECURE_VALIDATE_RANGE(
_Myptr + _Off = ((_Myvec *)(this-_Mycont))-_Mylast 
_Myptr + _Off = ((_Myvec *)(this-_Mycont))-_Myfirst);
_Myptr += _Off;
return (*this);
}

I can't even change the check to
for(ConstIterator i = _objects.begin() + begin; (i + add)  e; i += add) {
because operator+ uses operator+= ! So I'll run into the same assert.

_Myt operator+(difference_type _Off) const
{// return this + integer
_Myt _Tmp = *this;
return (_Tmp += _Off);
}

So I'm really stuck and need to use the index:
for(unsigned int i = begin; i  _objects.size(); i += add) {

That works. I had to make a similar change to Table.cpp. Diffs attached.

Now all the examples run on Windows. I'll take screenshots to make sure the
output is the same (should be, but I'm not sure).

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

Window.diff
Description: Binary data


Table.cpp.diff
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] Performance Problem

2008-01-16 Thread Brian
Hi Jin,
Also try running osgviewer.exe loading your model.  If you see a large
improvement in your FPS, it means you have something wrong with your MFC
code.

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


Re: [osg-users] Performance Problem

2008-01-16 Thread Jin WZ
Hi adegli,

Thanks for your reply.

My ive-format models are exported from 3dsmax with osgExp plugin.

Yes, I get the whole database loaded into memory. Actually, after loading the 
whole database, my harddisk works busily, I think maybe this is because my 
application use up all the memory. Then, how can I avoid this? 

As far as paged or LOD, I have not used them in my application because that I 
don't know how to use them. Is there any tools to get lower level of detail 
models from my original ive models?

Owing to my poor English, I wish I could descript my question clearly?


Regards.





- Original Message - 
  From: Adrian Egli 
  To: OpenSceneGraph Users 
  Sent: Wednesday, January 16, 2008 10:23 PM
  Subject: Re: [osg-users] Performance Problem


  Hi Jin, 

  quit hard to say what exactly going wrong or not. you just mention the size 
of the database, but nothing about the structure of it. 1.15GB is a huge 
database if you have to hold the hole in your local memory. the ive is more or 
less a memory dump, when you like to open a file it gets hole loaded or 
nothing. so i guess your application consume a lot of memory. may the GPU is 
the bottle neck (nbr of primitives, triangles,...) or just the CPU or memory. 
so what kind of data are you working on? paged? LOD? ... 

  /adegli 


  2008/1/16, Jin WZ [EMAIL PROTECTED]:
Hi,

I have written a viewer on Window XP using MFC based on osviewerMFC example 
code.  I add eighteen IVE-format models(about 1.15GB on harddisk) as children 
node to the scene's root group node, then, the rendering process gives a sharp 
slowdown and the FPS decrease to less than 1.0 . Could anyone give me some help 
on how to enhance the rendering performance?

I am using OSG 2.0. The code I used to add a IVE-format model to scene is:

..
// Load the model from the model name
osg::ref_ptrosg::Node m_pNewModel;
m_pNewModel = osgDB::readNodeFile(strModel.GetString());//strModel 
is CString variable contains the model's full path.
if (m_pNewModel.get())
{
  osgUtil::Optimizer optimizer; 
  optimizer.optimize(m_pNewModel.get());
  optimizer.reset();

  // Add the model to the scene
  mRoot-addChild(m_pNewModel.get());   
 //mRoot is the scene's root node defined as osg::ref_ptrosg::Group 
}
..
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




  -- 
  
  Adrian Egli 


--


  ___
  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] Some Code

2008-01-16 Thread GuiYe


 
 
  Hello,robert!
 
  I use the code to load the nodes from the commandline arguments. Just like 
these(a example of osgWater today I receive):
 
#include WaterPlane.h
#include osgDB/ReadFile
#include osgUtil/Optimizer
#include osgProducer/Viewer
#include osg/CoordinateSystemNode
#include osg/Group
#include osg/Node
#include osg/CameraNode
#include osg/Texture
#include osg/TexGenNode
#include osg/ShapeDrawable
#include osg/State
#include osg/StateSet
#include osg/Material
#include osgUtil/SceneView
#include osg/Texture2D
#include osg/CameraNode
#include osg/Shader
#include osg/Uniform
#include osg/Program

class Ocean : public osg::Drawable {
 public:
  Ocean(osgUtil::SceneView* );
  /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
  Ocean(const Ocean teapot,const osg::CopyOp 
copyop=osg::CopyOp::SHALLOW_COPY):
  osg::Drawable(teapot,copyop) {}
  META_Object(myOcean,Ocean)
  /** Compute the bounding box around Drawables's geometry.*/
  virtual osg::BoundingBox computeBound() const;
  /** Deprecated. */
  virtual void drawImplementation(osg::State) const;

  class OceanNodeUpdateCallback : public osg::NodeCallback {
   public:
OceanNodeUpdateCallback(Ocean* ocean){
 m_Ocean = ocean;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) {
 // first update subgraph to make sure objects are all moved into position
 traverse(node,nv);
 // update scene 
 osg::Vec3 eye,center,up;
 m_Ocean-m_SceneView-getCamera()-getViewMatrixAsLookAt(eye,center,up);
 m_Ocean-m_camObserving.position(eye, center);
 //aim the projecting camera
 m_Ocean-m_WaterPlane-aimProjector((m_Ocean-m_camProjecting), 
(m_Ocean-m_camObserving));
 m_Ocean-m_camProjecting.saveFrustum(m_Ocean-m_SceneView);
 m_Ocean-m_camObserving.position(eye, center);
 m_Ocean-m_camObserving.saveFrustum(m_Ocean-m_SceneView);
 double time = .1;
 //update and render water plane
 m_Ocean-m_WaterPlane-update(m_Ocean-m_SceneView,time, 
(m_Ocean-m_camProjecting), (m_Ocean-m_camObserving));
 //m_Ocean-dirtyBound();
 //osg::BoundingBox bb;
 //osg::Vec3d minBB,maxBB;
 //m_Ocean-m_WaterPlane-getBoundBox(minBB,maxBB);
 //bb.set(minBB,maxBB);
 //m_Ocean-setBound(bb);
}
   Ocean* m_Ocean;
  };
  

  void updateBoundingBox(osg::BoundingBox);
  WaterPlane* m_WaterPlane;
  Ocean() {};
  virtual ~Ocean() {
   delete m_WaterPlane;
  }
  osgUtil::SceneView* m_SceneView;
  Cameram_camProjecting;  //the extra camera used to project the water, 
based on m_camObserving but modified if necessary
  Cameram_camObserving;   //the camera in the scene
  osg::BoundingBox m_boundingBox;
  osg::CameraNode* createReflectionsMap(osg::Group* waterScene, osg::Node* 
reflectedScene, unsigned int textureID);
  osg::Texture2D* m_textureReflections;
  osg::CameraNode* m_cameraNodeReflections;
  osg::TexGenNode* m_texgenNodeReflections;
  osg::CameraNode* createRefractionsMap(osg::Group* waterScene, osg::Node* 
refractionsScene, unsigned int textureID);
  osg::Texture2D* m_textureRefractions;
  osg::CameraNode* m_cameraNodeRefractions;
  osg::TexGenNode* m_texgenNodeRefractions;
};
osg::CameraNode* Ocean::createReflectionsMap(osg::Group* waterScene, osg::Node* 
reflectedScene, unsigned int textureID){
 m_textureReflections = new osg::Texture2D;
 m_textureReflections-setTextureSize(1024, 1024);
 m_textureReflections-setInternalFormat(GL_RGBA);
 
m_textureReflections-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
 
m_textureReflections-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
 
m_textureReflections-setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);
 
m_textureReflections-setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);
 m_textureReflections-setBorderColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
 // create the camera
 m_cameraNodeReflections = new osg::CameraNode;
 m_cameraNodeReflections-setClearColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
 m_cameraNodeReflections-setViewport(0,0,512,512);
 m_cameraNodeReflections-setRenderOrder(osg::CameraNode::PRE_RENDER);
 m_cameraNodeReflections-attach(osg::CameraNode::COLOR_BUFFER , 
m_textureReflections);
 m_cameraNodeReflections-addChild(reflectedScene);
 
 // create the texgen node to project the tex coords onto the subgraph
 m_texgenNodeReflections = new osg::TexGenNode;
 m_texgenNodeReflections-setTextureUnit(textureID);
 waterScene-addChild(m_texgenNodeReflections);
 
 m_WaterPlane-setTexGenNodeReflections(m_texgenNodeReflections);
 osg::StateSet* waterSceneStateSet = waterScene-getOrCreateStateSet();
 
waterSceneStateSet-setTextureAttributeAndModes(textureID,m_textureReflections,osg::StateAttribute::ON);
 
waterSceneStateSet-setTextureMode(textureID,GL_TEXTURE_GEN_S,osg::StateAttribute::ON);
 
waterSceneStateSet-setTextureMode(textureID,GL_TEXTURE_GEN_T,osg::StateAttribute::ON);
 
waterSceneStateSet-setTextureMode(textureID,GL_TEXTURE_GEN_R,osg::StateAttribute::ON);
 

Re: [osg-users] osgHUD compilation on Windows

2008-01-16 Thread Jeremy Moles

On Wed, 2008-01-16 at 12:25 -0500, Jean-Sebastien Guay wrote:
 Hi Jeremy,
 
  At any
  rate, I'll either apply your patch or rethink my method of iteration
  after lunch and get that fixed up.
 
 No problem.
 
  PREEMPTIVE STRIKE! Huzzah!
 
 Hehehe :-)
 
  osghudframe.png:
  osghudtable.png:
 
 These two are the only ones I'm not sure about. See screenshots. These are the
 initial positions. For osghudtable, there's a small gap between the boxes on
 the second row and those on the first, which isn't there in your shot. For
 osghudframe, I'm just not sure it's positioned properly initially. I can move
 it around, rotate it, scale it, but I'm just wondering about the initial
 position.

When I apply your patch for iteration I get the same results you are.
So, this is certainly the cause of the problem, but the iteration
out-of-bounds is also a problem. :)

I'll fix this in the next few minutes and send you another e-mail so I
don't SPAM osg-users TOO much...

 The rest look good! Identical to your shots. Thanks, saved me a bit of work
 making them :-)
 
  doesn't blend
  properly, but I'm sure that's something I'm doing wrong (another post
  about it here from 2 days ago).
 
 I'll see if I can help with that later.
 
 J-S
 --
 __
 Jean-Sebastien Guay [EMAIL PROTECTED]
 http://whitestar02.webhop.org/

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


Re: [osg-users] polytopeIntersector

2008-01-16 Thread Gianluca Natale
Hi,
I went deeply in debug into my code, and I discovered that the problem
is in OSG v.2.2.
Actually it returns the object with the shortest node path among those
in the intersection vector.
Was it a known bug?

Thanks in advance
Gianluca


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Thursday, January 10, 2008 9:05 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] polytopeIntersector

HI Gianluca,

In the 2.3.x dev release and SVN of the OSG there are improvements to
the PolytopeIntersector that might help you so it'd be worth trying
out over using 2.2

Robert.

On Jan 10, 2008 5:46 PM, Gianluca Natale [EMAIL PROTECTED]
wrote:




 Hi all!



 I'm trying to use a osgUtil::PolytopeIntersector

 to find the closest object in my 3D scene graph (with OSG ver.2.2).

 I read on the OSG QSG that it should return the closest object

 as the first in the list of intersections.

 But it is not like that!

 I mean that the array of intersections correctly contains all of

 the objects hit by the intersection volume,

 but the first of those is not necessary the closest.

 BTW, it seems to be the object with the shortest node path. Might it be?



 Any idea of my mistake?



 Thank you in advance.



 Gianluca



 P.S.=attached is the source file (look into the class PickHandler,

 in the method pick; first I tried getting directly the first
 intersection in

 the list, picker-getFirstIntersection(); then I tried to sort

 the intersection on my own. But I pick always the background
 rectangle!)


 ___
 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] VPB in SVN

2008-01-16 Thread Robert Osfield
On Jan 16, 2008 2:51 PM, Jean-Sebastien Guay
[EMAIL PROTECTED] wrote:
 Just updated OSG from SVN to get the changes to osgTerrain::GeometryTechnique,
 recompiled, and regenerated the terrain, and it's fixed. No more black lines.
 Thanks Robert.

Good to hear.

 I don't think there are any other issues right now, unless you want me to
 download some other data set and do some tests on it... The next step seems to
 be documenting and testing the distributed database generation.

Next step is for me to complete the distributed functionality, then
I'll have a bit of breathing space to document it.

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


Re: [osg-users] Some Code

2008-01-16 Thread Robert Osfield
Hi GuiYe,

All the cull settings that you've being doing with SceneView in 1.2
can now be done directly with osg::Camera as it subclasses from
osg::CullSettings.  For the most part you just need to rewrite the
code to do stuff like:

   viewer.getCamera()-setComputeNearFarMode(..);

Robert.

2008/1/16 GuiYe [EMAIL PROTECTED]:




   Hello,robert!

   I use the code to load the nodes from the commandline arguments. Just like
 these(a example of osgWater today I receive):

 #include WaterPlane.h
 #include osgDB/ReadFile
 #include osgUtil/Optimizer
 #include osgProducer/Viewer
 #include osg/CoordinateSystemNode
 #include osg/Group
 #include osg/Node
 #include osg/CameraNode
 #include osg/Texture
 #include osg/TexGenNode
 #include osg/ShapeDrawable
 #include osg/State
 #include osg/StateSet
 #include osg/Material
 #include osgUtil/SceneView
 #include osg/Texture2D
 #include osg/CameraNode
 #include osg/Shader
 #include osg/Uniform
 #include osg/Program

 class Ocean : public osg::Drawable {
  public:
   Ocean(osgUtil::SceneView* );
   /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
   Ocean(const Ocean teapot,const osg::CopyOp
 copyop=osg::CopyOp::SHALLOW_COPY):
   osg::Drawable(teapot,copyop) {}
   META_Object(myOcean,Ocean)
   /** Compute the bounding box around Drawables's geometry.*/
   virtual osg::BoundingBox computeBound() const;
   /** Deprecated. */
   virtual void drawImplementation(osg::State) const;

   class OceanNodeUpdateCallback : public osg::NodeCallback {
public:
 OceanNodeUpdateCallback(Ocean* ocean){
  m_Ocean = ocean;
 }
 virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) {
  // first update subgraph to make sure objects are all moved into
 position
  traverse(node,nv);
  // update scene
  osg::Vec3 eye,center,up;

 m_Ocean-m_SceneView-getCamera()-getViewMatrixAsLookAt(eye,center,up);
  m_Ocean-m_camObserving.position(eye, center);
  //aim the projecting camera
  m_Ocean-m_WaterPlane-aimProjector((m_Ocean-m_camProjecting),
 (m_Ocean-m_camObserving));
  m_Ocean-m_camProjecting.saveFrustum(m_Ocean-m_SceneView);
  m_Ocean-m_camObserving.position(eye, center);
  m_Ocean-m_camObserving.saveFrustum(m_Ocean-m_SceneView);
  double time = .1;
  //update and render water plane
  m_Ocean-m_WaterPlane-update(m_Ocean-m_SceneView,time,
 (m_Ocean-m_camProjecting), (m_Ocean-m_camObserving));
  //m_Ocean-dirtyBound();
  //osg::BoundingBox bb;
  //osg::Vec3d minBB,maxBB;
  //m_Ocean-m_WaterPlane-getBoundBox(minBB,maxBB);
  //bb.set(minBB,maxBB);
  //m_Ocean-setBound(bb);
 }
Ocean* m_Ocean;
   };


   void updateBoundingBox(osg::BoundingBox);
   WaterPlane* m_WaterPlane;
   Ocean() {};
   virtual ~Ocean() {
delete m_WaterPlane;
   }
   osgUtil::SceneView* m_SceneView;
   Cameram_camProjecting;  //the extra camera used to project the
 water, based on m_camObserving but modified if necessary
   Cameram_camObserving;   //the camera in the scene
   osg::BoundingBox m_boundingBox;
   osg::CameraNode* createReflectionsMap(osg::Group* waterScene, osg::Node*
 reflectedScene, unsigned int textureID);
   osg::Texture2D* m_textureReflections;
   osg::CameraNode* m_cameraNodeReflections;
   osg::TexGenNode* m_texgenNodeReflections;
   osg::CameraNode* createRefractionsMap(osg::Group* waterScene, osg::Node*
 refractionsScene, unsigned int textureID);
   osg::Texture2D* m_textureRefractions;
   osg::CameraNode* m_cameraNodeRefractions;
   osg::TexGenNode* m_texgenNodeRefractions;
 };
 osg::CameraNode* Ocean::createReflectionsMap(osg::Group* waterScene,
 osg::Node* reflectedScene, unsigned int textureID){
  m_textureReflections = new osg::Texture2D;
  m_textureReflections-setTextureSize(1024, 1024);
  m_textureReflections-setInternalFormat(GL_RGBA);

 m_textureReflections-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);

 m_textureReflections-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);

 m_textureReflections-setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);

 m_textureReflections-setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);
  m_textureReflections-setBorderColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
  // create the camera
  m_cameraNodeReflections = new osg::CameraNode;
  m_cameraNodeReflections-setClearColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
  m_cameraNodeReflections-setViewport(0,0,512,512);
  m_cameraNodeReflections-setRenderOrder(osg::CameraNode::PRE_RENDER);
  m_cameraNodeReflections-attach(osg::CameraNode::COLOR_BUFFER ,
 m_textureReflections);
  m_cameraNodeReflections-addChild(reflectedScene);

  // create the texgen node to project the tex coords onto the subgraph
  m_texgenNodeReflections = new osg::TexGenNode;
  m_texgenNodeReflections-setTextureUnit(textureID);
  waterScene-addChild(m_texgenNodeReflections);

  m_WaterPlane-setTexGenNodeReflections(m_texgenNodeReflections);
  osg::StateSet* 

Re: [osg-users] Performance Problem

2008-01-16 Thread Robert Osfield
Hi Jin,

Try compressing the scene's texture via:

  osgconv --compress mymodel.fmt mymodel.ive
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Performance Problem

2008-01-16 Thread Brian
Try loading each of the 18 models separately and see which models decrease
your FPS the most.  Then study those models closer to see the cause.

Press the 'S' key twice in osgviewer and look at how much time is spent
culling, drawing, and updating.

Some possible causes
1.  Too many triangles.
2.  Too many different objects sometimes artists seperate their Geometry
into to many groups.
3.  Not using LODs
4.  Too many StateSet changes.
5.  Textures use too much memory.
6.  And more others

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


Re: [osg-users] osgHUD compilation on Windows

2008-01-16 Thread Jean-Sebastien Guay
Hi Jeremy,

 Actually, rev59. :)

Yep, that did it. Results seem to be the same as yours too, obviously.

I'll try to keep in touch with your latest developments and inform you if there
are other problems. In the mean time, I'll try and use it in a few little
tests.

Again, good work!

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


Re: [osg-users] VPB in SVN

2008-01-16 Thread Paul Martz
NVIDIA drivers have a control for default texture clamping. I know this used
to default to the CLAMP_TO_EDGE, and if you wanted OpenGL spec-compliant
behavior, you had to manually change it to CLAMP_TO_BORDER.

I wonder if this is the cause of the black lines issue? CLAMP_TO_BORDER with
full 0 to 1 texture coordinates and no border specified in the texture, that
would cause a black edge where the texture tiles meet... If this is the
case, proper use of the texture border would eliminate the problem.

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



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Jean-Christophe Lombardo
 Sent: Wednesday, January 16, 2008 6:13 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] VPB in SVN
 
 Just to go a little further on this black contour problem:
 I've transfered my scene generated on linux side to windows, 
 and the black contour appears...
 
 Is there any difference in the default texture parameters 
 between linux and windows ?
 
 Thanks
 
 jcl
 
 
 
  
  
 **
 **
 This footnote confirms that this email message has been 
 scanned by PineApp Mail-SeCure for the presence of malicious 
 code, vandals  computer viruses.
 **
 **
 
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org

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


Re: [osg-users] VPB in SVN

2008-01-16 Thread Jean-Sebastien Guay
Hi Paul,

 NVIDIA drivers have a control for default texture clamping. I know this used
 to default to the CLAMP_TO_EDGE, and if you wanted OpenGL spec-compliant
 behavior, you had to manually change it to CLAMP_TO_BORDER.

Thanks for the details! I'm always impressed at how difficult it seems to be for
driver writers to conform to a spec... I'm sure it's more difficult than it
seems, but I wonder if they're really trying hard enough?

 I wonder if this is the cause of the black lines issue? CLAMP_TO_BORDER with
 full 0 to 1 texture coordinates and no border specified in the texture, that
 would cause a black edge where the texture tiles meet... If this is the
 case, proper use of the texture border would eliminate the problem.

Yep, that's whay Robert ended up doing.

Thanks,

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


Re: [osg-users] openscenegraph.org's Chinese mirror will be run after the new

2008-01-16 Thread FreeSouth
Hi Robert and all:

Thanks for Robert's support and his kind help in process.

This Chinese mirror have spent more time for his surface looks like the 
English official website. I use the Trac and almost all the images and chart's 
come from openscenegraph.org, the datebase is a very important difficulties in 
Tracs.  I have finish part of the mirror which is most looks like 
openscenegraph.org(99%, the 1% is the language difference).I think this will be 
help the osger in China to realize the mirror come from openscenegrph.org.

It also include some Chinese, but some are translating from English also, 
such as Navy's tutorials. Every nation's condition have some difference in 
using OpenSceneGraph. But when the website is finished after Feb 7, I will send 
a difference between the two site and if some need the articles or the 
tutorials in Chinese, I and my colleagues will translate it into English. For 
our poor English, Robert will edit it.

OpenSceneGraph is famous for two points, the first is powerful, and the 
last is poor document.

Mutiple langulage mirror is very useful for every nations.Someone have 
interesting in it?

Thank you Robert.

Regards

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


[osg-users] stereo projector support in OpenSceneGraph

2008-01-16 Thread Yanling Liu
Hi, our lab get a new stereo projector connects to two video outputs on one
Quadro FX 5500. Does OpenSceneGraph support such stereo display? I used to
do stereo display using two machine and now I have no idea how to do it
using one single video card. Any information will be appreciated.

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