Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Martin Großer
Ah OK, the render to texture idea is maybe a good alternative.

Do the RTT affect the performance?

My idea was a observer pattern. The camera settings are in a subject object and 
the osg::Camera is in the observer object. When the settings to be change the 
subject notify the observer (cameras with different viewports). But I think it 
is time consuming.

Do you think, the RTT is the better way?

Cheers

Martin


 Original-Nachricht 
> Datum: Fri, 29 Oct 2010 17:32:34 +1100
> Von: Ulrich Hertlein 
> An: OpenSceneGraph Users 
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Hi Martin,
> 
> On 29/10/10 17:17 , "Martin Großer" wrote:
> > I would like use two viewports in my application and one camera. Is this
> possible? I
> > think, the normal way is to define the viewport for a camera like:
> > camera->setViewport(...)
> 
> I can't say if it's possible, but if it is then I'd guess it renders the
> same scene twice.
> In this case it might be easier to render to a texture and just display
> the texture in two
> viewports.
> 
> /ulrich
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] rendering the large point data

2010-10-29 Thread J.P. Delport

Hi,

I've stumbled across this at a conference, it might be useful.

http://www.hpi.uni-potsdam.de/doellner/publications/year/2010/1086/RD10.html

jp

On 28/10/10 19:35, Vipin Panwar wrote:

Hi,

Xenon and Jordi, thanx for replying.
I am also going for spatial blocking using quad trees and display the block and 
its neighbors when zoom in the data. But I want to know whether there is more 
convenient method in OSG for these type of problems.

Thank you!

Cheers,
Vipin

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33203#33203





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



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


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


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


Re: [osg-users] VPB How to add geometry to an existing terrain

2010-10-29 Thread J.P. Delport

http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/PatchExisting

On 29/10/10 08:05, Alejandro Aguilar Sierra wrote:

Hello:

A year ago we built a terrain of Mexico using data from GTopo30 (30")
and SRTM (3") for the geometry and Bluemarble (15") and Landsat (near
1") for the texture. It took a complete weekend and 100GB IVE database
in a Dell Precision  T5400 with 8GB RAM and 1TB HD. Today we want to
refine the terrain with data for specific regions (1" from INEGI)
without rebuilding everything. After all we would not change the
existing data (levels 1 to 12), just add finer geometry creating upper
levels.

Is that possible with current VPB? How?

Thanks in advance.

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



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


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


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


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Martin Großer
I made a thumbnail sketch with the two concepts (see png). On the one hand 
(blue graph) I use three cameras with the diffrent viewport settings, on the 
other hand (yellow graph) I use one camera (ortho) and create geometry nodes 
(planes) and map the texture on this planes.

The main question is: what is the efficient way?

Cheers

Martin


 Original-Nachricht 
> Datum: Fri, 29 Oct 2010 09:00:40 +0200
> Von: "Martin Großer" 
> An: OpenSceneGraph Users 
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Ah OK, the render to texture idea is maybe a good alternative.
> 
> Do the RTT affect the performance?
> 
> My idea was a observer pattern. The camera settings are in a subject
> object and the osg::Camera is in the observer object. When the settings to be
> change the subject notify the observer (cameras with different viewports).
> But I think it is time consuming.
> 
> Do you think, the RTT is the better way?
> 
> Cheers
> 
> Martin
> 
> 
>  Original-Nachricht 
> > Datum: Fri, 29 Oct 2010 17:32:34 +1100
> > Von: Ulrich Hertlein 
> > An: OpenSceneGraph Users 
> > Betreff: Re: [osg-users] Two Viewports with one Camera
> 
> > Hi Martin,
> > 
> > On 29/10/10 17:17 , "Martin Großer" wrote:
> > > I would like use two viewports in my application and one camera. Is
> this
> > possible? I
> > > think, the normal way is to define the viewport for a camera like:
> > > camera->setViewport(...)
> > 
> > I can't say if it's possible, but if it is then I'd guess it renders the
> > same scene twice.
> > In this case it might be easier to render to a texture and just display
> > the texture in two
> > viewports.
> > 
> > /ulrich
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
> -- 
> GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit 
> gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
<>___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Disable the Mouse default event in osg

2010-10-29 Thread Lalit Manchwari
Hi,

... Thanks for reply..
If i comment the manipulator then data is not displaying. I m using code...


...
...
lasGeometry->setVertexArray( lasVertices);
lasGeometry->setColorArray(colors);
lasGeometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
lasGeometry->addPrimitiveSet(lasPrimitive);
root->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);

//viewer.setCameraManipulator(new osgGA::TrackballManipulator());

viewer.setSceneData( root );
viewer.addEventHandler(new osgViewer::StatsHandler);
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
viewer.realize();
while( !viewer.done() )
{
viewer.frame();
}   
...
.

And is there any osg functions that i can directly for rotate pan and zoom 
buttons.  

Thank you!

Cheers,
Lalit

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33221#33221





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


Re: [osg-users] FBX Up axis bug

2010-10-29 Thread Sukender
Hi Thomas,

As discussed earlier, readerwriters should, by default, not change anything 
about the orientation simply because there is no "standard" one. However, a 
readerwriter may provide options to read/write/modify this. As far as I know, 
the FBX format itself doesn't define its "own" orientation.

Hope this helps.

Cheers,

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

- "Thomas Hogarth"  a écrit :

> Hi all
> 
> 
> Just a little heads up for anyone using fbx plugin with fbx sdk
> 2011.2. I found a bug with the up axis. When exporting from 3ds max
> the axis are stored as
> 
> 
> x=0
> y=1
> z=2
> 
> 
> But for some reason the fbx sdk 2011.2 sets the eUpVector enum in
> kfbxaxissystem.h to the following
> 
> 
> 
> enum eUpVector {
> XAxis = 1,
> YAxis = 2,
> ZAxis = 3
> };
> 
> 
> changing this to
> 
> 
> 
> enum eUpVector {
> XAxis = 0,
> YAxis = 1,
> ZAxis = 2
> };
> 
> 
> fixed our problems
> 
> 
> Hope someone finds this useful
> Tom 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] New osgText library - Questions

2010-10-29 Thread Sukender
Thanks Robert. I'll have a look after regenerate/clean/make everything...

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

- "Robert Osfield"  a écrit :

> On Wed, Oct 27, 2010 at 1:21 PM, Sukender  wrote:
> > Alright then... but why didn't my app compile, then?
> 
> I can't answer this.
> 
> > Are there known regressions?
> 
> I don't know of any present regressions, if there are lets us know.
> 
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Disable the Mouse default event in osg

2010-10-29 Thread Ulrich Hertlein
On 29/10/10 18:30 , Lalit Manchwari wrote:
> ... Thanks for reply..
> If i comment the manipulator then data is not displaying. I m using code...

That's because your camera isn't positioned properly which means it's not 
actually looking
at the object.

You have to setup the camera view matrix accordingly to your requirements.

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


Re: [osg-users] Disable the Mouse default event in osg

2010-10-29 Thread Mourad Boufarguine
Hi Lalit,

If i comment the manipulator then data is not displaying.
>

When you don't use a camera manipulator, you should take care of the the
view matrix of the viewer.
You can use something like

viewer.getCamera()->setViewMatrixAsLookAt(eye, center, up);

For more information about this function, google gluLookAt.

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


Re: [osg-users] OpenThreads setProcessorAffinity / Multithreaded vertex array modification

2010-10-29 Thread Robert Osfield
Hi Johannes,

I'm very curious to what has gone amiss on your system.  What Linux
distro are you using?  Did you build the OpenThreads/OSG yourself?

Robert.

On Thu, Oct 28, 2010 at 7:31 PM, Johannes Scholz
 wrote:
> Hi,
>
> we are currently working on a routine that deforms large vertex arrays on the 
> fly. To speed this up we implemented multithreading using OpenThreads.
>
> Simple example:
>
> We have a point cloud of e.g. 10 million points. The calculation is done on 
> e.g. 4 processors.
> The first thread is assigned to processor 0 using setProcessorAffinity(0) and 
> works on the first 2.5 million points. On the second thread 
> setProcessorAffinity(1) is applied. The other points are equivalently handled 
> by processors 2 and 3. Performance scales by about 90% per doubled processor 
> count.
>
> This works fine on WINDOWS 32-Bit.
>
> When testing this on 64bit Linux we noticed that setProcessorAffinity returns 
> -1. Performance does not scale at all. All operations seem to be executed on 
> one CPU.
> I already learned that using pthreads on linux setProcessorAffinity won't 
> work at all? The operation system does not seem to automatically apply our 
> threads to different cpus.
>
> So what can you suggest to distribute our calculations to multiple cpus on 
> LINUX?
>
>
> Thank you!
>
> Cheers,
> Johannes
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=33205#33205
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Robert Osfield
Hi Martin,

I'm a bit confused by the thread, but as a general note you shouldn't
go attempting to use two separate Viewport per Camera.  The OSG fully
supports slave Camera that can share scene graphs and share the same
graphics context, so it's straight forward to implement and manage,
the osgViewer design has been specifically designed to make this type
of usage as simple as possible.

Robert.

2010/10/29 "Martin Großer" :
> Hello all,
>
> I would like use two viewports in my application and one camera. Is this 
> possible? I think, the normal way is to define the viewport for a camera 
> like: camera->setViewport(...)
>
> Is the only way to define camera, copy the camera and set the viewports 
> separatly for every camera? The main problem is when I change the camera 
> settings, I have to copy the camera again.
>
> Cheers
>
> Martin
> --
> GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
> gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Image cache and manually release

2010-10-29 Thread Patrice Defond
Hi,

I would like to release an image, but there is a cache whose keep my image in 
memory. Even if i put my ref_ptr to NULL, the image is always in 
memory.
Do you know how i can manually destruct my object but without desactivate Image 
Cache ?

Thank you!

Cheers,
Patrice

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33229#33229





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


Re: [osg-users] OpenThreads setProcessorAffinity / Multithreaded vertex array modification

2010-10-29 Thread Johannes Scholz
Hi Robert, hi Ulrich,

we are using Ubuntu 9.04 64-bit on AMD Opterons.

And yes, we built OSG by ourself. We are using OSG release 2.8.3.

We'll check cmake and come up with further details later.

Thanks so far.


Best Regards,

Johanens

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33230#33230





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


Re: [osg-users] Image cache and manually release

2010-10-29 Thread Sukender
Hi Patrice,

You could try things in osgDB::Registry

- use expiry time:
  addEntryToObjectCache(..., timestamp)
  removeExpiredObjectsInCache()

- Or remove all things in cache: clearObjectCache()

- Or replace the prvious one: addEntryToObjectCache(filename, [NULL or a dummy 
object]). Not sure "NULL" will work as expected here (to be tested).

Cheers,

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

- "Patrice Defond"  a écrit :

> Hi,
> 
> I would like to release an image, but there is a cache whose keep my
> image in memory. Even if i put my ref_ptr to NULL, the
> image is always in memory.
> Do you know how i can manually destruct my object but without
> desactivate Image Cache ?
> 
> Thank you!
> 
> Cheers,
> Patrice
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=33229#33229
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Martin Großer
Ok. I try the slave variant.

I have a additional question. When I use two different cameras and three 
viewports, how would you implement this. Two viewport have the first camera and 
the third viewport has the second camera.

My idea is something like this:

// Camera 1
osg::Camera* cam1 = new ...
slaveCam1->setViewport(...);

// Slave Camera 1
osg::Camera* slaveCam1 = new ...
slaveCam1->setViewport(...);

// Camera 2
osg::Camera* cam2 = new ...
cam2->setViewport(...);
cam2->addChild(scene);

// RootNode
// Camera two as a part of the scene graph. Is this clever?
osg::Group* root = new ...
root->addChild(scene);
root->addChild(cam2);

// Viewer
osg::Viewer* viewer = new ...
viewer->setSceneData(root);
viewer->setCamera(cam1);
viewer->addSlave(slaveCam1);


Is this the right way? And what is your commendation to use different camera 
manipulators. That means, what can I do when I want to use a manipulator for 
the second camera (the camera in the root node).

My idea is to write a GUIEventhandler. This should check the mouse position and 
give the viewport or the camera and then I calculate the new position like the 
trackball manipulator. That is the approximate idea.

Cheers

Martin


 Original-Nachricht 
> Datum: Fri, 29 Oct 2010 09:21:29 +0100
> Von: Robert Osfield 
> An: OpenSceneGraph Users 
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Hi Martin,
> 
> I'm a bit confused by the thread, but as a general note you shouldn't
> go attempting to use two separate Viewport per Camera.  The OSG fully
> supports slave Camera that can share scene graphs and share the same
> graphics context, so it's straight forward to implement and manage,
> the osgViewer design has been specifically designed to make this type
> of usage as simple as possible.
> 
> Robert.
> 
> 2010/10/29 "Martin Großer" :
> > Hello all,
> >
> > I would like use two viewports in my application and one camera. Is this
> possible? I think, the normal way is to define the viewport for a camera
> like: camera->setViewport(...)
> >
> > Is the only way to define camera, copy the camera and set the viewports
> separatly for every camera? The main problem is when I change the camera
> settings, I have to copy the camera again.
> >
> > Cheers
> >
> > Martin
> > --
> > GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
> > gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread J.P. Delport

Hi,

On 29/10/10 10:48, "Martin Großer" wrote:

Ok. I try the slave variant.

I have a additional question. When I use two different cameras and
three viewports, how would you implement this. Two viewport have the
first camera and the third viewport has the second camera.

My idea is something like this:

// Camera 1 osg::Camera* cam1 = new ... slaveCam1->setViewport(...);

// Slave Camera 1 osg::Camera* slaveCam1 = new ...
slaveCam1->setViewport(...);

// Camera 2 osg::Camera* cam2 = new ... cam2->setViewport(...);
cam2->addChild(scene);

// RootNode // Camera two as a part of the scene graph. Is this
clever? osg::Group* root = new ... root->addChild(scene);
root->addChild(cam2);

// Viewer osg::Viewer* viewer = new ... viewer->setSceneData(root);
viewer->setCamera(cam1); viewer->addSlave(slaveCam1);


Is this the right way? And what is your commendation to use different
camera manipulators. That means, what can I do when I want to use a
manipulator for the second camera (the camera in the root node).

My idea is to write a GUIEventhandler. This should check the mouse
position and give the viewport or the camera and then I calculate the
new position like the trackball manipulator. That is the approximate
idea.


Do you want something different from what happens if you run 
"osgcompositeviewer cow.osg". There, each view can have its own manipulator.


jp



Cheers

Martin


 Original-Nachricht 

Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert
Osfield An: OpenSceneGraph
Users Betreff: Re: [osg-users]
Two Viewports with one Camera



Hi Martin,

I'm a bit confused by the thread, but as a general note you
shouldn't go attempting to use two separate Viewport per Camera.
The OSG fully supports slave Camera that can share scene graphs and
share the same graphics context, so it's straight forward to
implement and manage, the osgViewer design has been specifically
designed to make this type of usage as simple as possible.

Robert.

2010/10/29 "Martin Großer":

Hello all,

I would like use two viewports in my application and one camera.
Is this

possible? I think, the normal way is to define the viewport for a
camera like: camera->setViewport(...)


Is the only way to define camera, copy the camera and set the
viewports

separatly for every camera? The main problem is when I change the
camera settings, I have to copy the camera again.


Cheers

Martin -- GMX DSL Doppel-Flat ab 19,99€/mtl.! Jetzt auch
mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
___ osg-users mailing
list osg-users@lists.openscenegraph.org


http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






___

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




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


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


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


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Martin Großer
Hello,

the problem is that I want to use a embedded viewer (gtk), too. I guess it 
doesn't work with the composite viewer. Or is it possible?

Cheers

Martin


 Original-Nachricht 
> Datum: Fri, 29 Oct 2010 10:58:10 +0200
> Von: "J.P. Delport" 
> An: OpenSceneGraph Users 
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Hi,
> 
> On 29/10/10 10:48, "Martin Großer" wrote:
> > Ok. I try the slave variant.
> >
> > I have a additional question. When I use two different cameras and
> > three viewports, how would you implement this. Two viewport have the
> > first camera and the third viewport has the second camera.
> >
> > My idea is something like this:
> >
> > // Camera 1 osg::Camera* cam1 = new ... slaveCam1->setViewport(...);
> >
> > // Slave Camera 1 osg::Camera* slaveCam1 = new ...
> > slaveCam1->setViewport(...);
> >
> > // Camera 2 osg::Camera* cam2 = new ... cam2->setViewport(...);
> > cam2->addChild(scene);
> >
> > // RootNode // Camera two as a part of the scene graph. Is this
> > clever? osg::Group* root = new ... root->addChild(scene);
> > root->addChild(cam2);
> >
> > // Viewer osg::Viewer* viewer = new ... viewer->setSceneData(root);
> > viewer->setCamera(cam1); viewer->addSlave(slaveCam1);
> >
> >
> > Is this the right way? And what is your commendation to use different
> > camera manipulators. That means, what can I do when I want to use a
> > manipulator for the second camera (the camera in the root node).
> >
> > My idea is to write a GUIEventhandler. This should check the mouse
> > position and give the viewport or the camera and then I calculate the
> > new position like the trackball manipulator. That is the approximate
> > idea.
> 
> Do you want something different from what happens if you run 
> "osgcompositeviewer cow.osg". There, each view can have its own
> manipulator.
> 
> jp
> 
> >
> > Cheers
> >
> > Martin
> >
> >
> >  Original-Nachricht 
> >> Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert
> >> Osfield An: OpenSceneGraph
> >> Users Betreff: Re: [osg-users]
> >> Two Viewports with one Camera
> >
> >> Hi Martin,
> >>
> >> I'm a bit confused by the thread, but as a general note you
> >> shouldn't go attempting to use two separate Viewport per Camera.
> >> The OSG fully supports slave Camera that can share scene graphs and
> >> share the same graphics context, so it's straight forward to
> >> implement and manage, the osgViewer design has been specifically
> >> designed to make this type of usage as simple as possible.
> >>
> >> Robert.
> >>
> >> 2010/10/29 "Martin Großer":
> >>> Hello all,
> >>>
> >>> I would like use two viewports in my application and one camera.
> >>> Is this
> >> possible? I think, the normal way is to define the viewport for a
> >> camera like: camera->setViewport(...)
> >>>
> >>> Is the only way to define camera, copy the camera and set the
> >>> viewports
> >> separatly for every camera? The main problem is when I change the
> >> camera settings, I have to copy the camera again.
> >>>
> >>> Cheers
> >>>
> >>> Martin -- GMX DSL Doppel-Flat ab 19,99€/mtl.! Jetzt auch
> >>> mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
> >>> ___ osg-users mailing
> >>> list osg-users@lists.openscenegraph.org
> >>>
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >>>
> >>
> >>
> ___
> >> osg-users mailing list osg-users@lists.openscenegraph.org
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> 
> -- 
> This message is subject to the CSIR's copyright terms and conditions,
> e-mail legal notice, and implemented Open Document Format (ODF) standard. 
> The full disclaimer details can be found at
> http://www.csir.co.za/disclaimer.html.
> 
> This message has been scanned for viruses and dangerous content by
> MailScanner, 
> and is believed to be clean.  MailScanner thanks Transtec Computers for
> their support.
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread J.P. Delport

Hi,

On 29/10/10 11:02, "Martin Großer" wrote:

Hello,

the problem is that I want to use a embedded viewer (gtk), too. I
guess it doesn't work with the composite viewer. Or is it possible?


sorry, I'm not sure.

jp



Cheers

Martin


 Original-Nachricht 

Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: "J.P.
Delport" An: OpenSceneGraph
Users Betreff: Re: [osg-users]
Two Viewports with one Camera



Hi,

On 29/10/10 10:48, "Martin Großer" wrote:

Ok. I try the slave variant.

I have a additional question. When I use two different cameras
and three viewports, how would you implement this. Two viewport
have the first camera and the third viewport has the second
camera.

My idea is something like this:

// Camera 1 osg::Camera* cam1 = new ...
slaveCam1->setViewport(...);

// Slave Camera 1 osg::Camera* slaveCam1 = new ...
slaveCam1->setViewport(...);

// Camera 2 osg::Camera* cam2 = new ... cam2->setViewport(...);
cam2->addChild(scene);

// RootNode // Camera two as a part of the scene graph. Is this
clever? osg::Group* root = new ... root->addChild(scene);
root->addChild(cam2);

// Viewer osg::Viewer* viewer = new ...
viewer->setSceneData(root); viewer->setCamera(cam1);
viewer->addSlave(slaveCam1);


Is this the right way? And what is your commendation to use
different camera manipulators. That means, what can I do when I
want to use a manipulator for the second camera (the camera in
the root node).

My idea is to write a GUIEventhandler. This should check the
mouse position and give the viewport or the camera and then I
calculate the new position like the trackball manipulator. That
is the approximate idea.


Do you want something different from what happens if you run
"osgcompositeviewer cow.osg". There, each view can have its own
manipulator.

jp



Cheers

Martin


 Original-Nachricht 

Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert
Osfield  An: OpenSceneGraph
Users  Betreff: Re:
[osg-users] Two Viewports with one Camera



Hi Martin,

I'm a bit confused by the thread, but as a general note you
shouldn't go attempting to use two separate Viewport per
Camera. The OSG fully supports slave Camera that can share
scene graphs and share the same graphics context, so it's
straight forward to implement and manage, the osgViewer design
has been specifically designed to make this type of usage as
simple as possible.

Robert.

2010/10/29 "Martin Großer":

Hello all,

I would like use two viewports in my application and one
camera. Is this

possible? I think, the normal way is to define the viewport for
a camera like: camera->setViewport(...)


Is the only way to define camera, copy the camera and set
the viewports

separatly for every camera? The main problem is when I change
the camera settings, I have to copy the camera again.


Cheers

Martin -- GMX DSL Doppel-Flat ab 19,99€/mtl.! Jetzt
auch mit gratis Notebook-Flat!
http://portal.gmx.net/de/go/dsl
___ osg-users
mailing list osg-users@lists.openscenegraph.org




http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org









___

osg-users mailing list osg-users@lists.openscenegraph.org


http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org







--

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

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

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




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


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


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


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Martin Großer
Hello,

OK, for the completeness of my problem. I want to use two different viewer. An 
normal OSGViewer and a GTKViewer. The common denominator is the osg::Viewer 
class. I want to use one or more viewports and one or more cameras. And every 
camera can show different scenes. The cameras should have a manipulator like 
trackball manipulator. I guess the problem is not so trivial.

I try to do this:

- First camera is the "master" camera (set camera and scene data in viewer)
  viewer->setCamera(cam_1);
  root->addChild(scene_1);
  viewer->setSceneData(root);

- next camera set in the scene graph and the scene is a child of the camera
  cam_2->addChild(scene_2);
  root->addChild(cam_2);

- and so on for more cameras with a scene

- now I set the viewports
  cam_1->viewport(...);
  cam_2->viewport(...);

- it works fine, but now I want to add a third viewport with the first camera, 
too
  cam_1->addChild(scene_1);
  root->addChild(cam_1);
  cam_1->setviewport(...);

- it is unsurprising that doesn't work

That is my actual state of affairs.

Cheers

Martin

 Original-Nachricht 
> Datum: Fri, 29 Oct 2010 11:14:56 +0200
> Von: "J.P. Delport" 
> An: OpenSceneGraph Users 
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Hi,
> 
> On 29/10/10 11:02, "Martin Großer" wrote:
> > Hello,
> >
> > the problem is that I want to use a embedded viewer (gtk), too. I
> > guess it doesn't work with the composite viewer. Or is it possible?
> 
> sorry, I'm not sure.
> 
> jp
> 
> >
> > Cheers
> >
> > Martin
> >
> >
> >  Original-Nachricht 
> >> Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: "J.P.
> >> Delport" An: OpenSceneGraph
> >> Users Betreff: Re: [osg-users]
> >> Two Viewports with one Camera
> >
> >> Hi,
> >>
> >> On 29/10/10 10:48, "Martin Großer" wrote:
> >>> Ok. I try the slave variant.
> >>>
> >>> I have a additional question. When I use two different cameras
> >>> and three viewports, how would you implement this. Two viewport
> >>> have the first camera and the third viewport has the second
> >>> camera.
> >>>
> >>> My idea is something like this:
> >>>
> >>> // Camera 1 osg::Camera* cam1 = new ...
> >>> slaveCam1->setViewport(...);
> >>>
> >>> // Slave Camera 1 osg::Camera* slaveCam1 = new ...
> >>> slaveCam1->setViewport(...);
> >>>
> >>> // Camera 2 osg::Camera* cam2 = new ... cam2->setViewport(...);
> >>> cam2->addChild(scene);
> >>>
> >>> // RootNode // Camera two as a part of the scene graph. Is this
> >>> clever? osg::Group* root = new ... root->addChild(scene);
> >>> root->addChild(cam2);
> >>>
> >>> // Viewer osg::Viewer* viewer = new ...
> >>> viewer->setSceneData(root); viewer->setCamera(cam1);
> >>> viewer->addSlave(slaveCam1);
> >>>
> >>>
> >>> Is this the right way? And what is your commendation to use
> >>> different camera manipulators. That means, what can I do when I
> >>> want to use a manipulator for the second camera (the camera in
> >>> the root node).
> >>>
> >>> My idea is to write a GUIEventhandler. This should check the
> >>> mouse position and give the viewport or the camera and then I
> >>> calculate the new position like the trackball manipulator. That
> >>> is the approximate idea.
> >>
> >> Do you want something different from what happens if you run
> >> "osgcompositeviewer cow.osg". There, each view can have its own
> >> manipulator.
> >>
> >> jp
> >>
> >>>
> >>> Cheers
> >>>
> >>> Martin
> >>>
> >>>
> >>>  Original-Nachricht 
>  Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert
>  Osfield  An: OpenSceneGraph
>  Users  Betreff: Re:
>  [osg-users] Two Viewports with one Camera
> >>>
>  Hi Martin,
> 
>  I'm a bit confused by the thread, but as a general note you
>  shouldn't go attempting to use two separate Viewport per
>  Camera. The OSG fully supports slave Camera that can share
>  scene graphs and share the same graphics context, so it's
>  straight forward to implement and manage, the osgViewer design
>  has been specifically designed to make this type of usage as
>  simple as possible.
> 
>  Robert.
> 
>  2010/10/29 "Martin Großer":
> > Hello all,
> >
> > I would like use two viewports in my application and one
> > camera. Is this
>  possible? I think, the normal way is to define the viewport for
>  a camera like: camera->setViewport(...)
> >
> > Is the only way to define camera, copy the camera and set
> > the viewports
>  separatly for every camera? The main problem is when I change
>  the camera settings, I have to copy the camera again.
> >
> > Cheers
> >
> > Martin -- GMX DSL Doppel-Flat ab 19,99€/mtl.! Jetzt
> > auch mit gratis Notebook-Flat!
> > http://portal.gmx.net/de/go/dsl
> > ___ osg-users
> > mailing list osg-users@lists.openscenegraph.org
> >
> 
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegra

Re: [osg-users] Image cache and manually release

2010-10-29 Thread Patrice Defond
Thank for your help Sukender.

I can't use the methods removeExpiredObjectsInCache and clearObjectCache 
because the rest of my application need the cache. 

It is very specific for a module : it loads big images.

So i test addEntryToObjectCache.
- With NULL in object : OSG make an error ("Error file does not contain an 
osg::Object")
- if i call the function with a timestamp to 0 or 0.001 ... but my object is 
not release. 


Do you have more ideas ?

Cheers,
Patrice

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33237#33237





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


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Martin Großer
I try this concept, now. (see png) I'm not sure, but I guess it is a elegant 
solution.

Cheers

Martin


 Original-Nachricht 
> Datum: Fri, 29 Oct 2010 11:35:04 +0200
> Von: "Martin Großer" 
> An: OpenSceneGraph Users 
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Hello,
> 
> OK, for the completeness of my problem. I want to use two different
> viewer. An normal OSGViewer and a GTKViewer. The common denominator is the
> osg::Viewer class. I want to use one or more viewports and one or more 
> cameras.
> And every camera can show different scenes. The cameras should have a
> manipulator like trackball manipulator. I guess the problem is not so trivial.
> 
> I try to do this:
> 
> - First camera is the "master" camera (set camera and scene data in
> viewer)
>   viewer->setCamera(cam_1);
>   root->addChild(scene_1);
>   viewer->setSceneData(root);
> 
> - next camera set in the scene graph and the scene is a child of the
> camera
>   cam_2->addChild(scene_2);
>   root->addChild(cam_2);
> 
> - and so on for more cameras with a scene
> 
> - now I set the viewports
>   cam_1->viewport(...);
>   cam_2->viewport(...);
> 
> - it works fine, but now I want to add a third viewport with the first
> camera, too
>   cam_1->addChild(scene_1);
>   root->addChild(cam_1);
>   cam_1->setviewport(...);
> 
> - it is unsurprising that doesn't work
> 
> That is my actual state of affairs.
> 
> Cheers
> 
> Martin
> 
>  Original-Nachricht 
> > Datum: Fri, 29 Oct 2010 11:14:56 +0200
> > Von: "J.P. Delport" 
> > An: OpenSceneGraph Users 
> > Betreff: Re: [osg-users] Two Viewports with one Camera
> 
> > Hi,
> > 
> > On 29/10/10 11:02, "Martin Großer" wrote:
> > > Hello,
> > >
> > > the problem is that I want to use a embedded viewer (gtk), too. I
> > > guess it doesn't work with the composite viewer. Or is it possible?
> > 
> > sorry, I'm not sure.
> > 
> > jp
> > 
> > >
> > > Cheers
> > >
> > > Martin
> > >
> > >
> > >  Original-Nachricht 
> > >> Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: "J.P.
> > >> Delport" An: OpenSceneGraph
> > >> Users Betreff: Re: [osg-users]
> > >> Two Viewports with one Camera
> > >
> > >> Hi,
> > >>
> > >> On 29/10/10 10:48, "Martin Großer" wrote:
> > >>> Ok. I try the slave variant.
> > >>>
> > >>> I have a additional question. When I use two different cameras
> > >>> and three viewports, how would you implement this. Two viewport
> > >>> have the first camera and the third viewport has the second
> > >>> camera.
> > >>>
> > >>> My idea is something like this:
> > >>>
> > >>> // Camera 1 osg::Camera* cam1 = new ...
> > >>> slaveCam1->setViewport(...);
> > >>>
> > >>> // Slave Camera 1 osg::Camera* slaveCam1 = new ...
> > >>> slaveCam1->setViewport(...);
> > >>>
> > >>> // Camera 2 osg::Camera* cam2 = new ... cam2->setViewport(...);
> > >>> cam2->addChild(scene);
> > >>>
> > >>> // RootNode // Camera two as a part of the scene graph. Is this
> > >>> clever? osg::Group* root = new ... root->addChild(scene);
> > >>> root->addChild(cam2);
> > >>>
> > >>> // Viewer osg::Viewer* viewer = new ...
> > >>> viewer->setSceneData(root); viewer->setCamera(cam1);
> > >>> viewer->addSlave(slaveCam1);
> > >>>
> > >>>
> > >>> Is this the right way? And what is your commendation to use
> > >>> different camera manipulators. That means, what can I do when I
> > >>> want to use a manipulator for the second camera (the camera in
> > >>> the root node).
> > >>>
> > >>> My idea is to write a GUIEventhandler. This should check the
> > >>> mouse position and give the viewport or the camera and then I
> > >>> calculate the new position like the trackball manipulator. That
> > >>> is the approximate idea.
> > >>
> > >> Do you want something different from what happens if you run
> > >> "osgcompositeviewer cow.osg". There, each view can have its own
> > >> manipulator.
> > >>
> > >> jp
> > >>
> > >>>
> > >>> Cheers
> > >>>
> > >>> Martin
> > >>>
> > >>>
> > >>>  Original-Nachricht 
> >  Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert
> >  Osfield  An: OpenSceneGraph
> >  Users  Betreff: Re:
> >  [osg-users] Two Viewports with one Camera
> > >>>
> >  Hi Martin,
> > 
> >  I'm a bit confused by the thread, but as a general note you
> >  shouldn't go attempting to use two separate Viewport per
> >  Camera. The OSG fully supports slave Camera that can share
> >  scene graphs and share the same graphics context, so it's
> >  straight forward to implement and manage, the osgViewer design
> >  has been specifically designed to make this type of usage as
> >  simple as possible.
> > 
> >  Robert.
> > 
> >  2010/10/29 "Martin Großer":
> > > Hello all,
> > >
> > > I would like use two viewports in my application and one
> > > camera. Is this
> >  possible? I think, the normal way is to define the viewport for
> >  a camera like: camera->setViewport(...)
> > >
> > >

Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Robert Osfield
Hi Martin,

2010/10/29 "Martin Großer" :
> Ok. I try the slave variant.
>
> I have a additional question. When I use two different cameras and three 
> viewports, how would you implement this. Two viewport have the first camera 
> and the third viewport has the second camera.

Arggg,.. Use three camera's.  Drop the idea of sharing a single
Viewport on a single Camera, it's simply not a sensible idea, the OSG
hasn't been designed around the ability to keep flipping Camera
Viewport in the way you want.

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


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Robert Osfield
Hi Martin,

2010/10/29 "Martin Großer" :
> the problem is that I want to use a embedded viewer (gtk), too. I guess it 
> doesn't work with the composite viewer. Or is it possible?

CompositeViewer and Viewer both with with a GraphicsWindowEmbedded,
there is absolutely no difference when it comes to rendering, all the
viewer rendering really cares about is that you have a series of one
or more cameras assigned to a series of one or more graphics contexts.

CompositeViewer vs Viewer is all about how you want to manage View's.
 Lots has been discussed about this over the years so please go read
through the archives.

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


Re: [osg-users] [forum] Video capture with 3D augmented reality

2010-10-29 Thread benedikt naessens
Thanks for your reply !

Can you explain how the structure of the camera's then will be ? And how do you 
flip the coordinates ?


Thank you!

Cheers,
benedikt

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33241#33241





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


Re: [osg-users] Two Viewports with one Camera

2010-10-29 Thread Martin Großer
Yes, I understand. I try the RTT-Idea. Maybe it serve my purpose. Otherwise I 
drop this idea and try a observer pattern in my software architecture.

Thank you very much.

Martin


 Original-Nachricht 
> Datum: Fri, 29 Oct 2010 11:02:43 +0100
> Von: Robert Osfield 
> An: OpenSceneGraph Users 
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Hi Martin,
> 
> 2010/10/29 "Martin Großer" :
> > Ok. I try the slave variant.
> >
> > I have a additional question. When I use two different cameras and three
> viewports, how would you implement this. Two viewport have the first
> camera and the third viewport has the second camera.
> 
> Arggg,.. Use three camera's.  Drop the idea of sharing a single
> Viewport on a single Camera, it's simply not a sensible idea, the OSG
> hasn't been designed around the ability to keep flipping Camera
> Viewport in the way you want.
> 
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] OpenFlight Export - MultiTexturing - wrong Texture Coordinates

2010-10-29 Thread Katharina Plugge
Hi,

lately I was trying to convert an osg-file which uses multitexturing to 
openFlight and realized, that the texture coordinates for units >0 got 
corrupted. (First 3 coords are repeated again and again).

So I had a look at the openFlight Plugin and found the problem in 
expGeometry.cpp, line 772, function writeUVList: 


Code:
void FltExportVisitor::writeUVList( int numVerts, const osg::Geometry& geom )
{
unsigned int numLayers( 0 );
uint32 flags( 0 );
unsigned int idx;
for( idx=1; idx<8; idx++)
{
if( isTextured( idx, geom ) )
{
flags |= LAYER_1 >> (idx-1);
numLayers++;
}
}
if( numLayers == 0 )
return;

uint16 length( 8 + (8*numLayers*numVerts) );

_records->writeInt16( (int16) UV_LIST_OP );
_records->writeUInt16( length );
_records->writeInt32( flags );

osg::Vec2 defaultCoord( 0., 0. );
// const osg::StateSet* ss = getCurrentStateSet();
for( idx=1; idx<8; idx++)
{
if( isTextured( idx, geom ) )
{
osg::Array* t = const_cast( geom.getTexCoordArray( idx 
) );
osg::ref_ptr t2 = dynamic_cast( t 
);
if (!t2.valid())
{
std::ostringstream warning;
warning << "fltexp: No Texture2D for unit " << idx;
osg::notify( osg::WARN ) << warning.str() << std::endl;
_fltOpt->getWriteResult().warn( warning.str() );
t2 = new osg::Vec2Array;
}
else if (static_cast(t2->getNumElements()) != numVerts)
{
std::ostringstream warning;
warning << "fltexp: Invalid number of texture coordinates for 
unit " << idx;
osg::notify( osg::WARN ) << warning.str() << std::endl;
_fltOpt->getWriteResult().warn( warning.str() );
}

const int size = t2->getNumElements();
int vIdx;
for( vIdx=0; vIdxwriteFloat32( tc[0] );
_records->writeFloat32( tc[1] );
}
}
}
}




My Geometry contained 444 vertices and as many texture coordinates, so the size 
of the array t2 is 444 (and therefor does not equal numVerts which is 3 (using 
triangles)). The indices are always 0, 1, 2, so each time the function is 
called, the same three texture coordinates are added.

I fixed this problem adding indices respectivly firstIndex as input parameter 
like it is done in writeVertexList:


Code:
void
FltExportVisitor::writeUVList( int numVerts, const osg::Geometry& geom, const 
std::vector& indices )
{
unsigned int numLayers( 0 );
uint32 flags( 0 );
unsigned int idx;
for( idx=1; idx<8; idx++)
{
if( isTextured( idx, geom ) )
{
flags |= LAYER_1 >> (idx-1);
numLayers++;
}
}
if( numLayers == 0 )
return;

uint16 length( 8 + (8*numLayers*numVerts) );

_records->writeInt16( (int16) UV_LIST_OP );
_records->writeUInt16( length );
_records->writeInt32( flags );

osg::Vec2 defaultCoord( 0., 0. );
// const osg::StateSet* ss = getCurrentStateSet();
for( idx=1; idx<8; idx++)
{
if( isTextured( idx, geom ) )
{
osg::Array* t = const_cast( geom.getTexCoordArray( idx 
) );
osg::ref_ptr t2 = dynamic_cast( t 
);
if (!t2.valid())
{
std::ostringstream warning;
warning << "fltexp: No Texture2D for unit " << idx;
osg::notify( osg::WARN ) << warning.str() << std::endl;
_fltOpt->getWriteResult().warn( warning.str() );
t2 = new osg::Vec2Array;
}
const int size = t2->getNumElements();
for( int cIdx=0; cIdxwriteFloat32( tc[0] );
_records->writeFloat32( tc[1] );
}
}
}
}



and


Code:
void
FltExportVisitor::writeUVList( int numVerts, const osg::Geometry& geom, 
unsigned int first )
{
unsigned int numLayers( 0 );
uint32 flags( 0 );
unsigned int idx;
for( idx=1; idx<8; idx++)
{
if( isTextured( idx, geom ) )
{
flags |= LAYER_1 >> (idx-1);
numLayers++;
}
}
if( numLayers == 0 )
return;

uint16 length( 8 + (8*numLayers*numVerts) );

_records->writeInt16( (int16) UV_LIST_OP );
_records->writeUInt16( length );
_records->writeInt32( flags );

osg::Vec2 defaultCoord( 0., 0. );
// const osg::StateSet* ss = getCurrentStateSet();
for( idx=1; idx<8; idx++)
{
if( isTextured( idx, geom ) )
{
osg::Array* t = const_cast( geom.getTexCoordArray( idx 
) );
osg::ref_ptr t2 = dynamic_cast( t 
);
if (!t2.valid())
{
std::ostringstream warning;
warning << "fltexp: No Texture2D for unit " << idx;
osg::notify( osg::WARN ) << warning.str(

Re: [osg-users] Image cache and manually release

2010-10-29 Thread Sukender
Hi Patrice,

Got two ideas :
1. addEntryToObjectCache(filename, new MyDummyEmptyObject());

2. addEntryToObjectCache(, 0.0001); removeExpiredObjectsInCache();(if 
and only if this does not interract negatively with the rest of your app).

I personnally prefer the first one.

If it still doesn't work, try using a debugger and trace when the image gets 
referenced.
Cheers,

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

- "Patrice Defond"  a écrit :

> Thank for your help Sukender.
> 
> I can't use the methods removeExpiredObjectsInCache and
> clearObjectCache because the rest of my application need the cache. 
> 
> It is very specific for a module : it loads big images.
> 
> So i test addEntryToObjectCache.
> - With NULL in object : OSG make an error ("Error file does not
> contain an osg::Object")
> - if i call the function with a timestamp to 0 or 0.001 ... but my
> object is not release. 
> 
> 
> Do you have more ideas ?
> 
> Cheers,
> Patrice
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=33237#33237
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [forum] Video capture with 3D augmented reality

2010-10-29 Thread J.P. Delport

Hi,

I think start with "osgprerender".

Something like:

RTT camera 1 looks at a quad with your input video. Change the texture 
coordinates on the quad until your video is right way up.


RTT camera 2 uses the same output texture as 1 (don't clear color) and 
draws the scene.


OSG camera just displays the output texture.

jp

I've attached a modified osgprerender with 2 rtt cameras. The first just 
clears, the second renders.


On 29/10/10 12:10, benedikt naessens wrote:

Thanks for your reply !

Can you explain how the structure of the camera's then will be ? And how do you 
flip the coordinates ?


Thank you!

Cheers,
benedikt

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33241#33241





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


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


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


/* OpenSceneGraph example, osgprerender.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the "Software"), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

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

#include 
#include 
#include 

#include 

#include 
#include 
#include 

#include 
#include 

#include 

// call back which creates a deformation field to oscillate the model.
class MyGeometryCallback : 
public osg::Drawable::UpdateCallback, 
public osg::Drawable::AttributeFunctor
{
public:

MyGeometryCallback(const osg::Vec3& o,
   const osg::Vec3& x,const osg::Vec3& y,const osg::Vec3& z,
   double period,double xphase,double amplitude):
_firstCall(true),
_startTime(0.0),
_time(0.0),
_period(period),
_xphase(xphase),
_amplitude(amplitude),
_origin(o),
_xAxis(x),
_yAxis(y),
_zAxis(z) {}

virtual void update(osg::NodeVisitor* nv,osg::Drawable* drawable)
{
// OpenThreads::Thread::microSleep( 1000 );

const osg::FrameStamp* fs = nv->getFrameStamp();
double simulationTime = fs->getSimulationTime();
if (_firstCall)
{
_firstCall = false;
_startTime = simulationTime;
}

_time = simulationTime-_startTime;

drawable->accept(*this);
drawable->dirtyBound();

osg::Geometry* geometry = dynamic_cast(drawable);
if (geometry)
{
osgUtil::SmoothingVisitor::smooth(*geometry);
}

}

virtual void apply(osg::Drawable::AttributeType type,unsigned int count,osg::Vec3* begin) 
{
if (type == osg::Drawable::VERTICES)
{
const float TwoPI=2.0f*osg::PI;
const float phase = -_time/_period;

osg::Vec3* end = begin+count;
for (osg::Vec3* itr=begin;itrgetPixelFormat()==GL_RGBA && _image->getDataType()==GL_UNSIGNED_BYTE)
{
// we'll pick out the center 1/2 of the whole image,
int column_start = _image->s()/4;
int column_end = 3*column_start;

int row_start = _image->t()/4;
int row_end = 3*row_start;


// and then invert these pixels
for(int r=row_start; rdata(column_start, r);
for(int c=column_start; cdirty();
}
else if (_image && _image->getPixelFormat()==GL_RGBA && _image->getDataType()==G

[osg-users] [vpb] bulid a geocentric database with large image(.img )bigger than 4G

2010-10-29 Thread Lv Qing
Hi,

... 


I want to build a geocentric database with large image(.img )bigger than 4G.

Everytime VPB must reproject the .img image to a temp .tiff file first,the 
problem is .tiff file can not hold data larger than 4GB,so there also have 
problem when reprojecting the original image.I try to modify VPB source to make 
it reprojecting  to a .img file,I don't know if it works correct,or is there a 
better way?





Thank you!

Cheers,
Lv

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33246#33246





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


Re: [osg-users] [vpb] bulid a geocentric database with large image(.img )bigger than 4G

2010-10-29 Thread Torben Dannhauer
Hi,

Another solution could be to use libtiff newer than 4.0, with support for 
bigTiff (Tiff files larger than 4 GB)


Cheers,
Torben

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33247#33247





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


Re: [osg-users] [vpb] bulid a geocentric database with large image(.img )bigger than 4G

2010-10-29 Thread J.P. Delport

Hi,

one way would be to split up the large img into smaller tiffs using gdal 
tools (e.g. gdal_retile). VPB uses gdal for the conversion anyway, so 
you will save time when you want to rebuild the database again.


jp

On 29/10/10 14:10, Lv Qing wrote:

Hi,

...


I want to build a geocentric database with large image(.img )bigger than 4G.

Everytime VPB must reproject the .img image to a temp .tiff file first,the 
problem is .tiff file can not hold data larger than 4GB,so there also have 
problem when reprojecting the original image.I try to modify VPB source to make 
it reprojecting  to a .img file,I don't know if it works correct,or is there a 
better way?





Thank you!

Cheers,
Lv

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33246#33246





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


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


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


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


Re: [osg-users] [vpb] bulid a geocentric database with large image(.img )bigger than 4G

2010-10-29 Thread Robert Osfield
Hi Lv,

One approach you could take would be to reproject the imagery using
gdal_translate to the desired coordinate system and then set up VPB to
use the reprojected imagery.

Robert.

On Fri, Oct 29, 2010 at 1:10 PM, Lv Qing  wrote:
> Hi,
>
> ...
>
>
> I want to build a geocentric database with large image(.img )bigger than 4G.
>
> Everytime VPB must reproject the .img image to a temp .tiff file first,the 
> problem is .tiff file can not hold data larger than 4GB,so there also have 
> problem when reprojecting the original image.I try to modify VPB source to 
> make it reprojecting  to a .img file,I don't know if it works correct,or is 
> there a better way?
>
>
>
>
>
> Thank you!
>
> Cheers,
> Lv
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=33246#33246
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Image cache and manually release

2010-10-29 Thread Patrice Defond
Yep ! Your first solution works perfectly !
Thank a lot !

I find an other solution : when you read a file whith readImageFile(..), you 
specify a filename and you can give option. And there is an option to not use 
Image Cache.

Thank you !

Patrice

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33250#33250





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


Re: [osg-users] OSGs OpenGLES 2.0 status

2010-10-29 Thread Christian Ruzicka
Hi,

In the meantime I got a better understanding of OSG regarding OpenGLES 2.0 
support and osgText, osgTerrain and osgEarth are now basically running in the 
OpenGLES 2.0 Emulator (globeview with some labels and streets).

I also saw the thread regarding the ShaderComposer, its design and the feature 
set:

Shader composition, OpenGL modes and custom modes (I'm not allowed to post 
links yet)

The last post in this thread was in July. Are there any news regarding the 
implementation?

Thank you!

Cheers,
Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33251#33251





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


[osg-users] Making sure I am completely freeing up OSG shader-related resources

2010-10-29 Thread Fred Smith
Hi,

I'm in a situation in which my Win32 process takes a lot of time to exit, 
something like 15-20 seconds. This happens as soon as I attach shaders to my 
geode.

Something I want to do first is to make sure I release OSG shader-related 
resources completely before exiting the application.

Here is my code to use shaders then release them:


Code:
Geode *geode;
Program *program = new Program();
Shader *vs = new Shader(...);
Shader *fs = new Shader(...);
program->addShader(vs);
program->addShader(fs);
geode->getOrCreateStateSet()->setAttributeAndMode(program, StateSet::ON);

[...]

// To free up resources I do:
geode->setStateSet(new StateSet());
// obviously release all references to program, fs and vs here

// I expect that, at this point, all shader-related stuff for OSG is gone




Is this good enough?

Cheers,
Fred

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33252#33252





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


Re: [osg-users] [osgPlugins] OpenFlight Export - MultiTexturing - wrong Texture Coordinates

2010-10-29 Thread Roland Smeenk
Hi Katharina,

thanks for chasing and fixing this problem. Can you attach the complete 
modified file to a new thread on the submissions forum. This way it will end up 
on the todo list for inclusion in osg.

Thanks,

Roland

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33253#33253





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


Re: [osg-users] OSG ActiveX + IFC - looking for developer

2010-10-29 Thread Chris 'Xenon' Hanson
  I spoke to the person I'd previously been contacted by, concerning the IFC 
loader. They
have not moved forward on the project yet, so as far as I know, there is not an 
IFC loader
project for OSG.

  If you are interested, they indicated they would be willing to consider 
splitting the
costs of developing a loader. I had spoken to them previously about doing the 
actual
programming for them under paid contract.

  If this interests you, I can put both of you in touch so you could discuss it.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
"There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] rendering the large point data

2010-10-29 Thread Chris 'Xenon' Hanson
On 10/29/2010 1:04 AM, J.P. Delport wrote:
> Hi,
> I've stumbled across this at a conference, it might be useful.
> http://www.hpi.uni-potsdam.de/doellner/publications/year/2010/1086/RD10.html

  I couldn't find an electronic copy anywhere to read. Anyone have it? I'd love 
to read up
on this.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
"There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] OpenFlight Export - MultiTexturing - wrong Texture Coordinates

2010-10-29 Thread Paul Martz

On 10/29/2010 8:56 AM, Roland Smeenk wrote:

Hi Katharina,

thanks for chasing and fixing this problem. Can you attach the complete 
modified file to a new thread on the submissions forum. This way it will end up 
on the todo list for inclusion in osg.


Hi Katharina -- Also, you mentioned you created an OSG file that reproduces the 
issue and verifies the fix. If you can share this file, please consider opening 
an issue at the OSG FLT export project issue page:


http://code.google.com/p/osgfltexport/

Attach the OSG test file to the issue. I'll try to add it to the project when 
time allows.

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


[osg-users] Top 10 Scene graph optimizations?

2010-10-29 Thread Michael Irby II
So does anyone have any suggestions or ideas on scene graph optimizations. "Hey 
my scene looks great, now lets make it fast!".comments would be greatly 
appreciated...thanks.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33259#33259





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


Re: [osg-users] [build] undefined symbol: _ZN11OpenThreads6AtomicmmEv

2010-10-29 Thread Huron Sam Perera
Hi Robert,

I am linking with OpenThreads.

About the Makfile:

The application that I am trying run with intersection checks from OSG has its 
own Makefile that I do not want to change other than adding the includes and 
libraries from OSG. Since, that procedure is giving me the undefined symbol 
error I am now trying to compile and run the osgintersction example using your 
recommended build procedure for examples. I ran cmake and make in the 
OpenSceneGraph folder to create the libraries. However, there were no Makefiles 
generated for the examples. That's why I went to the 
OpenSceneGraph/examples/osgintersection folder and ran cmake. Then I run into 
cmake not recognizing SETUP_EXAMPLE project. What I like to know is whether you 
have the examples setup to have Makefiles created using cmake or we just write 
our own Makefile and link with the libraries just like I did with my 
application. If you have the examples set up to have Makefiles generated thru 
cmake, I probably am not following the correct procedure and that is probably 
why I am runni
 ng into the SETUP_EXAMPLE problem.


Thank you!

Cheers,
Huron

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33260#33260





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


[osg-users] [build] 3rd party libs and VS 2010

2010-10-29 Thread Joel Graff
Hello,

I'm build OSG 2.8.3 under VS2010.  When setting it up, I specified the 
directories for Freetype in cmake.  I had the two include path variables and 
the library debug variable pointing correctly (I think).

However, when cmake generates, it doesn't generate the osgdb_freetype project.

I don't see any errors in the cmake file that indicates it can't generate the 
freetype project, it just doesn't.

I've looked for answers in the forum and I'm not sure if I've seen an answer or 
not...

Any help would be appreciated.

Thanks,

Joel

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33261#33261





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


Re: [osg-users] [build] undefined symbol: _ZN11OpenThreads6AtomicmmEv

2010-10-29 Thread Yurii Monakov
Hi Huron,

I've experienced the same problems with unresolved symbols from
OpenTreads. The problem was solved by full rebuild of OSG. Just delete
CMake cache, reconfigure and build.

Once I've fought unexpected runtime errors (segmentation faults) in
simple OSG apps (even in examples) and they were also solved by full
rebuild. Seems that something went wrong during compilation process,
but compiler/linker somehow have missed these errors.

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


Re: [osg-users] OSG ActiveX + IFC - looking for developer

2010-10-29 Thread Zdravko Clarion

Chris 'Xenon' Hanson wrote:
> I spoke to the person I'd previously been contacted by, concerning the IFC 
> loader. They
> have not moved forward on the project yet, so as far as I know, there is not 
> an IFC loader
> project for OSG.
> 


Hi
please check, is that person Zdravko :) ?
Looks like you have contacted me?

Zdravko

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33263#33263





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