Re: [osg-users] geodesic coordinated

2007-07-16 Thread Rafa Gaitan

Hi Neus,

I think the problem is that you need to convert 0,0,175 to
lat, lon coordinates...

Some questions..
- What is the extension in lat,lon of your dem data?
- It's 0,0,175 in lat, lon, height? or real coordinates?..
If is in lat, lon.. then you need to convert to real coordinates,
because osg works with that kind of coordinates.

This is done in this way:
// this asumes WGS84
osg::ref_ptr em = new osg::EllipsoidModel();
double lat = osg::DegreesToRadians(0);
double lon = osg::DegreesToRadians(0);
double height = 175;
double x,y,z;
em->convertLatLongHeightToXYZ(
lat,lon,height,x,y,z);

//now you have in x,y and z the real coordinates
tankPosit->setPosition(x,y,z);
...

I hope this helps to you. If not.. you know how to
find me at my lab!! ;)

Rafa.



On 7/16/07, Neus Aparicio <[EMAIL PROTECTED]> wrote:


Starting off of the following data:
•   Projection Geographic (Lat/Lon).
•   Spheroid: WGS84.
•   Datum: WGS84.

This it is the code that I am using:

int main()
{
osg::Group* root = NULL;
osg::Node* tankNode = NULL;
osg::Node* terrainNode = NULL;
osg::PositionAttitudeTransform* tankXform;
osg::Vec3 tankPosit;
osg::Geode* HUDGeode = new osg::Geode();
osg::Projection* HUDProjectionMatrix = new
osg::Projection;
osgProducer::Viewer viewer;
root = new osg::Group();
tankNode = osgDB::readNodeFile("model2.osg");
terrainNode = osgDB::readNodeFile("DEM.osg");
root->addChild(terrainNode);  //(carga el .osg)
tankXform = new osg::PositionAttitudeTransform();

root->addChild(tankXform); //(carga el modelo .flt)
tankPosit.set(0,0,175);
tankXform->setPosition(tankPosit);
viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
viewer.setSceneData( root );

viewer.realize();

while( !viewer.done() )
{
   viewer.sync();
   viewer.update();
   viewer.frame();
}
}

My question is: Why don't I represent the•3D model on
the terrain? If I know that the level of the terrain
is 175 m. Moreover, If the data are UTM, it represents
it correctly.
Somebody can say to me like doing it.

Thanks,

Neus


Neus Aparicio Ferrando





Sé un Mejor Amante del Cine
¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
http://advision.webevents.yahoo.com/reto/entretenimiento.html
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

Re: [osg-users] not compiling net plugin in mac

2007-07-14 Thread Rafa Gaitan

Hi Robert,

I could send you my modifications.. but I don't know if they
break the compilation in other systems .. anyway I could
try to compile the changes in a linux box, but not in windows.

I will make a test on linux and I'll send you.

Rafa.


On 7/14/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

Hi Rafa,

Arggh, a submission made by Mathias to fix build problems on other
platforms has obviously broken it here..  You could revert this fix
temporarily, or if you can find a workable modification of Mathias'
change then please post the compete file to me.

Cheers,
Robert.

On 7/14/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> Recent changes in net plugin have broken compilation in mac, I've realized
> that the this define is not correctly in my system:
>
> #if (defined(__APPLE__)&&(__GNUC__<4)) ||
> (defined(WIN32)&&!defined(__CYGWIN__)) ||
> !defined(_XOPEN_SOURCE_EXTENDED)
> #define socklen_t int
> #endif
>
> This is defined in sockinet.cpp and sockstream.cpp
>
> I have Tiger, so I think many mac users with tiger will have the same problem.
> I have gnu 4.0.1, so the problem could be the
> !defined(_XOPEN_SOURCE_EXTENDED), commenting the last "or", compiles
> ok.. I don't know if this will break the compilation
> in other system.. but needed for mac! ;)
>
> Thanks.
> Rafa.
>
> --
> Rafael Gaitán Linares
> Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
> Ciudad Politécnica de la Innovación
> Universidad Politécnica de Valencia
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/




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


[osg-users] not compiling net plugin in mac

2007-07-13 Thread Rafa Gaitan

Hi Robert,

Recent changes in net plugin have broken compilation in mac, I've realized
that the this define is not correctly in my system:

#if (defined(__APPLE__)&&(__GNUC__<4)) ||
(defined(WIN32)&&!defined(__CYGWIN__)) ||
!defined(_XOPEN_SOURCE_EXTENDED)
#define socklen_t int
#endif

This is defined in sockinet.cpp and sockstream.cpp

I have Tiger, so I think many mac users with tiger will have the same problem.
I have gnu 4.0.1, so the problem could be the
!defined(_XOPEN_SOURCE_EXTENDED), commenting the last "or", compiles
ok.. I don't know if this will break the compilation
in other system.. but needed for mac! ;)

Thanks.
Rafa.

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


Re: [osg-users] Build a new machine, comments?

2007-07-12 Thread Rafa Gaitan

On 7/12/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

I guess the next question once I start building it is... what Linux
distribution to go for.  I'm not sticking with Suse as I had done for
the past 6 years.  Must admit I'm very tempted by a debian based
distribution as the I just believe in the approach package management,
it just seems the right way to tackle things in the 21st century.

Another requirement is that I much prefer KDE over Gnome.

Oh its also got to have good support from NVidia's OpenGL drivers.



Kubuntu? is debian based and easy to configure the drivers.

Rafa.





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




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


Re: [osg-users] osgIntrospection bug?

2007-07-01 Thread Rafa Gaitan

Hi David and Robert,

Perfect!!! tested and working with my implementation!

Thanks!
Rafa.


On 6/30/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

On 6/29/07, David Callu <[EMAIL PROTECTED]> wrote:
> Submitted

And... merged :-)

Many thaks to David for his efforts for tracking this down and fixing
it so quickly.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/




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


Re: [osg-users] osgIntrospection bug?

2007-06-29 Thread Rafa Gaitan

yooohooo!!! thanks David! :D.. when submitted I will test it immediately!

Rafa.


On 6/29/07, Robert Osfield <[EMAIL PROTECTED]> wrote:


On 6/29/07, David Callu <[EMAIL PROTECTED]> wrote:
> Found and fixed !! Yeahh !
>
> I will send the submissions this evening.

Thankyou David for chasing this one down, its great to see the OSG get
self healling properties (albeit with a little help from its friends
;-)
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

Re: [osg-users] osgIntrospection bug?

2007-06-28 Thread Rafa Gaitan

Hi David and Robert

Well, osgIntrospection internals are quite far from my knowledge, but
I could try to continue developing our osgJava and see what
problems we find.

David, If you make any progress tell us please! ;).

Rafa.


On 6/27/07, David Callu <[EMAIL PROTECTED]> wrote:


I just see in the log of OpenSceneGraph svn the message "Updated
wrappers", exactly what  osgIntrospection users needs. I'm sorry and please
forgot my last request.

When I generated the wrapper, I ask to genwrapper to generate the
add/modified/removed.gw file, and the modified.gw was never empty. So I
always think the wrapper is out of date. But I just look the difference
between the original file and the new file, and this one, this is a space
added at the end of each comment line (probably a doxygen version
difference).

So the osgIntrospection bug probably didn't come from here.

And so I replunge in gdb to try to fix this bug.

Thanks
Best Regards
David Callu



2007/6/27, Robert Osfield < [EMAIL PROTECTED]>:
>
> On 6/27/07, David Callu < [EMAIL PROTECTED]> wrote:
> > If you work with osgwrapper_*, I advise you to always regenerate
> the
> > wrapper after a "svn update",
> > or If Robert is agree, he could add a hook on the svn repository
> to
> > generate the wrapper after each commit.
>
> Some commits are partial so it might lead to genwrapper being run at
> inappropriate times.
>
> In dev I tend to do a set of changes and commit them as I go along,
> then once its stabilised run genwrapper.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


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





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

[osg-users] osgIntrospection bug?

2007-06-27 Thread Rafa Gaitan

Hi Robert,

Working with osgIntrospection we have realized that
there is a problem with some methods (setName and addChild).

For example, if you create a Node and after that you call setName,
there isn't problems in the call.. but if you create a Group and then
you call the same method then crash.

The problem with the method addChild is similar. If you call it from
an instance of Group works perfectly but if you try to call it from
PositionAttitudeTransfom then it doesn't crash but the method doesn't
adds any child.

We are now working in a osgJava implementation, following the same
ideas of osgPython. Miguel(osgPython) and me have been debugging
and we have created a simple example in C++ showing the problem.
I would like to talk with Jose Luís(osgLua) to know if he finds the same
problem.

Notes:
 - You can find attached the example and the line to compile it is
   in the first line of the file ;).
 - The example has been tested against osg 2.0 and with svn
   version r7033 (few hours ago) and fails on both.

Rafa.



--
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
// g++ -Wl,-E -fno-strict-aliasing -g -O2 -W -Wall -fPIC -losg -losgDB -losgIntrospection -o test test.cpp

#include 

#include 
#include 
#include 
#include 
#include 



// borrowed from osgDB...
std::string createLibraryNameForWrapper(const std::string& ext)
{
#if defined(WIN32)
// !! recheck evolving Cygwin DLL extension naming protocols !! NHV
#ifdef __CYGWIN__
return "cygosgwrapper_"+ext+".dll";
#elif defined(__MINGW32__)
return "libosgwrapper_"+ext+".dll";
#else
#ifdef _DEBUG
return "osgwrapper_"+ext+"d.dll";
#else
return "osgwrapper_"+ext+".dll";
#endif
#endif
#elif macintosh
return "osgwrapper_"+ext;
#elif defined(__hpux__)
// why don't we use PLUGIN_EXT from the makefiles here?
return "osgwrapper_"+ext+".sl";
#else
return "osgwrapper_"+ext+".so";
#endif

}

osgDB::DynamicLibrary *loadWrapper(const std::string &name)
{
	std::cout << "loading ... " << name << std::endl;
	return osgDB::DynamicLibrary::loadLibrary(
		createLibraryNameForWrapper(name)
	);
}

int main()
{
	osg::ref_ptr osg_lib = loadWrapper("osg");

	osgIntrospection::ValueList vlgrp;
	osgIntrospection::ValueList vlcall;

	const osgIntrospection::Type &type = osgIntrospection::Reflection::getType("osg::Group");

	//grp = new osg::Group();
	osgIntrospection::Value grp = type.createInstance(vlgrp);	
	

	//grp->setName("test");
	vlcall.push_back(osgIntrospection::Value("test"));
	const osgIntrospection::MethodInfo *m = type.getCompatibleMethod("setName", vlcall, true);
	if (m){
		osgIntrospection::ValueList::const_iterator it;
		std::string str;
	
		// Print to screen some info	
		str = "Calling to: " + type.getQualifiedName() + "::setName (";
		for (it=vlcall.begin(); it != vlcall.end(); ++it){
			str += it->getType().getQualifiedName() + ", "; 
		}
		str += "\b\b)";
		std::cout << str << std::endl;

		//Call Method
		m->invoke(grp, vlcall);
	}
	else{
		osgIntrospection::ValueList::const_iterator it;
		std::string error = "Method " + type.getQualifiedName() + "::setName (";
		for (it=vlcall.begin(); it != vlcall.end(); ++it){
			error += it->getType().getQualifiedName() + ", "; 
		}
		error += ") not found.";
		std::cerr << "Error: " << error << std::endl;
	}


	return 0;
}





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

Re: [osg-users] Compiling osg2.0 and osgLua for Windows

2007-06-26 Thread Rafa Gaitan

Hi Jose and Frode,

Actually we have detected some issues using osgIntrospection,
for example, the method setName on osg::Object, only is callable
if you make an instance of osg::Node, if you try to call it through an
instance of osg::Group it fails... By now we are debugging the problem
to determine if is an osgIntrospection problem or our code.

I'll report all we discover in this line.

Rafa.


On 6/26/07, Jose Luis Hidalgo <[EMAIL PROTECTED]> wrote:

Hi Frode,
   Actually osgLua is not updated up to osg 2.0, I would try to have a
look at it and test it on Linux (with hope enough it will also work on
Windows).Let me ping the list back when done.  What I will really
appreciate is see if the problem can be tracked and discard a osgLua
failure or if it is an osgIntrospection problem.

Cheers,
Jose L.

2007/6/26, Frode Aarstad <[EMAIL PROTECTED]>:
> I am having problems getting osgLua to work properly with osg2.0 using
> Visual Studio 8.
>
> We have used the osgLua  with success for a while now compiled against an
> older version of osg (1.2.0-200702112325). I have been trying for a few days
> to upgrade to osg2.0 but keep dumping into runtime problems. It seems to
> crash in different places each time I try but it seems like there could be
> some problems with the introspection wrappers and the osgLua.
>
> The wrappers seems to be working as the introspection example runs just fine
> and the osgLua works fine with the example code provided. Our lua scripting
> engine (based on osgLua) works fine for simple scripts but run into trouble
> when we try and build a scene using more complex osg types. My initial guess
> would be that there is something wrong with the type system but the
> debugging information is limited and this could just be a side effect of
> another problem.
>
> I am currently backtracking the osg dev releases to try and isolate the
> problem but figured I would check here if some of you have run into the same
> problem or could perhaps have an idea about what the problem is.
>
> Cheers,
>
>
> Frode Aarstad
>
>
>
>
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


--
  Jose L. Hidalgo Valiño (PpluX)
   http://www.pplux.com 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/




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


Re: [osg-users] Design Questions Scene / Viewer

2007-06-19 Thread Rafa Gaitan

On 6/19/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:


Hi Robert,

I'm really interested in the same things (I remember you asked me a long
response aboute similar problems).




ops not asked... answered!!! sorry..

Not only changing the Databasepager is usefull.. you should have access

to sceneview to change also the default CullVisitor.. or anything.. Maybe
moving the concept of sceneview to other class.. or a way to access it
should be necessary. If I remember you were thinking in the posibility
to add a clone method of the DB or the CullVisitor in order to configure
correctly the SceneView in the setSceneData method..

Rafa.


On 6/19/07, Adrian Egli <[EMAIL PROTECTED] > wrote:
>
> Hi Robert,
>
> thanks for the short replay. This would solve for me all the mentioned
> "hidden" object issues i have at the moment.
>
> /adegli
>
> 2007/6/19, Robert Osfield < [EMAIL PROTECTED]>:
> >
> > Hi Adrian,
> >
> > On 6/19/07, Adrian Egli <[EMAIL PROTECTED]> wrote:
> > > thanks, i have to use my own databasepager implementation for our
> > > application. So i need to insure that the may databasepager will be
> > used for
> > > each scene.  May i need just a possiblity to set the database pager
> > object and
> > > management with a factory object.
> > >
> > > i need just to use my own databasepager at the moment.
> >
> > I believe a factory method would be a good way to solve this issue,
> > have the app developer set the prototype that osgViewer clones when it
> > needs a DatabasePager.  This would ensure that any new scene will get
> > the right type of pager.
> >
> > The same approach could possible by used for constructing CullVisitor
> > and other similar components.
> >
> > Robert.
> > ___
> > osg-users mailing list
> > osg-users@openscenegraph.net
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
>
>
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>



--
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia





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

Re: [osg-users] Design Questions Scene / Viewer

2007-06-19 Thread Rafa Gaitan

Hi Robert,

I'm really interested in the same things (I remember you asked me a long
response aboute similar problems).

Not only changing the Databasepager is usefull.. you should have access
to sceneview to change also the default CullVisitor.. or anything.. Maybe
moving the concept of sceneview to other class.. or a way to access it
should be necessary. If I remember you were thinking in the posibility
to add a clone method of the DB or the CullVisitor in order to configure
correctly the SceneView in the setSceneData method..

Rafa.


On 6/19/07, Adrian Egli <[EMAIL PROTECTED]> wrote:


Hi Robert,

thanks for the short replay. This would solve for me all the mentioned
"hidden" object issues i have at the moment.

/adegli

2007/6/19, Robert Osfield < [EMAIL PROTECTED]>:
>
> Hi Adrian,
>
> On 6/19/07, Adrian Egli <[EMAIL PROTECTED]> wrote:
> > thanks, i have to use my own databasepager implementation for our
> > application. So i need to insure that the may databasepager will be
> used for
> > each scene.  May i need just a possiblity to set the database pager
> object and
> > management with a factory object.
> >
> > i need just to use my own databasepager at the moment.
>
> I believe a factory method would be a good way to solve this issue,
> have the app developer set the prototype that osgViewer clones when it
> needs a DatabasePager.  This would ensure that any new scene will get
> the right type of pager.
>
> The same approach could possible by used for constructing CullVisitor
> and other similar components.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


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





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

[osg-users] osgViewer::Viewer integration

2007-06-12 Thread Rafa Gaitan

Hi Robert,

Finally I successfully integrated the osgViewer::Viewer and Java using
jogl!!
recently changes on GraphicsWindow and on TrackballManipulator have solved
the problems!, so congrats for the good job!

But I continue with (hope) little problems:

In our app, we have extended the CullVisitor and the DatabasePager.
Replacing them on previous SimpleViewer was really easy.. but in the
osgViewer::Viewer, I'm only capable to change the DatabasePager...

The way I have changed the DatabasePager is:
viewer.setSceneData(...);
viewer.getScene()->setDatabasePager(new myDatabasePager);
viewer.setUpRenderingSupport();

I'm not sure if this is completely correct, but I've realized that
the Scene is only initialized inside the setSceneData, so
you cannot change the databasepager if you don't set data
and after that you need to call setUpRenderingSupport to
configure correctly the SceneViews.

About the CullVisitor, the SceneViews are not accesible
so it's not possible to change it. Anyway if you change
the scenedata, then you need to set again the own databasepager
and the sceneviews are cleared and created again.

So, my suggestion is why not create a default Scene in the constructor?
and.. Why not set the {Update,Cull}Visitors also in the Scene, after that
when calling setUpRenderingSupport, then only needs to access to the
default created scene and configure all sceneviews with the correct
values. It's this possible?

Thanks!
Rafa.




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

Re: [osg-users] osgwrapper_osgViewer not updated?

2007-06-07 Thread Rafa Gaitan

On 6/7/07, Robert Osfield <[EMAIL PROTECTED]> wrote:


On 6/7/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> ops! HelpHandler and StatsHandler continues on the repo inside the
> osgwrapper_osgViewer
> Just removing the files compiles ok!

Thanks for the feedback, Inching slowly forward...  I've now removed
this old files.  Fingers crossed...




Looks ok!, Thanks!

Robert.

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





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

Re: [osg-users] osgwrapper_osgViewer not updated?

2007-06-07 Thread Rafa Gaitan

Hi Robert,

ops! HelpHandler and StatsHandler continues on the repo inside the
osgwrapper_osgViewer
Just removing the files compiles ok!

Rafa.


On 6/7/07, Robert Osfield <[EMAIL PROTECTED]> wrote:


Hi Rafa,

Aaarg, sorry, now updated.  How frustrating to miss for 1.9.8...

Robert.

On 6/7/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> Just compiling SVN version I 've realized that osgwrapper_osgViewer is
not
> updated
> with the recent changes, and fails the compilation.
>
> Rafa.
>
> --
> Rafael Gaitán Linares
> Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
> Ciudad Politécnica de la Innovación
> Universidad Politécnica de Valencia
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

[osg-users] osgwrapper_osgViewer not updated?

2007-06-07 Thread Rafa Gaitan

Hi Robert,

Just compiling SVN version I 've realized that osgwrapper_osgViewer is not
updated
with the recent changes, and fails the compilation.

Rafa.

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

Re: [osg-users] Re: SimpleViewer needs to be replaced by... Viewer and CompositeViewer

2007-06-06 Thread Rafa Gaitan

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


Hi Rafa,

I'm afraid I can't really spot what might be up from these code
fragments or your explanation.  Is it possible to create a small
example that glues Java and the OSG together.  I don't use Java myself
so don't really know where to start, but from a complete example I
might be able to work out what's going on.



Ok, I will try to  create a minimal example, once I will finish some
documentation task in our project! :S

W.r.t the HUD Camera you have the option of placing this as a Slave

camera rather than a main Camera, or just using CompositeViewer.  For
an example of using CompositeViewer with GraphicsWindowEmbedded you
could look at the latest incarnations of the osgviewerGLUT and
osgviewerQT examples as they now have both Viewer and COmpositeViewer
paths.



This hud is created only to allow an easy way to add text2d on the Viewer,
but
I will look the other paths that you suggest.

Thanks!
Rafa.


Robert.


On 6/5/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> Sorry about the late response, I was busy in other tasks.
>
> > This is probably the Camera's being resized relative to the original
> > size, and the original projection and viewport is done relative to the
> > defined window size.  This is done to allow for multiple cameras to
> > share a single window.  SimpleViewer just hardwired the aspect ratios
> > and viewports to exactly that of the window size so can probably get
> > away with more.   I would however, with Viewer expect a camera filling
> > the whole window to still remain filling the whole window after
> > resize.
> >
> > Could you post how you are wiring things up?
>
> Yes, I have made two tests, one inheriting from osgViewer::Viewer
> and other one wrapping it on a class, both the same result. I
> need to subclass or to wrap because I need a way to manage
> things from Java.
>
> This is the way I make things up:
> MyViewer::MyViewer():osgViewer::Viewer()
> {
> _gw = setUpViewerAsEmbeddedInWindow(0,0,800,600);
> _root = new osg::Group();
> setSceneData(_root.get());
> _cameraHUD = createHUD();
> _root->addChild(new osg::Group());
> _root->addChild(_cameraHUD.get());
> setCameraManipulator(new osgGA::TrackballManipulator);
> getCamera()->setPostDrawCallback(new SnapImageDrawCallback());
> }
>
> Doing things on constructor could be a problem? I'm not sure, but it's
possible
> that the rendering context is not created yet, when I call the
constructor.
>
> The way I'm passing events is:
>
> myViewer->getGraphicsWindow()->getEventQueue()->
>
> and in the resize event I also call:
>
> myViewer->getGraphicsWindow()->resized(x,y,w,h);
>
> Doing some more tests I've realized that the events do not arrive to the
> Manipulator. Looks like there isn't manipulator on the viewer.. but I'm
> setting it. Resize event arrives but the camera projection is incorrect
> just starting the viewer.
>
> >
> > This suggests that the viewer is being destructed after the graphics
> > context has been destroyed.  Try destroying the viewer first then your
> > own window.
>
> Yes, that was the problem! Thanks!.
>
> Thanks!
> Rafa.
>
> --
> Rafael Gaitán Linares
> Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
> Ciudad Politécnica de la Innovación
> Universidad Politécnica de Valencia
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

Re: [osg-users] GraphicsWindowJava ? :-)...

2007-06-05 Thread Rafa Gaitan

Hi Emmanuel,

We are doing a Viewer using JOGL as you done before. Now we
are trying to integrate the new osgViewer::Viewer, using the
GraphicsWindowsEmebedded (also new).

I would like to create a GraphicsWindowJava, but I don't have
too much time to afford the task. We are also trying to integrate
osgIntrospection I hope in next weeks we will have some interesting
results.


I'd suggest taking another tack to generating Java wrappers such as by
using osgIntrospection in the same way as being done for C# right now.
 The tool for generating these wrappers should GPL'd in the not too
distant future.



Interesting.. I would like to see it! Java an C# are not too distant as a
languages! :D

Rafa.

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


Re: [osg-users] Re: SimpleViewer needs to be replaced by... Viewer and CompositeViewer

2007-06-05 Thread Rafa Gaitan

Hi Robert,

Sorry about the late response, I was busy in other tasks.


This is probably the Camera's being resized relative to the original
size, and the original projection and viewport is done relative to the
defined window size.  This is done to allow for multiple cameras to
share a single window.  SimpleViewer just hardwired the aspect ratios
and viewports to exactly that of the window size so can probably get
away with more.   I would however, with Viewer expect a camera filling
the whole window to still remain filling the whole window after
resize.

Could you post how you are wiring things up?


Yes, I have made two tests, one inheriting from osgViewer::Viewer
and other one wrapping it on a class, both the same result. I
need to subclass or to wrap because I need a way to manage
things from Java.

This is the way I make things up:
MyViewer::MyViewer():osgViewer::Viewer()
{
_gw = setUpViewerAsEmbeddedInWindow(0,0,800,600);
_root = new osg::Group();
setSceneData(_root.get());
_cameraHUD = createHUD();
_root->addChild(new osg::Group());
_root->addChild(_cameraHUD.get());
setCameraManipulator(new osgGA::TrackballManipulator);
getCamera()->setPostDrawCallback(new SnapImageDrawCallback());
}

Doing things on constructor could be a problem? I'm not sure, but it's possible
that the rendering context is not created yet, when I call the constructor.

The way I'm passing events is:

myViewer->getGraphicsWindow()->getEventQueue()->

and in the resize event I also call:

myViewer->getGraphicsWindow()->resized(x,y,w,h);

Doing some more tests I've realized that the events do not arrive to the
Manipulator. Looks like there isn't manipulator on the viewer.. but I'm
setting it. Resize event arrives but the camera projection is incorrect
just starting the viewer.



This suggests that the viewer is being destructed after the graphics
context has been destroyed.  Try destroying the viewer first then your
own window.


Yes, that was the problem! Thanks!.

Thanks!
Rafa.

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


Re: [osg-users] Re: SimpleViewer needs to be replaced by... Viewer and CompositeViewer

2007-06-03 Thread Rafa Gaitan

Hi Robert,

I have some problems with osgViewer::Viewer integration.

First, passing events mouse throught GraphicsWindows
are completely ignored and resize events not work as the previous
SimpleViewer did.

I'm not sure if I missed something.. but I have
reviewed the code lots of times! I have set OSG_NOTIFY_LEVEL to
DEBUG, but nothing strange occurs. There is also a different inicialization
between osgviewerGLUT and mine. I don't know the initial size of the
window, so I pass a default value, and after that a resize event arrives,
but looks like the resize event is not correctly passed (on previous
SimpleViewer
it worked perfectly)


Second, Once finished the application, it produces a crash. Here
is the stack:
0   libGL.dylib 0x92b1e96f glDeleteTextures + 59
1   libosg.8.dylib  0x1330794e
TextureObjectManager::flushAllTextureObjects(unsigned) + 106
2   libosg.8.dylib  0x133079e4
osg::Texture::flushAllDeletedTextureObjects(unsigned) + 42
3   libosg.8.dylib  0x132b3b3d
osg::GraphicsContext::close(bool) + 1041
4   libosgViewer.8.dylib0x137bcde9
osgViewer::Viewer::~Viewer [in-charge deleting]() + 441
5   libjosgviewer.jnilib0x12f140d5
osg::Referenced::unref() const + 169

Any Idea on How solve this problems?

Thanks!
Rafa.


On 6/3/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

Hi Rafa,

On 6/3/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Thanks, I'm now porting to the osgViewer::Viewer, All goes really
> easy, but I miss a way to access to the SceneView, or a way to
> change the default CullVisitor, in our system we have inherited from
> the CullVisitor to add some extra functionality. And I don't find an
> easy path to change it in the current osgViewer::Viewer.

Interesting problem... not sure of easy solution right away as Viewer
is able to handle multiple SceneView, one or two per Camera depending
in the threading model, and these internal SceneView's can get deleted
and new ones when the viewer gets reconfigured.

Perhaps we could provide a clone mechanism that SceneView could use
when setting up its CullVisitor, such that you set the default
CullVisitor used and any new SceneView that gets constructed uses
clones this CullVisitor.

Getting access to the constructed CullVisitors might also be any issue
as the internal SceneView are all hidden as implementation details
rather than part of the public interface.   We could possibly add a
method for collecting all the CullVisitor's in action on a Viewer just
like we can do for Cameras and GraphicsWindows.

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




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


Re: [osg-users] Re: SimpleViewer needs to be replaced by... Viewer and CompositeViewer

2007-06-03 Thread Rafa Gaitan

Hi Robert,

Thanks, I'm now porting to the osgViewer::Viewer, All goes really
easy, but I miss a way to access to the SceneView, or a way to
change the default CullVisitor, in our system we have inherited from
the CullVisitor to add some extra functionality. And I don't find an
easy path to change it in the current osgViewer::Viewer.

Thanks
Rafa.


On 6/3/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

Hi Rafa,

On 6/2/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> That's really good news, I will do a test with our Viewer in Java, and
> I'll comment you how it works!

This morning I check in a convenience method into osgViewer::Viewer to help out:


 /** Convenience method for setting up the viewer so it can be
used embedded in an external managed window.
  * Returns the GraphicsWindowEmbedded that can be used by
applications to pass in events to the viewer. */
virtual GraphicsWindowEmbedded*
setUpViewerAsEmbeddedInWindow(int x, int y, int width, int height);

Have a look at the osgviewerGLUT and osgviewerSDL examples to see it
can be used.  The basic idea is that you contruct the viewer, use the
above method to create the GraphicsWindowEmbedded with you then use to
pass in events to via the GraphicsWindow's EventQueue.  Note there is
a resized method that needs to be called as well on the window so it
can resize all the camera viewports and camera projection matrices.

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




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


Re: [osg-users] Re: SimpleViewer needs to be replaced by... Viewer and CompositeViewer

2007-06-02 Thread Rafa Gaitan

Hi Robert,

That's really good news, I will do a test with our Viewer in Java, and
I'll comment you how it works!

Thanks.
Rafa.


On 6/2/07, Paul Sherman <[EMAIL PROTECTED]> wrote:

Robert,

That certainly is good news. I haven't been following the news lately (very
busy) but what is the status of all of these changes and improvements for us
Windows users?

- Paul

On Saturday 02 June 2007 09:08, Robert Osfield wrote:
> I have now ported the GLUT, SDL, Wx and QT examples across to use the
> new osgViewer::GraphicsWindowEmbedded + osgViewer::Viewer.
>
> On the QT front I have merged the QT3 and QT4 examples into one
> osgviewerQT example, and the CMakeLists.txt files should be able to
> tell the build which one to include.  I have only tested the QT3 side,
> so could someone with QT4 installed have a try with the latestest
> checked into SVN.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/




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


Re: [osg-users] Recording an AnimationPath in osgviewer

2007-05-30 Thread Rafa Gaitan

Hi Paul,



This can't possibly be the case. We know how osgviewer works, and it
doesn't
alter the view matrix after the update traversal. So it seems to me that
Jeremy's proposed solution would always obtain correct view information.

In fact, Jeremy's proposed solution seems like the right way to do it:
Place
all the functionality in the osgviewer application and don't alter the
core
classes at all. Also, no need to derive from Viewer, and no need to use
anything other than Viewer::run().



You are right, but doing that in a "generic" way inside osgViewer::Viewer
class
could help anyone to develop, save and set AnimationPaths, and also
get the camera in a safe way if you want to use the viewer embedded.

Anyway a simple way could be save the camera view matrix inside the
rendering traversal, and then you can always get a safe camera value of the
last frame. This It will not affect too much to the  viewer functionality
and
the RecordAnimationPath could be done easily.

Rafa.



-Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Robert Osfield
> Sent: Wednesday, May 30, 2007 4:17 PM
> To: osg users
> Subject: Re: [osg-users] Recording an AnimationPath in osgviewer
>
> Hi Paul,
>
> On 5/30/07, Paul Martz <[EMAIL PROTECTED]> wrote:
> > I'm confused about this. We're discussing the osgviewer
> application, right?
> > I wasn't aware that osgviewer allowed the user to add their
> own update
> > traversal, or allowed the user to modify the view after the update
> > traversal. As far as I can see from looking at the code, osgviewer
> > sets the view in the event traversal with, say, a
> TrackballManipulator.
>
> osgViewer::Viewer is extensible, you can subclass from it to
> override the various traversals.
>
> You can also use it are several levels of granulatity i.e.
>
>   viewer.run();
>
> OR
>
>   viewer.realize();
>   while(!viewer.done())
>   {
>  viewer.frame();
>   }
>
> OR
>
>   viewer.realize();
>   while(!viewer.done())
>   {
>  viewer.advance();
>  viewer.eventTraversal();
>  viewer.updateTraversal();
>  viewer.renderingTraversals();
>   }
>
> With the last one you can do:
>
>   viewer.realize();
>   while(!viewer.done())
>   {
>  viewer.advance();
>  viewer.eventTraversal();
>  viewer.updateTraversal();
>
>  viewer.getCamera()->setViewMatrix(computeMyViewMatrix());
>
>  viewer.renderingTraversals();
>   }
>
> W.r.t the proposal of having a renderingTraversals()
> callback, this would provide an alternative to subclassing
> from Viewer, but still allow one to override the
> renderingTraversals() implememtation and catch what the
> getCamera()->getViewMatrix() is.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/

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





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

Re: [osg-users] Recording an AnimationPath in osgviewer

2007-05-30 Thread Rafa Gaitan

Ops! Robert your mail didn't arrive when I was writting mine!...

Well maybe setting a renderingTraversal Callback?.. this could
be set to get the Camera Info correctly. In our project we need
to get the camera info, but if you adapt the Viewer to remove
the SimpleViewer, then should be done  in a safe way.

Rafa.


On 5/30/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:

Hi Jeremy,

On 5/30/07, Jeremy L. Moles <[EMAIL PROTECTED]> wrote:
> On Wed, 2007-05-30 at 16:35 +0100, Robert Osfield wrote:
> > Hi Paul,
> >
> > Implementing the record of the animation path would be pretty straight
> > forward to implement, if only I clone myself without the RSI and we'd
> > have it already.  It'd be much appreciated if someone else can jump in
> > and implement a RecordCameraPathHandler :-)
>
> What would be the best way to do this? It looks like the file format is
> pretty straightforward... just attach an UpdateCallback to the camera in
> osgviewer and grab the world position and orientation every 1/25 of a
> second (I'm not entirely sure how Producer did it, so I'm sure there's
> probably a better way...) and dump this to a text file?
>

The AnimationPath class has a write method, so saving it's not a problem.

I'm not sure, but I think that Robert prefers to implement all Animation
handling inside a RecordEventHandler. If you press the key for saving,
then inside FRAME event you can catch the info that you need from the
sceneview camera of the active View. If you press again... then using
the write method of AnimationPath saves the path.

Another or the same Handler could be used to set an
AnimationPathManipulator with the last saved AnimationPath. But
I'm not sure if this was implemented on osgProducer.

Of course in osgviewer application should be interesting set a
param to take an animationpath from file.

What do you think Jeremy and Robert?

Rafa.


--
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia




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


Re: [osg-users] Recording an AnimationPath in osgviewer

2007-05-30 Thread Rafa Gaitan

Hi Jeremy,

On 5/30/07, Jeremy L. Moles <[EMAIL PROTECTED]> wrote:

On Wed, 2007-05-30 at 16:35 +0100, Robert Osfield wrote:
> Hi Paul,
>
> Implementing the record of the animation path would be pretty straight
> forward to implement, if only I clone myself without the RSI and we'd
> have it already.  It'd be much appreciated if someone else can jump in
> and implement a RecordCameraPathHandler :-)

What would be the best way to do this? It looks like the file format is
pretty straightforward... just attach an UpdateCallback to the camera in
osgviewer and grab the world position and orientation every 1/25 of a
second (I'm not entirely sure how Producer did it, so I'm sure there's
probably a better way...) and dump this to a text file?



The AnimationPath class has a write method, so saving it's not a problem.

I'm not sure, but I think that Robert prefers to implement all Animation
handling inside a RecordEventHandler. If you press the key for saving,
then inside FRAME event you can catch the info that you need from the
sceneview camera of the active View. If you press again... then using
the write method of AnimationPath saves the path.

Another or the same Handler could be used to set an
AnimationPathManipulator with the last saved AnimationPath. But
I'm not sure if this was implemented on osgProducer.

Of course in osgviewer application should be interesting set a
param to take an animationpath from file.

What do you think Jeremy and Robert?

Rafa.


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


Re: [osg-users] semi-OT: CMake & envars on win32?

2007-05-29 Thread Rafa Gaitan

Hi Mike,

If you want an automatic process the best is using
SET(VARIABLE VALUE) on CMakeLists.txt
then you can run cmake (not ccmake or CMakeSetup.exe) .

cmake tries to configure all without user interaction.

Rafa.


On 5/29/07, Mike Weiblen <[EMAIL PROTECTED]> wrote:

Hi, a question for Cmake experts:

I'm using cmake-2.4.6-win32-x86.exe on WinXP.

I'm trying to wrap CMakeSetup.exe with a .bat file that sets several
environment variables, and have those values override some default
configuration values; basically hardcode all my values and run
CMakeSetup.exe non-interactively.  See attached example.

I've seen docs refering to a "-D" switch, but no examples of its use,
plus I'm not clear if it only works w/ ccmake and not CMakeSetup.exe.

TIA
-- mew


Mike Weiblen -- Zebra Imaging -- Austin Texas USA --
http://www.zebraimaging.com/



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





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


Re: [osg-users] SimpleViewer with computeCoordinateSytemNodePath

2007-05-29 Thread Rafa Gaitan

On 5/29/07, Robert Osfield <[EMAIL PROTECTED]> wrote:


Hi Rafa,

On 5/29/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> My problem is that I'm merging Java and C++, And I also need
> keep integrated inside Swing! :S.. that's why I'm using a SimpleViewer
>  because JOGL provides a rendering Context to me.

Can you get the native windowing handle form the window?



Yes it is possible, but only on AWT components (native). On Swing components
Java draws all by itself and then the solution would be use pbuffers and
copy
the rendered image to Java. JOGL provide also a solution in this way but
breaks the state and OSG throws OpenGL errors on console and also doesn't
draw correctly.

In the old JavaOSG implementation they got the native peer of the awt
components and passed to osgProducer, I could do the same with
the osgViewer.


We could, but then where do we stop, next we'll want to add threading,

and multiple cameras


I am also wondering already if it SimpleViewer now is not so well

named, as for the users its often less simple to use, because it
doesn't have all the functionality you get from the more sophisticated
viewers, the only thing it simplifies these days is embedding in an
existing graphics context.   Perhaps we should rename it
EmbeddedViewer, and just let it become more complex as per the other
viewers.



You are right, Simple is simple! :D, Maybe I could have time and implement
the GraphicsWindowJava.. and by now keep using the SimpleViewer and add on
my side
those things.

Rafa.


Robert.

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





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

Re: [osg-users] SimpleViewer with computeCoordinateSytemNodePath

2007-05-29 Thread Rafa Gaitan

Hi Robert,

SimpleViewer inheriting from GraphicsWindow is a bit of temporary hack

that I plan to remove.

SimpleViewer is also... a simple viewer class, its meant for very
simply viewer needs.  Adding all the extra functionality that you get
in the Viewer and CompositeViewer you'll end up with... Viewer.. so
why not just use Viewer in the first place...



My problem is that I'm merging Java and C++, And I also need
keep integrated inside Swing! :S.. that's why I'm using a SimpleViewer
because JOGL provides a rendering Context to me.


The real difference with SimpleViewer is that it doesn't force you to

use a GraphicsWindow implememtation, so it can make it a bit quicker
to shoe horn into an existing graphics window.

However, if we can fill out the GrahicsWindow implementations/adpaters
then it should become easier to just go ahead an use
Viewer/CompositeViewer, and leave SimpleViewer for the really nieche
tasks.



I would like to implement a GraphicsWindowJava, but I don't have too much
time, and by now, jogl do the trick for me. Anyway adding a
computeCoordinateSystemNodePath on my side is not too complicated, I
was only suggesting adding this inside simpleviewer, because if It has a
DatabasePager
why not set the CoordinateSystemCallback on the active manipulator?

Thanks,
Rafa.



Robert.


On 5/29/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> I've realized that SimpleViewer doesn't have the logic for compute the
> coordinateSystemNodePath needed when you work with the whole earth.
>
> SimpleViewer inherits from osgViewer::GraphicsWindow, but most of the
> functionality
> that is implemented in SimpleViewer is done in osgViewer::View. Maybe
> inheriting from osgViewer::View and adapting the SimpleViewer we could
> use future improvements in osgViewer::View inside SimpleViewer.
>
>  What do you think?, It has sense?
>
> Rafa.
>
> --
> Rafael Gaitán Linares
> Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
> Ciudad Politécnica de la Innovación
> Universidad Politécnica de Valencia
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

[osg-users] SimpleViewer with computeCoordinateSytemNodePath

2007-05-29 Thread Rafa Gaitan

Hi Robert,

I've realized that SimpleViewer doesn't have the logic for compute the
coordinateSystemNodePath needed when you work with the whole earth.

SimpleViewer inherits from osgViewer::GraphicsWindow, but most of the
functionality
that is implemented in SimpleViewer is done in osgViewer::View. Maybe
inheriting from osgViewer::View and adapting the SimpleViewer we could
use future improvements in osgViewer::View inside SimpleViewer.

What do you think?, It has sense?

Rafa.

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

Re: [osg-users] Terrain vehicle problem

2007-05-22 Thread Rafa Gaitan

Hi,

As Robert said, you can use an intersection to get the normal of the terrain,
after that you can use an osg::Quat, to save the rotation above the
terrain of the
tank. I Put here a simplified example:

class Tank {
  osg::Quat rotation;
  osg::Vec3d position;
  osg::Vec3d getUp();
  osg::Vec3d getHeading();
  ... other stuff...
}

after you hit the terrain, you can calculate the rotation
of the tank doing:
 intersection stuff ...

osg::Vec3d up = tank->getUp();
osg::Vec3d normal = intersection.localIntersectionNormal;
osg::Quat rot;
rot.makeRotate(up, normal);
if(!rot.zeroRotation())
   tank->rotation*=rot;

 other actions 

so the last you need to know is how to get the UP of the tank
in every single step of calculation. The method I found was using
some useful helper math classes inside osg:

osg::Vec3d Tank::getUp() {
osg::Matrix mat;
mat.setRotate(this->rotation);
osg::Vec3d v(0,0,1);
osg::Vec3d up = osg::Matrix::transform3x3(v,mat);
up.normalize();
return up;
}

Using an osg::PositionAttitudeTransform, you can manage the
position of the tank, and the rotation of the tank.

Rafa.


On 5/22/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

You could intersect the terrain using
osgUtil::LineSegmentIntersection/IntersectionVisitor.  Use three/four
intersections or just pick out the normal of the polygon from one
intersection.

On 5/22/07, HEMANTH <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I want to simulate a vehicle on a terrain in OSG.but I am not able
> figure out how to simualte the pitch,yaw and roll of the vehicle according
> to the height of the terrain at a particular point.I mean the robot
> orientation should be changed according to the height of the terrain.
>
> Is there any way of doing this ?
>
> --
> *
> K.HEMANTH
> COMPUTER SCIENCE AND ENGINEERING(DUAL DEGREE)
> ROLL.NO# 200402017
> ROOM.NO# 399(OBH)
> CONTACT NO# 9849229262
> IIIT--HYDERABAD.
>
> EMAIL:
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> **
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/




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


Re: [osg-users] code to osg-submissions pls (WAS: User defined events)

2007-05-18 Thread Rafa Gaitan

Hi Mike,

Yes I know, and my previous mail was sent to osg-submission list too. But
maybe I did something wrong, It's my first submission! :D.

Rafa.


On 5/18/07, Mike Weiblen <[EMAIL PROTECTED]> wrote:


Hi all,

Please be sure to post all code contributions to the osg-submissions list,
not
here on osg-users.  Robert is a really busy guy, and code posted here may
get
lost in the message traffic.

thanks!
-- mew



Rafa Gaitan wrote:
> Hi Robert,
>
> I have finished the modifications of osgGA::EventQueue and
> osgGA::GUIEventAdapter that allows us to
> create user defined events. I've also made an example (with its
> CMakeLists file) that makes use of the
> new event type.
>
> Rafa.
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

Re: [osg-users] User defined events.

2007-05-18 Thread Rafa Gaitan

Hi Robert,

I'm currently working on it, if you want, when I finish it, I can submit to
you. I'm also doing an example of use to test it.

Rafa.


On 5/17/07, Mike Weiblen <[EMAIL PROTECTED]> wrote:


I like it.  I would use it to inject eg osgVRPN events into the event
stream.  Let us know how you get on.

Cheers
-- mew


Mike Weiblen -- Zebra Imaging -- Austin Texas USA --
http://www.zebraimaging.com/


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:osg-users-
> [EMAIL PROTECTED] On Behalf Of Rafa Gaitan
> Sent: Thursday, May 17, 2007 9:49 AM
> To: osg users
> Subject: [osg-users] User defined events.
>
> Hi Robert,
>
> I'm currently trying to add my own defined events. In fact I want to
> change
> the global state set using a User interface. Of course doing this in a
> safe way is
> doing the change inside the update traversal, or event traversal.
>
> Trying to do this in a generic way, I realized that GUIEventAdapter is
the
> same I was
> doing, but only for key and mouse fixed events. Maybe adding a
UserDefined
> event type
> like SDL does, could be really useful. We could take advantage of the
> EventVisitor and the default event
> management of OSG.
>
> The only changes would be add an USER_EVENT on EventType enum.
> Add a int _userEventId attribute (I think an int should be enough).
> And maybe add a userEvent(int eventId) method inside EventQueue class.
>
> What do you think?, Are there others that could find these useful?
>
> Greetz!
>
> --
> Rafael Gaitán Linares
> Instituto de Automática e Informática Industrial   http://www.ai2.upv.es
> <http://www.ai2.upv.es>
> Ciudad Politécnica de la Innovación
> Universidad Politécnica de Valencia
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

Re: [osg-users] User defined events.

2007-05-17 Thread Rafa Gaitan


I'm open to the addition of a USER_EVENT.  You should also be able
subclass from GUIEventAdapter as EventQueue does allow you to pass in
your own event objects.



Yes, that's what I have in mind. The idea should be create events to manage
for example
a click on a user interface button that calls a method who queues on osg
events my own
handler of state set.


GUIEventAdapter could probably be renamed simply Event now too, with a

typedef back to GUIEventAdapter.  Not sure if we'd see any namespace
polution issues affecting us though.



I was thinking about the possibility to create a base Event class and the
GUIEventAdapter class
could be a inherited class from Event, doing the job that currently does.
This implies a little
refactor inside osgGA, that's because I think a USER_DEFINED event inside
GUIEventAdapter class
could be enough. Anyway changing the name from GUIEventAdapter to Event is
right for me.


Rafa.

Robert.


On 5/17/07, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> I'm currently trying to add my own defined events. In fact I want to
change
> the global state set using a User interface. Of course doing this in a
safe
> way is
> doing the change inside the update traversal, or event traversal.
>
> Trying to do this in a generic way, I realized that GUIEventAdapter is
the
> same I was
> doing, but only for key and mouse fixed events. Maybe adding a
UserDefined
> event type
> like SDL does, could be really useful. We could take advantage of the
> EventVisitor and the default event
> management of OSG.
>
> The only changes would be add an USER_EVENT on EventType enum.
> Add a int _userEventId attribute (I think an int should be enough).
> And maybe add a userEvent(int eventId) method inside EventQueue class.
>
> What do you think?, Are there others that could find these useful?
>
> Greetz!
>
> --
> Rafael Gaitán Linares
> Instituto de Automática e Informática Industrial   http://www.ai2.upv.es
> Ciudad Politécnica de la Innovación
> Universidad Politécnica de Valencia
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/





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

[osg-users] User defined events.

2007-05-17 Thread Rafa Gaitan

Hi Robert,

I'm currently trying to add my own defined events. In fact I want to change
the global state set using a User interface. Of course doing this in a safe
way is
doing the change inside the update traversal, or event traversal.

Trying to do this in a generic way, I realized that GUIEventAdapter is the
same I was
doing, but only for key and mouse fixed events. Maybe adding a UserDefined
event type
like SDL does, could be really useful. We could take advantage of the
EventVisitor and the default event
management of OSG.

The only changes would be add an USER_EVENT on EventType enum.
Add a int _userEventId attribute (I think an int should be enough).
And maybe add a userEvent(int eventId) method inside EventQueue class.

What do you think?, Are there others that could find these useful?

Greetz!

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

Re: [osg-users] Changing image data

2007-05-15 Thread Rafa Gaitan

Hi Christian,

The best way to use osg::Image is using a osg::ref_ptr.

osg::ref_ptr m_pImage;

And you shouldn't delete m_pImage. ref_ptr and Referenced do the job for
you.

Rafa.



On 5/15/07, Martin Aumueller <[EMAIL PROTECTED]> wrote:


Hi Christian,

On Tuesday 15 May 2007, [EMAIL PROTECTED] wrote:
> Hi,
>
> I have a problem changing the data of an RGB to an RGBA image.
> The following code works fine until i end the programm. The the delete[]
> operator of the image crashes.
> What's wrong?
> Thanks for help!
>
> Christian
>
>
> class CTextureInfo
> {
> public:
>   osg::Image* m_pImage;

It should work better if you say m_pImage = new osg::Image; here.

Martin

>
> void MakeTranslucent() {
>   if(pixFrmt == GL_RGB) {
> int nWidth = m_pImage->s();
> int nHeight = m_pImage->t();
> int nDepth =  m_pImage->r();
> pDataRGBA = new BYTE [nWidth * nHeight * 4];
> pDataRGB = (BYTE*)m_pImage->data();
>
> // ... make translucent
>
> m_pImage->setImage(m_pImage->s(), m_pImage->t(), m_pImage->r(),
> GL_RGBA,
>  GL_RGBA, GL_UNSIGNED_BYTE, pDataRGBA,
> osg::Image::USE_NEW_DELETE);
>   }
> }
> }
>
> --
> Christian Hoffmann
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/


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





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

Re: [osg-users] OSG with the Eclipse platform

2007-05-09 Thread Rafa Gaitan

On 5/9/07, Felix Bwire <[EMAIL PROTECTED]> wrote:

Hi There,

I would like to request for your help on this. How can I develop a tool for
graph visualizaton that combines both OpenSceneGraph and the Eclipse
platform, or any other development platfrom.



Hi Felix,

On our project we have developed a Viewer using osg and jogl. (jogl
provides an openGL context creation for Java). Eclipse uses swt as
widgets platform, and swt provides a GLCanvas to create the rendering
context. Then you can create a SimpleViewer and connect it with Java
using JNI.

The main problem is the osg api, you should create any single class in
JNI or use the osgIntrospection API with JNI.

We are now in refactoring phase(another time :D) and I want to provide
a libjosgviewer implementation that uses SimpleViewer on Java.. and
some examples using AWT components and some examples using SWT
widgets. I hope this task will be finished in two weeks, and I would
like to open the code.

Also we are developing a JNI interface with osgIntrospection, this is
not the best way, but is a first step to use OSG api inside Java. I
hope this will be done in three or four weeks.

Anyway, if you make progress in this task, please tell us, becouse we
are really interested in merge Java, OSG and Eclipse platform.

There are also a project called JavaOSG but I think is working with
osg 1.0 and there is misscontinued.

Good luck in your task.


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


Re: [osg-users] osgText bug: strange edge artifacting

2007-05-09 Thread Rafa Gaitan

> It seems that the texture-image gets never initialized to a transparent
> background, on my testings I can see a lot of pixel-garbage in the
> unused areas of the texture.

Finally we seem to be getting to the bottom of it.  The initial texture
object was be allocated using 0, when tells OpenGL to allocated the the data
by not copy any data.  The init code look like this:

 glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA,
getTextureWidth(), getTextureHeight(), 0,
GL_ALPHA,
GL_UNSIGNED_BYTE,
0 );

What it looks like is that different drivers initialize the memory in
different ways, we lucked out with NVidia initializing to 0's.  I have now
changed the implementation so that is initializes the original blank glyph
texture to all 0's, the code now looks like:

unsigned int imageDataSize =
getTextureHeight()*getTextureWidth();
unsigned char* imageData = new unsigned char[imageDataSize];
for(unsigned int i=0; i

Hi Robert, I just test that issue and is working perfect on my imac.

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


Re: [osg-users] osg::text question: Background-rectangle for readability?

2007-04-09 Thread Rafa Gaitan


thanks a lot! This is even better than what I had in mind!

I use the text for a kind of tooltip, such I cannot predict over which
background it will appear. Now it stays perfectly readable.



Great!  ;)

The only thing I wonder about now: The text-outline is rendered much

better and clearer than the text itself...



Humm.. Are you using the built-in font?, It has lot of aliasing. If you
use a font (text->setFont("/Arial.ttf"), maybe the text will be  better.

Cheers,
Rafa.

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

Re: [osg-users] osg::text question: Background-rectangle for readability?

2007-04-09 Thread Rafa Gaitan

Hi Andreas,

maybe this could help you:

text->setBackDropType(osgText::Text::OUTLINE);
text->setBackDropColor(...);

You can also configure the width and height of the backdrop.. see API
reference for all the combinations.

Rafa.


On 4/9/07, Andreas Goebel <[EMAIL PROTECTED]> wrote:


Hi,

is there a simple way of drawing a background-rectangle to ensure
readability of the text? For instance a white rectangle behind a black
text to ensure, that the text stays readable if it is over a black object?

If not, I would draw it with a geometry that uses the bounding box of
the text, right?

Regards,

Andreas

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

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

Re: [osg-users] osgEphemeris with a globe?

2007-04-06 Thread Rafa Gaitan

Hi Glenn,

As far as I know, osgEphemeris is made to be seen inside. So with a terrain
globe doesn't give good results when you are outside the atmosphere.

You can see at the Magratea project. They have a really good looking effect
for the atmosphere.

Cheers,
Rafa.


On 4/6/07, Glenn Waldron <[EMAIL PROTECTED]> wrote:


Has anyone ever adapted or configured osgEphemeris to work with a
whole-earth model made with osgdem/VPB? Just thought I'd poll the giant
brain before going at the code Thanks! -gw

--
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791

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

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

Re: [osg-users] Terrain scene graph creation

2007-03-08 Thread Rafa Gaitan

Hi Licu,

On 3/8/07, LiCU A <[EMAIL PROTECTED]> wrote:


Hello, I'm writing an export plug-in for a terrain
modeling application. I've been browsing the OSG
documentation and examples in the last days but I
still have some uncertainties. First of, what's the
best way to construct the terrain scene graph? For now
I've been using osg::Geometry and Drawables to create
generic geometry surfaces to represent the terrain
zones. I've saw that there is also a osgTerrain but is
this only for terrain generation or can it be used to
keep and render the terrain data, too? To be noted
that the terrain is made of multiple zones with
multiple layers of textures and also LOD must be
implemented (and maybe some paging mechanism).



We have made something similar to your development, and
now we have a QuadTree based subdivision, and the Elevation
Tiles are created in a plugin as you. Currently we support layers using
multitexture but we have lots of problems with this method. Our
intentions are to change layers or deactivate layers, or elevation
or whatever needed by a GIS, while running and viewing our terrain (earth).

If you are planning to render one fixed set of layers, then
I recommend a multitexture approach, because is more efficient and
easy to manage it. If not, we are now thinking to develop a multipass
approach
because the big number of possibilities with changes in layers doesn't give
us
good visuals with terrain creation. (For example, If you don't have
elevations and you
make a big zoom to an area, then you add elevations and tiles grow one by
one, creating
holes meanwhile one has elevations and the neighbour not).

ossimPlanet is a project that uses first approach, but I think they don't
make
changes in layers when running.

And another question, if I am to represent the terrain

thru normal geometry how do I encode multiple layers
of textures (using multi-textures and multi-pass if
necessary)? How can I use the same osg::Geometry but
with different render states and textures?



About the geometry creation, inside osgTerrain, there is a piece of code
that make
the stuff, using an ellipsoid model (if the database is geocentric). We used
that code
to begin our geometry generation. osgTerrain is an impressive work you can
extract some
good ideas from there, and also from ossimPlanet.


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

Re: [osg-users] osgDB::DatabasePager ... Possible to not getfromosgDB::Registry???

2007-03-05 Thread Rafa Gaitan

Hi John,

I had the same problem with DatabasePager, Our problem was that we want
to create and destroy windows and also have more than one paged scenegraph.

I found a solution not passing throught osgDB::Registry but creating a
DatabasePager instance in each window. I know this is really dangerous
becouse
the amount of memory we consume, but is a solution.

If your app doesn't need to create multiple windows you can call some
release methods
in ScenView and DatabasePager, this is our resetGLObjects() method, that we
use when
some occurs with the GL Context.

void Viewer::resetGLObjects()
{
   for(EventHandlerList::iterator hitr = _eventHandlerList.begin();
   hitr != _eventHandlerList.end();
   ++hitr)
   {
   (*hitr)->releaseGLObjects(_sceneView->getState());
   }

   if (_databasePager.valid())
   {
   // clear the database pager so its starts a fresh on the
next update/cull/draw traversals
   _databasePager->clear();
   }

   // release the GL objects stored in the scene graph.
   _sceneView->releaseAllGLObjects();
   _sceneView->flushAllDeletedGLObjects();
   _sceneView->getState()->reset();
}

If you need to create more than one window, then you also need create a
different
contextID for each window viewer.
on version 1.2 was in that way..
unsigned int contextID = osg::GraphicsContext::createNewContextID();
but now.. is better to use osgViewer::SimpleViewer if you
need to integrate with third party windowing toolkit.

Hope this helps to you.
Rafa.





On 3/5/07, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote:


True enough my friend... I understand completely.
I'll find a way though. It'll just take a little time.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Monday, March 05, 2007 11:37 AM
To: osg users
Subject: Re: [osg-users] osgDB::DatabasePager ... Possible to not
getfromosgDB::Registry???

John,

For funky OSG usage like this you need to trawl through the achives and
gleen what you can, this type of usage is possible but well
outside normal OSG usage and what it was designed around.   I have RSI
so can't hand walk anyone though even simple stuff let alone well of the
beaten track stuff like this.

Robert.

On 3/5/07, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote:
> Robert,
>
> My osg app is nested in a DLL as a plugin. When I destroy the last
> instance of it, I can't do a complete cleanup? So that when I create a

> new one and load my .osga file it truly reloads? Can't I somehow
> delete the Registry or DatabasePager? This would really be a great
> help to me if you can think of a way to do it.
>
> Your pal,
> John
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Robert
> Osfield
> Sent: Monday, March 05, 2007 11:07 AM
> To: osg users
> Subject: Re: [osg-users] osgDB::DatabasePager ... Possible to not get
> fromosgDB::Registry???
>
> Hi John,
>
> I don't know enough about your app usage to really suggest very much,
> but typical problems one might encounter with open and closing windows

> is the scene graph holding handles to texture and display lists that
> are no longer valid because your removed the graphics context they are

> associated with.
>
> The new osgViewer library does allow you to create and destroy windows

> on the fly and it'll work to manage the context and display
> lists/texture objects for you so consider using it.
>
> Robert.
>
> On 3/5/07, Argentieri, John-P63223 <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Hi All.
> >
> > DatabasePager is giving me some trouble when I destroy a view and
> > then
>
> > create a new view. It seems that something is mixed up, possibly my
> > code. I am trying to allow all views to share graphics context, but
> > when I destroy the document (the parent of all views) and create
> > another, the databasepager won't reload my paged earth and I somehow

> > lose texture on the face that I was viewing in the first instance.
> > My question then is this: Can I create my own database pager without

> > paying heed to osgDB::Registry, or can I completely destroy the
> > osgDB::Registry's instance of database pager? As always, your
> > thoughts
> on this are greatly appreciated.
> >
> > Sincerely,
> > John Argentieri
> > ___
> > osg-users mailing list
> > osg-users@openscenegraph.net
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.opensce

Re: [osg-users] Problem with callbacks

2007-03-04 Thread Rafa Gaitan

Hi Peter,

There are two possible solutions.
The first one is to use a PositionAttitudeTransform(PAT) above the Sphere
geode, and set the callback to the PAT. The second one, is to call
dirtyDisplayList() method or set the use of display lists to false
(setUseDisplayList method) , but I don't recommend last one.

OSG compiles display lists by default for all drawables, that's the reason
becouse your Sphere remains unchaged.

Rafa.


On 3/4/07, Peter Steibert <[EMAIL PROTECTED]> wrote:


Hello,

At the moment I`m trying to modify a 3D-scene for each frame (Actually,
I want to start with a sphere that changes its center-coordinates or its
radius).

To achieve this goal I used the OSG-example "osgcallback" as a guide to
update the sphere. Here is a code snippet:

struct DrawableUpdateCallback : public osg::Drawable::UpdateCallback
{
float _angle;

virtual void update(osg::NodeVisitor*, osg::Drawable* drawable)
{
if (drawable->getName() == "Sphere")
{
osg::Sphere* sphereShape = (osg::Sphere*)
drawable->getShape();
_angle = _angle + 0.02;
float radius = abs(30*cos(_angle));
sphereShape->setRadius(radius);
}
}
};

The following problem occured: The sphere changes its radius only once
at the beginning of the running program, then the sphere stays unchanged
on the display although the radius definitely has varied. The same also
happens when I change the center-coordinates.

Any help would be welcome.

Thanks in advance,
  Peter


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

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

Re: [osg-users] Glimpse into future support for distortion correction

2007-02-22 Thread Rafa Gaitan

just change .cpp extension to .gif ;)

On 2/22/07, Anders Backman <[EMAIL PROTECTED]> wrote:


If that is your "image" of Umeå, I don't think you have seen Umeå from its
best side...
A CPP file :-)

I know we are coding quite a lot, but I would have expected some more
colors in your image of Umeå!!


Did you forget to attach an image?

/Anders

On 2/22/07, Robert Osfield <[EMAIL PROTECTED] > wrote:

> Hi All,
>
> One of the tasks bubbling along in the background is support for
> distortion correction in osgViewer.  osgViewer itself won't provide
> the support but will allow you to set up the required cameras and
> distortion meshes as custom scene graph elements.   This week I
> generalised a couple of components in osgViewer, SceneView and Camera
> to allow to work, ableit in app hardwired way.
>
> Eventually you'll be able to set this all up from a configuration file
> which will specify both the camera set up and the distortion
> correction mesh, then in any osgViewer::Viewer app you'll just need to
> load the configuration file and your app will be able to support novel
> displays without the need for extra distortion correction hardware, or
> coding from yourself.
>
> As a proof of concept the osgdistortion example now has an extra code
> path that creates 6 RTT Camera's to generate a cube environment map
> and one HUD camera for distorion correction all within a single
> osgViewer::Viewer.  The user of the viewer only sees the result of the
> last HUD camera, so it'll feel like you using one fancy camera rather
> than 7...
>
> What do the results look like?  See attached image of the town of Umea
> (thanks for VRLab for the model :-)
>
> The distortion correction here is for a mythical 360 degree projector
> at the center of dome, no such beast exists, but the code in
> osgdistortion is about proof of concept.  Proper math models for the
> distortion correction of real physical display configurations will
> follow, although not this week.
>
> Robert.
>
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>


--



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

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

Re: [osg-users] Names for Thread and Terrain classes

2007-02-21 Thread Rafa Gaitan

Hi Robert,

I vote for OpenPlanetBuilder or VirtualWorldBuilder, any of them likes to
me!

I'm not sure if this is the thread to talk about the desing or structures,
but in our
project we are making some development to work with different layers but all
the work is done on the fly,
maybe you could have these kind of uses on mind. ;)

Rafa

On 2/21/07, Adrian Egli <[EMAIL PROTECTED]> wrote:


hi robert,

i vote for names like: VirtualWorldBuilder, TerraBuilder

2007/2/21, Jean-Sebastien Guay <[EMAIL PROTECTED] >:
>
> Hello Robert,
>
> > (Open)TerrainBuilder?  (Open)PlanetBuilder?
>
> I would vote for one of these. Probably the second (with or without the
> "open"
> prefix) as it sparks the imagination more. Also, you avoid the religious
> implications of using the Genesis term, which might be good these days
> (even
> though I'm a fan of Star Trek myself and seeing that name gave me
> visions of
> what would be possible with such a tool! :-).
>
> J-S
> --
> __
> Jean-Sebastien Guay [EMAIL PROTECTED]
> http://whitestar02.webhop.org/
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


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

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

Re: [osg-users] multiple textures and one geometry

2007-02-13 Thread Rafa Gaitan

Hi Michael,

Maybe there is not a perfect solution for your request, but if I understand
your problem,
you can also use an osg::TexMat, to transform each texture stage.. so you
can assign
same texture coords to your geometry (or use osg::TexGen), and apply a
texture matrix
to fit the textures.. Of course you also need to play with TexEnv with
BLEND,
or TexEnvCombine for more complex interpolation as Paul says.

Rafa.



On 2/13/07, Michael Aulhorn <[EMAIL PROTECTED]> wrote:


Thanks, that helps a lot :)

I don't want to put each quad in its own Drawable, because the field
I want to generate will be much larger than 4x4. I want to limit the
vertices that'll be displayed and to many vertices slow down the program
where that piece of code will be implemented.

Michael.


Am Dienstag, den 13.02.2007, 12:31 -0700 schrieb Paul Martz:
> The problem is that you can't turn texturing on for one quad in a
Geometry
> and off for the others. Texturing has to be on for all quads. So it is
> difficult to answer your question because I don't know what you want to
have
> on the other quads.
>
> You can make it APPEAR that texturing is off for the other quads using
> CLAMP_TO_EDGE and setting the border of your texture appropriately.
>
> To do this, add a border to your texture -- maybe you want it white,
maybe
> you want it to have a zero alpha, I don't know. But whatever you choose
is
> what will be applied to the other quads. Then configure the OSG texture
wrap
> mode for CLAMP_TO_EDGE (both S and T). Set the texture coordinates for
the
> other vertices so that they are outside the range 0..1. For every
fragment
> with (s,t) outside the range 0..1, that fragment will get textured with
the
> border color.
>
> Assuming you want other textures on the other quads, use multitexturing
with
> a different texture unit for each texture. (Note that you're typically
> limited to four texture units on most hardware, so this will only work
for
> four textures.) Add a zero alpha border to all the textures, and you'll
need
> to set TexEnv to (I think) BLEND) to get a texture per quad.
>
> As I said in my previous post, you can save yourself a lot of headache
by
> just putting each quad in a separate Drawable with its own StateSet. :-)
>
> Hope this helps,
> Paul Martz
> Skew Matrix Software LLC
> http://www.skew-matrix.com
> 303 859 9466
>


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

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

Re: [osg-users] changing the node in viewer.setDataScene

2007-02-08 Thread Rafa Gaitan

Hi elekis

You can use an osg::Switch node on top of your two scenes:

osg::Switch *switchRoot = new osg::Switch()
... your nodes...

switchRoot->addChild(root);
switchRoot->addChild(root2);
switchRoot->setSingleChild(0);

...

When you want change to the root2 scene only do:

switchRoot->setSingleChild(1);

Hope this helps to you.

Remember that you only can change the scene only after sync() and before
frame() calls.

--
Rafa.



On 2/8/07, elekis <[EMAIL PROTECTED]> wrote:


hi all

I have a little probleme,

I have two node who represent two differents things,

and I would like to render one, and afer pushing a touch, changing on
other

something like that
//init
osg::Group* root = new osg::Group();
osg::Group* root2 = new osg::Group();
viewer.setSceneData( root );

// after a action
viewer.setSceneData( root2 );

// after a other action
viewer.setSceneData( root );

I trying that, but that doesn't work.  (root 2 is accepted but core dumped
just after)


is it possible to do that??

other thing
I dunno if it's normal but

http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/classosgProducer_1_1Viewer.html

there are no getSceneData or my viewer is a osg::Producer


thanks a+++




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

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

Re: [osg-users] scaling

2007-01-28 Thread Rafa Gaitan

try this:

PAT->getOrCreateStateSet()->setMode( GL_NORMALIZE, osg::StateAttribute::ON);

Rafa,


On 1/28/07, Qasim Mumtaz <[EMAIL PROTECTED]> wrote:


Hi. When I change the scale(PAT->setScale)  of loaded model(3ds,osg) the
amount of lighting decreases or increases with scale. Can I some how make it
so that it remains uniform even if I increase or decrease the scale. Any
help will be grateful.
Regards

--
Expecting? Get great news right away with email 
Auto-Check.
Try the Yahoo! Mail 
Beta.


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


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

Re: [osg-users] How would you like your stats served up?

2007-01-19 Thread Rafa Gaitan

Hi Robert,

We had thougth to adapt the osgProducer stats to our java viewer. Maybe
advanced stats
will be better, but by now, similar stats to osgProducer are enought for our
projects.

The most useful, It would be to make reusable stats, I mean, they could be
use
inside osgViewer::Viewer, but also inside SImpleViewer, so 3rd party gui
toolkits
will have also good stats ;).

--
Rafa.


On 1/18/07, Paul Martz <[EMAIL PROTECTED]> wrote:


I already documented the stats display in the OSG Quick Start Guide, so
I'd
prefer identical functionality to avoid having to rewrite it. I understand
OSG is a moving target; I'm just alerting you to a possibly avoidable
rework-induced delay. As engineers often say, "if it ain't broke, don't
fix
it."
   -Paul


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Robert Osfield
> Sent: Thursday, January 18, 2007 3:46 PM
> To: osg users
> Subject: [osg-users] How would you like your stats served up?
>
> Hi All,
>
> I was hoping to leave serious stats work for a week or two,
> but am finding that I need it myself for doing benchmarking
> and profiling of different shadow volume codes.  So tomorrow
> I'll spend some time putting a bit of a stats collecting
> framework together in both the core osg, and osgViewer.
> Timing Stats collection is just one thing though.
>
> The next issue is how do you present the results and there is
> huge scope for different ways of recording, presenting and
> using the timing stats.  The osgProducer::Viewer had one take
> on how to present the results, this needn't be the be all and
> end all - I'm open to suggestions on useful ways of reporting
> the results - both graphically and recording it.
>
> Timing stats are really about finding bottlenecks and this
> can be quite an involved process - the stats
> osgProducer::Viewer displayed were useful, but often not fine
> grained enough.  More fine grained reported isn't something
> you can do with a general purpose high level stats collection
> and reporting - its needs some means for extending the basics
> stats collection with your own extras and how to report these extras.
>
> I can image this getting quite complex so I thought I'd bend
> your ears for what schemes you've seen used before and found
> really effective.
>
> With that call for thoughts I'll turn in for the night :-)
>
> Robert.
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/

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

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

Re: [osg-users] What do you want from viewer functionality?

2007-01-05 Thread Rafa Gaitan

Hi Robert

 Is your app event driven or frame driven?


event driven

 Does your app have one scene graph, one view, one window?


yes

 Does your app have one scene graph, one view but multiple windows?


maybe in future

 Does your app have one scene graph, multiples views and one or more

windows?



maybe in future

 Does your app have multiple scene graphs, multiples views and one or

more windows?



no

 Do you open and close windows regularly in the life of your application?


yes

 Do you need to integrate the OSG viewer functionality into existing

windows?



no

 Do you need to integrate the OSG viewer functionality into 3rd party

windowing
  toolkits/applications(i.e. IE/Firefox)?



yes, in my case is Java (I'm using the JOGL context creation for that).
Inside JOGL you
can use GLCanvas (an awt component) and GLJPanel (a swing component), the
first is
intended to be used only in awt applications and the second for Swing
applicactions.
I'm saying that becouse using the GLJPanel component internally uses a
mechanism
to extract the render and put it on a swing surface (using pbuffers or
something compatible),
therefore the OpenGL states is changed and OSG shows a warning. I know that
is possible
to save the state after render, and restore it before calling rendering
process. A pair of methods
doing that for us, will be very appreciated, if not on any application that
we change the state after
osg rendering we should to replicate the code.

 Do you need support for distortion correction/compositing?


no

 Do you have availability of multiple/wish to use CPU cores?


yes

 Do you have availability of/wish to use multiple GPU?


no


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

Re: [osg-users] TerrainManipulator Question!

2006-12-20 Thread Rafa Gaitan

Hi Antoine,

Thanks a lot, I'll take a look in deep to that code!, maybe I can merge my
current solution with
your ideas!

Rafa.

On 12/20/06, Antoine Hue <[EMAIL PROTECTED]> wrote:


Rafa Gaitan wrote:
> Hi,
>
> I'm using the TerrainManipulator to see the Earth (or any planet)
> in our application, I'm trying to emulate the same movements of
> Google Earth or Nasa World Wind.
>
Hi,
you may have a look at this code I did for our project:

http://petitpoucet.svn.sourceforge.net/viewvc/petitpoucet/trunk/pti/src/pti/EarthManipulator.cpp?revision=174

Left button is rotating Earth without changing tilt nor heading. Right
is changing the later two.

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

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

Re: [osg-users] TerrainManipulator Question!

2006-12-18 Thread Rafa Gaitan

Hi Robert,

I'm doing that, and I have certain good results, but
there is some cases in which the earth rolls crazy!,
that's becouse I'm asking for some help in the specific maths.

I'm trying this:

inside clampOrientation, and when I'm doing roll, I'm trying
to reorient the rotation to have north on up. My Idea is
to calculate the "correct sideVector" (sideVectorC) as the cross product
of the lookVector and the northVector(0,0,1). Then I calculate the
angle between sideVectorPrima and sideVector and  finally I make a
rotation of this angle in the localUp Vector.

the code:

clampOrientation() {

.. same code inside function..
...
   osg::Vec3d sideVectorPrima = lookVector^northVector;
   sideVectorPrima.normalize();
   double angle =
acos(sideVector*sideVectorPrima/sideVector.length()*sideVectorPrima.length
());
   osg::notify(osg::NOTICE) << "angle:" << angle << std::endl;
   osg::notify(osg::NOTICE) << "sideVectorPrima:" <<
sideVectorPrima << std::endl;
   if(angle > osg::DegreesToRadians(0.1) &&
   (angle < osg::PI - osg::DegreesToRadians(0.1)))
   {
   osg::Quat rotate_azim;

   if(dx<0)
   angle = -angle;
   if(_center.z()>0)
   angle = -angle;

   rotate_azim.makeRotate(angle,localUp);
   if(!rotate_azim.zeroRotation()) {
   _rotation = _rotation * rotate_azim;
   }
   }
}

Hope guru maths can help me! ;)
Thanks!..
Rafa


On 12/18/06, Robert Osfield <[EMAIL PROTECTED]> wrote:


Hi Rafa,

Just implementation your own MatrixManipulator along the lines of the
TerrainManipulator, then you can set the behavior exactly how you
wish.

Robert.

On 12/18/06, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using the TerrainManipulator to see the Earth (or any planet)
> in our application, I'm trying to emulate the same movements of
> Google Earth or Nasa World Wind.
>
> The problem is when I try to keep the north on the up of my view.
> GIS user, usually work with the north always on the top of the view,
> and in 3D I must implement something similar. The current
> TerrainManipulator doesn't do it. I'm trying to fix it, but I'm little
> confused with maths to do it, Has anyone done something similar?
>
> Thanks.
> Rafa.
>
>
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

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

[osg-users] TerrainManipulator Question!

2006-12-18 Thread Rafa Gaitan

Hi,

I'm using the TerrainManipulator to see the Earth (or any planet)
in our application, I'm trying to emulate the same movements of
Google Earth or Nasa World Wind.

The problem is when I try to keep the north on the up of my view.
GIS user, usually work with the north always on the top of the view,
and in 3D I must implement something similar. The current
TerrainManipulator doesn't do it. I'm trying to fix it, but I'm little
confused with maths to do it, Has anyone done something similar?

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

Re: [osg-users] Small bug: Primitive set of a single GL_POINT not drawn

2006-12-05 Thread Rafa Gaitan

Hi Robert,

We have lots of vectorial data on earth, small feature culling is needed
in most cases, except for points. It is possible to disable small feature
culling for a node?, or we need to disable culling for a node?

Thanks,
Rafa.


On 12/4/06, Robert Osfield <[EMAIL PROTECTED]> wrote:


HI Rafa,

I don't know of any bugs with the bounding box computation, the
problem of this sort is basically down to small feature culling.
Expanding the bounding box is just a workaround this isn't required if
you simply switch off small feature culling.

Robert.

On 12/4/06, Rafa Gaitan <[EMAIL PROTECTED]> wrote:
> Hi Robert and Erik,
>
> On our developments we had the same problem, I'm not sure the
> problem was only the small feature culling, Maybe a problem with
> with the calculation of the bounding box for one point!, We solved the
> problem adding a BoundingBoxCallback, and calculating the bbox of the
> point bigger. Of course the small feature culling also  do the job if
you
> are
> too far from the point.
>
> Rafa,
>
>
>  On 12/4/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
> > Hi Erik,
> >
> > You are probably being tripped up by small feature culling that is on
> > by default in the OSG.  See the FAQ for details.
> >
> > Robert.
> >
> > On 12/4/06, Dekker, E. (Erik) den < [EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
> > > I think I ran into a bug when I tried to create a geometry
consisting of
> > > a single GL_POINT primitive. When I add the geometry to the scene
graph
> > > created with the following code:
> > >
> > >
> > >osg::Vec3Array* vertices = new osg::Vec3Array;
> > >vertices->push_back(osg::Vec3(0.0, 0.0, 0.0));
> > >vertices->push_back(osg::Vec3( 1.0, 0.0, 0.0));
> > >
> > >osg::Vec4Array* colors = new osg::Vec4Array;
> > >colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f,
> 1.0f));
> > >colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f,
> 1.0f));
> > >
> > >osg::Geometry* geom = new osg::Geometry;
> > >geom->setVertexArray(vertices);
> > >geom->setColorArray(colors);
> > >
> geom->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
> > >geom->addPrimitiveSet(new
> osg::DrawArrays(osg::DrawArrays::POINTS, 0,
> > > 1));// Add only 1 point
> > >
> > >
> > > The point won't shown up anywhere in my views, however when I change
the
> > > last line to:
> > >
> > >
> > >geom->addPrimitiveSet(new
> osg::DrawArrays(osg::DrawArrays::POINTS, 0,
> > > 2));// Add two points
> > >
> > >
> > > Both points are properly drawn in their respective colors. I tried
to
> > > track down the reasons for this in the guts of osg but got stuck on
my
> > > lack of experience with the internals,...
> > >
> > >
> > >
> > > Erik den Dekker
> > >
> > > This e-mail and its contents are subject to the DISCLAIMER at
> http://www.tno.nl/disclaimer/email.html
> > > ___
> > > osg-users mailing list
> > > osg-users@openscenegraph.net
> > > http://openscenegraph.net/mailman/listinfo/osg-users
> > > http://www.openscenegraph.org/
> > >
> > ___
> > osg-users mailing list
> > osg-users@openscenegraph.net
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
>
>
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

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

Re: [osg-users] Small bug: Primitive set of a single GL_POINT not drawn

2006-12-04 Thread Rafa Gaitan

Hi Robert and Erik,

On our developments we had the same problem, I'm not sure the
problem was only the small feature culling, Maybe a problem with
with the calculation of the bounding box for one point!, We solved the
problem adding a BoundingBoxCallback, and calculating the bbox of the
point bigger. Of course the small feature culling also  do the job if you
are
too far from the point.

Rafa,

On 12/4/06, Robert Osfield <[EMAIL PROTECTED]> wrote:


Hi Erik,

You are probably being tripped up by small feature culling that is on
by default in the OSG.  See the FAQ for details.

Robert.

On 12/4/06, Dekker, E. (Erik) den <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I think I ran into a bug when I tried to create a geometry consisting of
> a single GL_POINT primitive. When I add the geometry to the scene graph
> created with the following code:
>
>
>osg::Vec3Array* vertices = new osg::Vec3Array;
>vertices->push_back(osg::Vec3(0.0, 0.0, 0.0));
>vertices->push_back(osg::Vec3(1.0, 0.0, 0.0));
>
>osg::Vec4Array* colors = new osg::Vec4Array;
>colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
>colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
>
>osg::Geometry* geom = new osg::Geometry;
>geom->setVertexArray(vertices);
>geom->setColorArray(colors);
>geom->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
>geom->addPrimitiveSet(new osg::DrawArrays(osg::DrawArrays::POINTS, 0,
> 1));// Add only 1 point
>
>
> The point won't shown up anywhere in my views, however when I change the
> last line to:
>
>
>geom->addPrimitiveSet(new osg::DrawArrays(osg::DrawArrays::POINTS, 0,
> 2));// Add two points
>
>
> Both points are properly drawn in their respective colors. I tried to
> track down the reasons for this in the guts of osg but got stuck on my
> lack of experience with the internals,...
>
>
>
> Erik den Dekker
>
> This e-mail and its contents are subject to the DISCLAIMER at
http://www.tno.nl/disclaimer/email.html
> ___
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

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

Re: [osg-users] libOpenThreads EXCEPTION_ACCESS_VIOLATION !

2006-11-22 Thread Rafa Gaitan

Hi Bertrand,

I'm not sure if I can help, but I'm developping some libraries in C++ with
JNI wrappers
to Java. The way I debug on Windows is using the magical Attach to process
function in
Visual Studio project...

So you only should excute your Java application in debug (I use Eclipse and
I put a Breakpoint on
the System.loadLibrary(...) method) then open Visual Studio project,
Debug->Process, and select
the java process which is your process (do not select the java with the
eclipse process). and then
do the attach to process in native mode. Then you can continue excution on
java.. and whenever you
put a breakpoint on C++.. the VS should stop there. Obviously the dll must
be in debug! :D

I'm not sure what technology are you using to work on Java, but a year ago..
I was working with
JavaOSG bindings.. and I get the same error. Now I'm working with my own
bindings.. against
own libraries that do the hard job on OSG.

Hope this helps to you.

Rafa.



On 11/22/06, bertrand greslier <[EMAIL PROTECTED]> wrote:




On 11/22/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
>
> Hi Bertrand,
>
> On 11/22/06, bertrand greslier <[EMAIL PROTECTED]> wrote:
> > > The stack trace doesn't help too much without debug info of line
> > > numbers/files.  Could you reproduce this with a debug build?
> > It is possible to make debug build but on windows system it is very
> hard or
> > impossible to obtain line number on a java jvm crash of the
> navigator...
>
> Could you try and catch the expeption on the C++ side?


If a JNI (Java Native Interface) crash on a segfault, the jvm crash...and
genete a log stack trace
If there is a unhandled C++ exception, the jvm is closed but I catch all
C++ exception on each frame link this :

try {
cooki3d::BD * pBD = (cooki3d::BD*)bdId;
assertC2( BD::checkAdrBD( pBD), NULL  );
EnvironnementJava * ej =
  static_cast( pBD->getEnv());

if(ej){
  ej->appIdle();
}
  }
  catch(AssertException e){
CERRs("Java_jni_canvas_jogl_GearRenderer_display")
  << "Exception AssertException caught !! "
  <<  std::endl;
CERRnext < > > Some general notes,  are you using the OSG single threaded?  You can
>
> > > safely use OSG multi-threaded by there are rules you need to follow.
> >
> > I use the default OSG1.2, I think it is multi-threaded? I haven't care
> of
> > this until today.
> > Also I use SDL threads, mutex, semaphore for my application.
> > What I need to follow?
>
> The OSG doesn't automatically multi-threaded things apart for the
> DatabasePager, so if you arn't creating threads on top of the OSG and
> running different parts of it multi-threaded then the OSG will be
> single thread.
>
> In the case of osgProducer/Viewer/Producer based apps the
> multi-threading is done per camera, so if you have two cameras on two
> windows you can have several threads running, but if you have just one
> camera on one window it'll run single threaded.
>
> Could you explan a bit more about the way you use the OSG, how many
> camera etc.



In my case, the user has only one applet started, so there is only on
camera or OSG thread.


> > Are you using ref_ptr<> for the handles to the scene graph/sceneview?
> >
> > In some old codes I use directly ptr but I make manualy ref() and
> un_ref().
>
> Unless there is a very good reason why you can't use ref_ptr<> use it.
> There are some very rare instances where ref() and unref() are
> required but if you do use them you have to be very careful to make
> sure that they are matched in all branches of your code.
>
> ref_ptr<> is automatically safe in presence of exceptions too,
> something that ref/unref() can't be.
>
> > > Could you also give a bit more info on the types of machines
> > > everything works on and the types of machines where the problems
> > > occur.
> >
> > I know a user has WindowsXP and a Geforce3...
> > I haven't more informations.
>
> Ahh remote debugging ahhh.  I feel for your plight.
>
> I don't really have much to suggest right now.  Isolating where the
> problem is stemming from is essential.  It could be a memory error, so
> the cause and effect might be rather disjoint.
>
> Robert.



thank for your help, I will try to clean up.

--
Bertrand Greslier
http://www.cooki3d.org

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


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

Re: [osg-users] Fwd: Point setDistanceAttenuation method please explain

2006-11-22 Thread Rafa Gaitan

Hi Ivan,

As far as I know, the values you pass to the method must be used separately.
First
is to give a Constant distance attenuation, the second value is to give a
Linear distance
attenuation and the last to give a exponential distance attenuation.

you can try to use this for your purpose:

*pnt->setDistanceAttenuation( osg::Vec3( 0, 0.1, 0 ) );

*or try to play with linear values or with exponential values.. it depends
on your application.


Rafa.

   **
On 11/22/06, Robert Osfield <[EMAIL PROTECTED]> wrote


On 11/22/06, Ivan Bolčina <[EMAIL PROTECTED]> wrote:
> (It seems that previous email didn't reach destination... :-(

It did, it'll be just your mailer not highlighting your mail posts.  I
too suffer from time to time with gmail.

As for your question, the best reference of the distance attenuation
parameters is the OpenGL docs themselves.  The OSG just passes these
values through.

Robert.

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


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

Re: [osg-users] uploaded visualstudio project files for osgPython

2006-11-18 Thread Rafa Gaitan

Hi Vladimir,

Your are right, I have tested the example on linux and I appreciate the
same memory leak. I think, Miguel is working on it now.

Are you working on linux or windows?

On 11/17/06, Vladimir Shabanov <[EMAIL PROTECTED]> wrote:


Hi, Rafa,

I've downloaded osgPython, and it seems that there is a bug with
memory managemet. The simple helloworld.py example (which just builds
scene and runs viewer) has huge memory leak. After couple minutes of
run it eats about 200MB of memory and continues eating.

Is there is something I've done wrong or it has the same behaviour on
your machine?

I run it on 64-bit linux machine (AMD processor).

2006/11/11, Rafa Gaitan <[EMAIL PROTECTED]>:
> Hi all,
>
> I have uploaded the VisualStudio Project files to the svn repository of
> osgPython (http://mescriva.okode.com/svn/trunk).

actually at http://mescriva.okode.com/svn/osgPython/trunk/

> Hope this be usefull to all!.  Yes working in the same lab help us to
> solve problems. Congrats to my friends Jose and Miguel for their
excelent
> work. Jose if you want I can create VS project files too ;).
>
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

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

[osg-users] uploaded visualstudio project files for osgPython

2006-11-11 Thread Rafa Gaitan
Hi all, I have uploaded the VisualStudio Project files to the svn repository ofosgPython (http://mescriva.okode.com/svn/trunk). Hope this be usefull to all!.  Yes working in the same lab help us to
solve problems. Congrats to my friends Jose and Miguel for their excelentwork. Jose if you want I can create VS project files too ;).--Rafa.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Choosing correct PagedLOD child

2006-10-25 Thread Rafa Gaitan
Hi Robert, Alternatively it might be that a small tweak to the design ofDatabasePager & DatabaseRequestHandler would help avoid the need for
subclassing.  For instance using calbacks to override specific bits offunctionality rather than forcing subclassing is one way.I also consider DatabasePager something that is not cast in concrete,it works well for a range of usage styles, but I'm certainly open to
suggestions as to how it could be further improved.  Areas of interestto me are use of multiple database reading threads, the possibility ofmulti-threading texture/display list generation using shared graphics
context.I am however really busy right now, so can't get embroiled in any
complex topics as I simply don't have the bandwidth available.Don't worry about that!, I'm really busy too, and the releases of our code needs sometimes not make the best changes on the libraries, but when I have some
time I will try to suggest some of the work I was developing on here.Thanks!Rafa.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Choosing correct PagedLOD child

2006-10-24 Thread Rafa Gaitan
Hi, we have coded, some similar as you describe, we use as Robert said a Quad tree approach, and we generate inside a "fake readNode plugin" our geometry, and then we send a callback to notify that tiles are created and 
they need the data (this is done in that way becouse geospeatial data management is inside Java, and we need to generate textured and elevation tiles on demand, dependingof the layers loaded on Java application). 
That system works fine, becouse we cache textures in jpg or png formats and elevation data in geoTiff format. The main problems of the system are:- The system ask progressive for data (from less level to high level) and if data 
is not cached then the delay is elevated.- The other problem is when you are near to the planet, viewing the currentloaded layers and you add a new layer, which not have any cached tiles.For the last we have modified the DatabasePager to support the request for 
the layers of the tiles, in the same way as the PagedLOD asks for childs, the system asks for layers, and this not blocks viewing and the highest levelsare first processed.I'm not sure if is the better solution but works so fine for the most common
layer operations (add, remove, reorder, change opacity, enable/disable).Hope this helps to you...Robert, I have a question about subclassing DatabasePager.. I tried tosubclass Pager, to add this modifications, but some methods are not
virtual, and the other problem is that the DatabaseRequestHandler not havenew methods (obviously :D), but that implies to make a dynamic_cast insidetraverse of our TilePagedLOD, to do this new functionality. There is any 
way to modify osg Paging to extend the functionality and not repeating the same code? By now my solution has been to repeat the DatabasePAgercode, and modify it.Thanks, Rafa 
On 10/24/06, Jason Beverage <[EMAIL PROTECTED]> wrote:
Hi Chris,I'd be interested in taking a look at them just to see what happens.Thanks!Jason-Original Message-From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Chris HansonSent: Tuesday, October 24, 2006 3:40 PTo: osg usersSubject: Re: [osg-users] Choosing correct PagedLOD child
Robert Osfield wrote:> Hi Jason,> The PagedLOD node is designed to incrementally load level of detail> levels as not to leave null children and to avoid popping straight> from low level of detail to heigh level of detail.  Chris Hanson has
> done some custom work which circumvents this for his own app, but its> not something that is in the OpenSceneGraph core itself.   I'd be happy to share my mods with anyone who wants them, they are
precisely what youdescribe.> Personally I'd create a quad tree with the each PagedLOD only have two> children, the low level of detail which is always present, and the> external tile, this external tile would be a group contain four
> PagedLOD's.  You code could procedurally generate this without the> need for complex code to circumvent the way the core OSG works.> Quad trees are generally well suited to most databases anyway in terms
> of balancing culling and LOD management.   I've been considering this approach too.> Robert.--Chris 'Xenon' Hanson aka Eric Hammil | http://www.3DNature.com/
 eric atlogrus  "I set the wheels in motion, turn up all the machines, activate theprograms,   and run behind the scenes. I set the clouds in motion, turn up lightand sound,   activate the window, and watch the world go 'round." -Prime Mover,
Rush.___osg-users mailing listosg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/___osg-users mailing list
osg-users@openscenegraph.nethttp://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/

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

Re: [osg-users] Multiple PagedLOD scenes and one DatabasePager...

2006-09-03 Thread Rafa Gaitan
Hi again Robert,I was studying the problem, and before try to share the framestamp I was trying to use different DatabasePager for each instanced VIewer, but when I try to runthe application.. the same problems are shown (tiles disappearing.. and others..).
I was reading the code of DatabasePager.. and I think that instance the DatabasePager inside a Viewer without using Registry is possible, but maybe I'm completely confused about that..In other context trying to share the framestamp.. well maybe is a problem
becouse the application doesn't start each viewer at same time, The viewercan be created when user needs a new "View3D" of a GIS DataSet. I was thinking in the way to do that.. and when some Viewers are instanced.. one 
way to share framestamp is to call update, cull, draw for each Viewer consecutively, and maybe that could give slow framerates. So, is It possible to instance differente DatabasePager for each instanced Viewer?
or any suggestion on how to share the FrameStamp in this context?Thanks,Rafa.On 8/31/06, Robert Osfield <
[EMAIL PROTECTED]> wrote:Hi Rafa,You don't need to share contexts to support multiple graphics contexts, you just need to tell the DatabasePager about as below.  
As for an example, I've never implemented an app with what you are trying to do.  Others have though, and osgProducer::Viewer does allow for multiple cameras, and they needn't share lens or view matrices, so it should be possible to set up you usage too, my guess that it'd work just fine with this type of usage.
Robert.On 8/31/06, Rafa Gaitan <
[EMAIL PROTECTED]> wrote:
Thanks Robert,Reviewing the code to share the framestamp in all the instances of the viewer I have seen this..// tell the database pager which graphic context the compile of rendering objexts is needed.

databasePager->setCompileGLObjectsForContextID(itr->sceneView->getState()->getContextID(),true);this maybe give me some problems too, isn't it?.. I have seen that is possible to share the context.. and maybe 
is what I need.. How can I do it?.. There is any example???Thanks again...Rafa.
On 8/31/06, Robert Osfield <
[EMAIL PROTECTED]> wrote:Hi Rafa,You can make it work, but you need to be careful how you manage the FrameStamp of the different views, you need to make sure that you update both the views with the same frame number and time otherwise the DatabasePager will be confused by objects being requested as being older than they really are, something  that will cause it to discard them as being stale.
Robert.On 8/31/06, Rafa Gaitan <


[EMAIL PROTECTED]> wrote:



Hi,I have a problem in my application, I have two different Viewers, with two different sceneviews, which every one loads different PagedLOD scenes. The main problem is when the DatabasePager try to do the work.. I'm not sure what is really doing.. but some tiles 
disappear or are not shown correctly.The question is if is it possible to use the same DatabasePager in two different scenes at same time?.. in two different Viewers or more?. If not.. any ideas on how to afford the problem?
Thanks.Rafa.

___osg-users mailing list


osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users



http://www.openscenegraph.org/

___osg-users mailing listosg-users@openscenegraph.net

http://openscenegraph.net/mailman/listinfo/osg-users


http://www.openscenegraph.org/

___osg-users mailing listosg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users

http://www.openscenegraph.org/

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

Re: [osg-users] Multiple PagedLOD scenes and one DatabasePager...

2006-08-31 Thread Rafa Gaitan
Thanks Robert,Reviewing the code to share the framestamp in all the instances of the viewer I have seen this..// tell the database pager which graphic context the compile of rendering objexts is needed.
databasePager->setCompileGLObjectsForContextID(itr->sceneView->getState()->getContextID(),true);this maybe give me some problems too, isn't it?.. I have seen that is possible to share the context.. and maybe 
is what I need.. How can I do it?.. There is any example???Thanks again...Rafa.On 8/31/06, Robert Osfield <
[EMAIL PROTECTED]> wrote:Hi Rafa,You can make it work, but you need to be careful how you manage the FrameStamp of the different views, you need to make sure that you update both the views with the same frame number and time otherwise the DatabasePager will be confused by objects being requested as being older than they really are, something  that will cause it to discard them as being stale.
Robert.On 8/31/06, Rafa Gaitan <
[EMAIL PROTECTED]> wrote:

Hi,I have a problem in my application, I have two different Viewers, with two different sceneviews, which every one loads different PagedLOD scenes. The main problem is when the DatabasePager try to do the work.. I'm not sure what is really doing.. but some tiles 
disappear or are not shown correctly.The question is if is it possible to use the same DatabasePager in two different scenes at same time?.. in two different Viewers or more?. If not.. any ideas on how to afford the problem?
Thanks.Rafa.

___osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users

http://www.openscenegraph.org/

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

[osg-users] Multiple PagedLOD scenes and one DatabasePager...

2006-08-31 Thread Rafa Gaitan
Hi,I have a problem in my application, I have two different Viewers, with two different sceneviews, which every one loads different PagedLOD scenes. The main problem is when the DatabasePager try to do the work.. I'm not sure what is really doing.. but some tiles 
disappear or are not shown correctly.The question is if is it possible to use the same DatabasePager in two different scenes at same time?.. in two different Viewers or more?. If not.. any ideas on how to afford the problem?
Thanks.Rafa.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] Database pager

2006-07-21 Thread Rafa Gaitan
Maybe experts can help you better but as I know the DatabasePager is a Thread that collects all PagedLOD nodes in the scene graph.. unloading from memory when has expired his time. Also helps you to load nodes new PagedLOD nodes without stall rendering...
For example osgdem creates a PagedLOD dataset of terrain data, and osgviewer is able to load and unload from memory that nodes to navigate all the terrain even when the amount of data is more than main memory.
You can use in your application and your own viewer the database pager.. you can see an example of use in the osgsimplepager example. But the standard viewer of OSG.. enables a databasePager instance for manage PagedLOD datasets.
On 7/21/06, Mustafa <[EMAIL PROTECTED]> wrote:
Is there any detailed information about database pager?  what is thedifference of the OSG viewer with and without it? any referenceexplaining this concept welcome.BRSend instant messages to your online friends 
http://uk.messenger.yahoo.com___osg-users mailing listosg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/

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

[osg-users] Help with multitexturing!

2006-07-13 Thread Rafa Gaitan
Hi All,I'm trying to set a some textures on a surface using multitexturing:Stage 0 ( Texture Base ) using REPLACEStage 1 ( Texture with or without ALPHA ) using DECALStage 2 ( Texture with or without ALPHA ) using DECAL..
All works correctly using this configuration but now I need to set a certain level of opacity to the stages 1 or 2. I'm trying to use osg::TexEnv.. but with DECAL the setColor property is ignored and with BLEND mode works fine for colored pixels
but not for alpha pixels that makes transparent the geometry.. and I want to show the base texture...Basically I want to do something like:Stage 0 (Texture Base) using REPLACE (always visible except in parts where high stages does not have translucency)
Stage 1 (Textures with or without ALPHA and opacity 0.5) (on alpha 0 pixels is shown texture base on colored parts we blend to a opacity of 0.5)Stage 2 What modes can I use for do that? I'm not too much experimented with TexEnvCombine.. but I cannot set a color 
(with alpha) in this state attributte and I do not know how to use it correctly.  It is possible to do that with fixed functionality or maybe I need to use a shader?.If not is possible there is any easy way to set desired alpha to an image?
Any suggestion??? Maybe is easy.. but I'm not too much experimented in multitexturing... Thanks in advance.Rafa. 
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] PagedLOD and DatabasePager problems.

2006-06-20 Thread Rafa Gaitan
Thank you very much for all suggestions!!! the system now is working.. paging and gives very good results.Now I need to test the system with lots of geospatial layers.. ;)Thanks again.Rafa.
On 6/1/06, Serge Lages <[EMAIL PROTECTED]> wrote:
On 6/1/06, Rafa Gaitan <[EMAIL PROTECTED]> wrote:>>> >As Robert mentioned, OSG uses "loaders" to bring in files "from disk".
> Loaders are> > plugins, which you can write, which take a "filename" and deliver a scene> subgraph when> > finished. However, nothing says that the filename has to be a filesystem
> path, or that the> > data actually originates from a file on disk that is specified by that> path. In my case,> > the "filename" is a tile ID, encoded as a string. My plugin creates the
> data from both> > in-memory and on-disk resources, and delivers the resulting data to the> scene graph.> >> >When the scene graph is not using the tile data, PagedLOD discards the
> scene subgraph> > on its own, and when it is needed again, it calls the plugin to> load/create the data again.>>> Thanks!, thats a good idea. We will study it.!>>
> > > but by now I prefer to continue  the current development, because is not> > > clear to me in a unique generated earth mesh.. apply height fields and> > > texture tiles.> >
> >Sorry, I don't understand what you're asking there.>>> Well.. I begin with the view of the complete planet. ovPlanet is an> implementation of a multiresolution planetary rendering algorithm, with a
> continuous mesh. But by now the web page is not working! :(.>> Thanks again.> Rafa.>>To see a osg based planetary engine, look at my project :
http://www.magrathea-engine.orgAnd we generate on the fly procedural details for the terrain, allusing the osg database pager without any modification on it.As Chris says, we use a custom osgDB plugin wich use a encoded string
as filename to know what to generate.You can find the sources of our project on our site, so feel free totake a look on how we implement it. (There is also a demo version forwindows)--Serge Lages
http://www.magrathea-engine.org___osg-users mailing listosg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/

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

Re: [osg-users] PagedLOD and DatabasePager problems.

2006-06-01 Thread Rafa Gaitan
   As Robert mentioned, OSG uses "loaders" to bring in files "from disk". Loaders are
plugins, which you can write, which take a "filename" and deliver a scene subgraph whenfinished. However, nothing says that the filename has to be a filesystem path, or that thedata actually originates from a file on disk that is specified by that path. In my case,
the "filename" is a tile ID, encoded as a string. My plugin creates the data from bothin-memory and on-disk resources, and delivers the resulting data to the scene graph.   When the scene graph is not using the tile data, PagedLOD discards the scene subgraph
on its own, and when it is needed again, it calls the plugin to load/create the data again.Thanks!, thats a good idea. We will study it.! 
> but by now I prefer to continue  the current development, because is not> clear to me in a unique generated earth mesh.. apply height fields and> texture tiles.   Sorry, I don't understand what you're asking there.
Well.. I begin with the view of the complete planet. ovPlanet is an implementation of a multiresolution planetary rendering algorithm, with a continuous mesh. But by now the web page is not working! :(.
Thanks again.Rafa.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] PagedLOD and DatabasePager problems.

2006-05-31 Thread Rafa Gaitan
Well, we are not experimented in the use of DatabasePager... but I thought that could be necessary to have the PagedLOD files previously on disk. If we create tiles during navigation.. and textures could change in any moment, or even elevation maps.. then is not possible to have geometry tiles on disk, is more easy to have tiles in memory.. but unloading those less used, and regenerate the tile if is necessary view it. But if you have any other suggestion, I'm very open minded! :).
I'm also thinking to implement something similar to this:http://www.opengl.org/news/permalink/ovplanet_planetary_terrain_renderer_renders_high_detail_textures_using_the/
Sorry direct link is not working for me now :(but by now I prefer to continue  the current development, because is not clear to me in a unique generated earth mesh.. apply height fields and texture tiles.
Rafa.On 5/31/06, Chris Hanson <[EMAIL PROTECTED]> wrote:
Rafa Gaitan wrote:> Well, our own tiles.. are an extension of PagedLOD (TilePagedLOD), they> incorporates a tile identification inside... The idea is make all system> dynamic, to support variable layers and in general support GIS datasets.
> I know that PagedLOD.. and DatabasePager is not made to support this> architecture, and we are extending functionality to do it.> By now the system creates tiles on demand .. and requestTexture and
> HeightFields to a data acces layer. The problem is the continuous> increment of memory, and we want to use (or extend) the databasePager to> unload those tiles less used. If is necessary create those tiles
> again..it's ok.. we create and request data again. We have a disk cache> of texture and HF tiles, so it's quickly to reload it.> Any suggestion about the implementation of the DatabasePager?
   I do all this already, without having modified DatabasePager at all.   What part do you think DatabasePager is missing?> Thanks.> Rafa.--Chris 'Xenon' Hanson aka Eric Hammil | 
http://www.3DNature.com/ eric at logrus  "I set the wheels in motion, turn up all the machines, activate the programs,   and run behind the scenes. I set the clouds in motion, turn up light and sound,
   activate the window, and watch the world go 'round." -Prime Mover, Rush.___osg-users mailing listosg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/

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

Re: [osg-users] PagedLOD and DatabasePager problems.

2006-05-31 Thread Rafa Gaitan
Yes.. I think that implement our own paging system is the best solution by now. We will see the current DatabasePager for implementation ideas...Thanks a lot!..Rafa.On 5/31/06, 
Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi Rafa,Could the tile identifier not be encoded into the filename string?This is how I'd tackle it.If you really need a fully custom paging mechanism then why not justimplement your own.Robert.
On 5/31/06, Rafa Gaitan <[EMAIL PROTECTED]> wrote:> Well, our own tiles.. are an extension of PagedLOD (TilePagedLOD), they> incorporates a tile identification inside... The idea is make all system
> dynamic, to support variable layers and in general support GIS datasets. I> know that PagedLOD.. and DatabasePager is not made to support this> architecture, and we are extending functionality to do it.
>> By now the system creates tiles on demand .. and requestTexture and> HeightFields to a data acces layer. The problem is the continuous increment> of memory, and we want to use (or extend) the databasePager to unload those
> tiles less used. If is necessary create those tiles again..it's ok.. we> create and request data again. We have a disk cache of texture and HF tiles,> so it's quickly to reload it.>> Any suggestion about the implementation of the DatabasePager?
>> Thanks.> Rafa.>>> On 5/31/06, Robert Osfield < [EMAIL PROTECTED]> wrote:> >> On 5/31/06, Rafa Gaitan < 
[EMAIL PROTECTED]> wrote:> > Thanks a lot! Robert!> >> > it works! :D we have some minor problems.. but works fine for us.. Now we> > need to unload from memory those less used tiles.. is possible to extend
> > DataBasePager in order to do the work without use filenames for tiles?>> How would reference tiles without a filename to indentify it?>> BTW the filename is just a string, you can actually encode anything
> you want into this string and use a Pseudo loader to decode this> string into a tile reference.>> Robert.> ___> osg-users mailing list
>  osg-users@openscenegraph.net> http://openscenegraph.net/mailman/listinfo/osg-users> 
http://www.openscenegraph.org/>>> ___> osg-users mailing list> 
osg-users@openscenegraph.net> http://openscenegraph.net/mailman/listinfo/osg-users> http://www.openscenegraph.org/
>>___osg-users mailing listosg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] PagedLOD and DatabasePager problems.

2006-05-31 Thread Rafa Gaitan
Well, our own tiles.. are an extension of PagedLOD (TilePagedLOD), they incorporates a tile identification inside... The idea is make all system dynamic, to support variable layers and in general support GIS datasets. I know that PagedLOD.. and DatabasePager is not made to support this architecture, and we are extending functionality to do it.
By now the system creates tiles on demand .. and requestTexture and HeightFields to a data acces layer. The problem is the continuous increment of memory, and we want to use (or extend) the databasePager to unload those tiles less used. If is necessary create those tiles again..it's ok.. we create and request data again. We have a disk cache of texture and HF tiles, so it's quickly to reload it.
Any suggestion about the implementation of the DatabasePager?Thanks.Rafa.On 5/31/06, Robert Osfield <
[EMAIL PROTECTED]> wrote:On 5/31/06, Rafa Gaitan <
[EMAIL PROTECTED]> wrote:> Thanks a lot! Robert!>> it works! :D we have some minor problems.. but works fine for us.. Now we> need to unload from memory those less used tiles.. is possible to extend
> DataBasePager in order to do the work without use filenames for tiles?How would reference tiles without a filename to indentify it?BTW the filename is just a string, you can actually encode anything
you want into this string and use a Pseudo loader to decode thisstring into a tile reference.Robert.___osg-users mailing list
osg-users@openscenegraph.nethttp://openscenegraph.net/mailman/listinfo/osg-usershttp://www.openscenegraph.org/

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

Re: [osg-users] PagedLOD and DatabasePager problems.

2006-05-31 Thread Rafa Gaitan
Thanks a lot! Robert! it works! :D we have some minor problems.. but works fine for us.. Now we need to unload from memory those less used tiles.. is possible to extend DataBasePager in order to do the work without use filenames for tiles?
Thanks again.Rafa.On 5/26/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi Rafa,osgTerrain builds the database with a CluserCullingCallback attachedin appropriate places, its this which is culling the backfacingsubgraphs.  You just need to attach these to your terrain.
Robert.On 5/26/06, Rafa Gaitan <[EMAIL PROTECTED]> wrote:> Hi Rob,>>  We are experiencing some problems using PagedLOD nodes and the> DataBasePager. We want that our application unloads PagedLOD tiles from
> memory, but we are unable to do it! :S.>>  We are working in Java, using an own Viewer with java bindings. If we load> a pregenerated database with osgdem, the system works fine, and unload tiles
> without problems (we can see tiles on back side disappearing). The problem> is when we use our own dynamic generated tiles, the tiles on back side never>  disappear and are continously traversed, and if is necessary, the are
> expanded to generate childs.>>  We have made lots of tests. One is to write our generated database to disk> and comparing with osgdem generated database. The tiles are very similar but> we have realized that transform matrix, and centers are not exactly the
> same, but ranges are quite similar. Also we have tried to load our generated> database with osgviewer, and the result is the same, it doesn't unload> tiles!.>>  Well, we have a couple of questions..
>  - Where is determined that childs of a PagedLOD should be unloaded. (we> suppose that is in database pager... but we cannot find exactly how it does> the process).>>  - What value/s is used to determine that a child of a PagedLOD should be
> unloaded?. Maybe we can adjust our values in order to solve the problem..> but we have some weeks doing it and comparing with osgTerrain code and we> are unable to do it! .>>>  Thank you very much.
>  Rafa.>>> ___> osg-users mailing list> osg-users@openscenegraph.net> 
http://openscenegraph.net/mailman/listinfo/osg-users> http://www.openscenegraph.org/>>___osg-users mailing list
osg-users@openscenegraph.nethttp://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

[osg-users] PagedLOD and DatabasePager problems.

2006-05-26 Thread Rafa Gaitan
Hi Rob,

We are experiencing some problems using PagedLOD nodes and the
DataBasePager. We want that our application unloads PagedLOD tiles from
memory, but we are unable to do it! :S. 

We are working in Java, using an own Viewer with java bindings. If we
load a pregenerated database with osgdem, the system works fine, and
unload tiles without problems (we can see tiles on back side
disappearing). The problem is when we use our own dynamic generated
tiles, the tiles on back side never  disappear and are continously
traversed, and if is necessary, the are expanded to generate childs.

We have made lots of tests. One is to write our generated database to
disk and comparing with osgdem generated database. The tiles are very
similar but we have realized that transform matrix, and centers are not
exactly the same, but ranges are quite similar. Also we have tried to
load our generated database with osgviewer, and the result is the same,
it doesn't unload tiles!.

Well, we have a couple of questions..
- Where is determined that childs of a PagedLOD should be unloaded. (we
suppose that is in database pager... but we cannot find exactly how it
does the process).

- What value/s is used to determine that a child of a PagedLOD should
be unloaded?. Maybe we can adjust our values in order to solve the
problem.. but we have some weeks doing it and comparing with osgTerrain
code and we are unable to do it! .


Thank you very much.
Rafa.

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