Re: [osg-users] Writing single plugin to handle multiple extensions

2009-09-14 Thread Budong Smith
Writing single plugin to handle multiple extensions is not really as easy as 
that but i guess that is a great reference.



__
Writing jobs (http://www.suite101.com/freelance_writing_jobs/)

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





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


Re: [osg-users] OSG viewer blocks Qt window

2009-09-14 Thread Philip Lowman
Can you post a small example of the problem?  I've been using Qt with OSG
for about a month now and haven't run into anything like this.

Have you considered using something like a QTimer to send your keep-alive
messages instead?

On Mon, Sep 14, 2009 at 9:40 AM, Zoe Catz  wrote:

> Hi,
>
> I've written a Qt application. It's used to configure some settings which
> should be considered it my visualisation later on. In addition, this window
> update handles sending keep-alive messages via UDP in the background.
>
> The visualisation itselft should be rendered in an own window by OSG. The
> problem is, as soon as I add the osg window the qt window incl. the UDP
> packages are not updated/sent anymore.
>
> So my question is, how can I force both (qt and osg) windows to update?
>
> Thank you in advance!
>
> Cheers,
> grisu
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17338#17338
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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


Re: [osg-users] Preventing scale from being transmitted to children

2009-09-14 Thread Jason Daly

Julien-Charles Levesque wrote:

Hi,

I'm currently working with PositionAttitudeTransform controlled objects in my 
environment. Some objects are clearly too big, some too small. So I set their 
scale using the setScale function. Problem is that this scale is transmitted 
automatically to children of the Transforms, and I do not want that. Sure I 
could apply the inverse of the scale factor to each children, but that doesn't 
seem like a clean solution to me.

I want my children to receive the position and orientation modifications, alas 
not the scale modifications. There must be a simple way to do this, right ?
  


What you're seeing is part of the nature of a scene graph.  Each child 
inherits the coordinate system of its parent.


A simple solution is to create a MatrixTransform node, set a scale on it 
(use Matrix::makeScale), and attach the object model to that 
transform.   Then, you can attach the MatrixTransform to the 
PositionAttitudeTransform.


A possible shortcut for this could also be to use the "scale" 
pseudoloader.  For example, if you are currently loading a model called 
"model.obj", you can instead load "model.obj.(3.0).scale", and it will 
automatically insert a scale transform above the loaded object.


--"J"

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


[osg-users] Preventing scale from being transmitted to children

2009-09-14 Thread Julien-Charles Levesque
Hi,

I'm currently working with PositionAttitudeTransform controlled objects in my 
environment. Some objects are clearly too big, some too small. So I set their 
scale using the setScale function. Problem is that this scale is transmitted 
automatically to children of the Transforms, and I do not want that. Sure I 
could apply the inverse of the scale factor to each children, but that doesn't 
seem like a clean solution to me.

I want my children to receive the position and orientation modifications, alas 
not the scale modifications. There must be a simple way to do this, right ?

Anyone has a clue?

Thanks in advance!

Cheers,
JC

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





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


Re: [osg-users] querying nodes/childs

2009-09-14 Thread Paul Martz
Pretty vague question, but you'd probably use a NodeVisitor for that. 
Have you read the OSG Quick Start Guide?


Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ 
+1 303 859 9466



Terrence Vergauwen wrote:

Hi,

I'm new to openscenegraph,
i've loaded an OBJ into a node,
what would be the best way to query everything this node contains ?

I need to extract all geodes/geometry/transforms/materials to place them into a 
nodegraph.

Thank you!

Cheers,
Terrence

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





___
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] querying nodes/childs

2009-09-14 Thread Terrence Vergauwen
Hi,

I'm new to openscenegraph,
i've loaded an OBJ into a node,
what would be the best way to query everything this node contains ?

I need to extract all geodes/geometry/transforms/materials to place them into a 
nodegraph.

Thank you!

Cheers,
Terrence

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





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


Re: [osg-users] OSG Threading

2009-09-14 Thread Robert Osfield
Hi Prasad,

You can do the multi-threading in any way you, you can even thread the main
loop out into a separate thread, or you can even just use the OSG's database
pager if to create procedural scene graph elements.  You have lots of
choice.  You don't really say enough about your apps needs to say what
approach is best for you.

Robert.

On Mon, Sep 14, 2009 at 3:50 PM, Prasad Pokala wrote:

> Hi,
>
>
> Hi,
>
>I am new to OSG.  I have a following code inside my c++ application to
> run OSGViewer.
>
> osg::Group* root;
> osgViewer::Viewer viewer;
> root = new osg::Group();
>
>.  ( setting up the viewer/adding geometry).
>
>   root->getOrCreateStateSet()->setMode(GL_LIGHTING,
> osg::StateAttribute::OFF);
>viewer.setSceneData( root );
>viewer.realize();
>viewer.run();
>
>   //  wants to continue with my c++ stuff
>   //  some c++ code here
> int p;
>function1();
>   
>   
>
>
>  By above code I have added some triangles to the scene. and able to run
> the osgviewer. After running  the osgviewer I am unable to reach to
> function1(); untill and unless i close the osgviewer. Seems like osgviewer
> is runnig in singlethread and its not allowing me to do anything else.
>
> After I displayed the osgviewer I want to continue with my c++ stuff with
> background osgviewer is running.
>
> I guess I have to implement some multithreading to run viewer as well as to
> continue with  c++ stuff.
>
> Any one has some idea how can i do this??
>
>
>
> Thank you!
>
> Cheers,
> Prasad
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17343#17343
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Threading

2009-09-14 Thread Jason Daly

Prasad Pokala wrote:

Hi,


Hi,

I am new to OSG.  I have a following code inside my c++ application to run OSGViewer. 
 
 osg::Group* root; 
 osgViewer::Viewer viewer;

 root = new osg::Group();
  
.  ( setting up the viewer/adding geometry).
  
   root->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);

viewer.setSceneData( root );
viewer.realize();
viewer.run();

   //  wants to continue with my c++ stuff

   //  some c++ code here
 int p;
function1(); 
   

   


 By above code I have added some triangles to the scene. and able to run the 
osgviewer. After running  the osgviewer I am unable to reach to function1(); 
untill and unless i close the osgviewer. Seems like osgviewer is runnig in 
singlethread and its not allowing me to do anything else.
  


It's not single-threaded, but you're calling the run() method of viewer, 
which doesn't return until you call viewer.setDone(true) in a callback 
or something.


If you change it to:

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

  
}

You should get what you need.

--"J"


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


[osg-users] OSG Threading

2009-09-14 Thread Prasad Pokala
Hi,


Hi,

I am new to OSG.  I have a following code inside my c++ application to run 
OSGViewer. 
 
 osg::Group* root; 
 osgViewer::Viewer viewer;
 root = new osg::Group();
  
.  ( setting up the viewer/adding geometry).
  
   root->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
viewer.setSceneData( root );
viewer.realize();
viewer.run();

   //  wants to continue with my c++ stuff
   //  some c++ code here
 int p;
function1(); 
   
   


 By above code I have added some triangles to the scene. and able to run the 
osgviewer. After running  the osgviewer I am unable to reach to function1(); 
untill and unless i close the osgviewer. Seems like osgviewer is runnig in 
singlethread and its not allowing me to do anything else.

After I displayed the osgviewer I want to continue with my c++ stuff with 
background osgviewer is running. 

I guess I have to implement some multithreading to run viewer as well as to 
continue with  c++ stuff.  

Any one has some idea how can i do this??



Thank you!

Cheers,
Prasad

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





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


Re: [osg-users] shape, shape drawable and geode modification

2009-09-14 Thread Robert Osfield
Hi Miguel,

By default the OSG creates display lists for drawables, including the
ShapeDrawable, and this won't automatically update unless you tell the
drawable it needs to recompile the display list which you can do via
drawable->dirtyDisplayList().  If you plan to modify the shape regularily
then it's best to just disable display lists outright via
drawable->setUseDisplayList(false) as the compilation is relatively
expensive.

Robert.

On Mon, Sep 14, 2009 at 4:26 PM, Miguel Lokida  wrote:

> Hi,
>
> Here 's my problem. I have a cylinder shape that I have added to my
> scenegraph. here a sample code:
>
> I have declared instances in the headers. And I can display the cylinder.
>
> Code:
>
> rp_cylinder = new osg::Cylinder();
>
> rp_cylinder->setHeight(1.0f);
> rp_cylinder->setRadius(100.0f);
> rp_cylinder->setRotation(osg::Quat( (M_PI / 2.0f),osg::Vec3(0.0f, 1.0f,
> 0.0f)) );
>
> rp_CylinderDrawable = new osg::ShapeDrawable(rp_cylinder.get());
>
> rp_cylinderGeode = new osg::Geode();
>
> rp_cylinderGeode->addDrawable(rp_CylinderDrawableDebFen.get());
>
> rp_position->addChild(rp_cylinderGeode.get());
>
>
>
>
>
> But, I would like to modify the radius and height of the cylinder. So, I
> do:
>
>
> Code:
> osg::Cylinder * cylinder = static_cast *>(rp_cylinderGeode->getDrawable(0)->getShape());
> cylinder->setHeight(2.0f);
>
>
>
>
> But the problem is that nothing happen. No modification of the geometry.
> The address of the pointer is always the same so it is the same object.
>
> What 's wrong with my implementation ?
>
>
> Thank you![/code]
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17347#17347
>
>
>
>
>
> ___
> 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] Alpha question with osggeometry

2009-09-14 Thread Kim Bale
Hi Mike,

You need to enable blending on the stateset.

->setMode( GL_BLEND, osg::StateAttribute::ON );

Kim.

2009/9/14 Mike Greene :
> Hopefully a simple question: In the demo, osggeometry, I changed all the
> color values to have an alpha of 0.1 instead of 1.0 (4th component of Vec4).
> It didn't have any effect. What else needs to be added in order for the
> transparency to appear?
>
> Mike Greene
> ___
> 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] shape, shape drawable and geode modification

2009-09-14 Thread Miguel Lokida
Hi,

Here 's my problem. I have a cylinder shape that I have added to my scenegraph. 
here a sample code:

I have declared instances in the headers. And I can display the cylinder.

Code:

rp_cylinder = new osg::Cylinder();

rp_cylinder->setHeight(1.0f);
rp_cylinder->setRadius(100.0f);
rp_cylinder->setRotation(osg::Quat( (M_PI / 2.0f),osg::Vec3(0.0f, 1.0f, 0.0f)) 
);

rp_CylinderDrawable = new osg::ShapeDrawable(rp_cylinder.get());

rp_cylinderGeode = new osg::Geode();

rp_cylinderGeode->addDrawable(rp_CylinderDrawableDebFen.get());

rp_position->addChild(rp_cylinderGeode.get());





But, I would like to modify the radius and height of the cylinder. So, I do:


Code:
osg::Cylinder * cylinder = static_cast(rp_cylinderGeode->getDrawable(0)->getShape());
cylinder->setHeight(2.0f);




But the problem is that nothing happen. No modification of the geometry.
The address of the pointer is always the same so it is the same object.

What 's wrong with my implementation ?


Thank you![/code]

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





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


Re: [osg-users] Problems with camera default views

2009-09-14 Thread Felipe Lemus
Hi,

I have found the solution!!
... 

Thank you!

Cheers,
Felipe

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





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


[osg-users] Alpha question with osggeometry

2009-09-14 Thread Mike Greene
Hopefully a simple question: In the demo, osggeometry, I changed all the 
color values to have an alpha of 0.1 instead of 1.0 (4th component of 
Vec4). It didn't have any effect. What else needs to be added in order 
for the transparency to appear?


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


Re: [osg-users] Confusion regarding multiple views showing almost the same sceene

2009-09-14 Thread Ragnar Hammarqvist
Thank

Im sure that this will help me.

//Ragnar 

-Ursprungligt meddelande-
Från: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] För J.P. Delport
Skickat: den 11 september 2009 15:11
Till: OpenSceneGraph Users
Ämne: Re: [osg-users] Confusion regarding multiple views showing almost the 
same sceene

Hi,

I'm attaching a proof of concept I've hacked on just to try things out. 
It's a modified osgviewerWX with multiple windows and hopefully shared context. 
I'll try to get it into shape for inclusion as example later.

cmake .
make
./test cow.osg

hope it helps as a start
jp

Ragnar Hammarqvist wrote:
> Multiple windows. 
> 
> -Ursprungligt meddelande-
> Från: osg-users-boun...@lists.openscenegraph.org 
> [mailto:osg-users-boun...@lists.openscenegraph.org] För J.P. Delport
> Skickat: den 11 september 2009 14:58
> Till: OpenSceneGraph Users
> Ämne: Re: [osg-users] Confusion regarding multiple views showing 
> almost the same sceene
> 
> Hi,
> 
> single window or multiple?
> 
> jp
> 
> Ragnar Hammarqvist wrote:
>> Hi All
>>
>> Im a bit confused on how to implement multiple views in osg.
>>
>> My problem is the following.
>> Im limited to use wxWidget as GUI (and GL Traight)?
>> In my GUI I want several (one to at least eight) camera views looking on 
>> almost the same scene. The scene is VPT-made and is presenting a huge 
>> terrain.
>> The difference between the views is going to be the shading of the terrain 
>> and some different objects placed in the terrain.
>>  So in order to gain maximum performance I want the different views to share 
>> the same graphic context or at least for the terrain part.
>>
>> But I don't know how to setup my views in a way so that they share the same 
>> context.
>>
>> Regards Ragnar
>> ___
>> 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 ___
> 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] FBO OpenGL Error with new nVidia Driver

2009-09-14 Thread Robert Osfield
Hi Sebastien,

There is very little others can do to help without seeing the actual problem
in front of them, it has far too open ended an issue - and OpenGL error
could mean a huge range of things that could be wrong.  You have your
application and hardware that reproduces the problem, no-one else has so you
are based placed to investigate the cause.  Start by simplifying your what
you app does, to isolate it to exactly what is causing the error. also try
other hardware/drivers.  Beyond giving you advice on how to investigate this
stuff there is nothing else others can do.

Robert.

On Mon, Sep 14, 2009 at 3:00 PM, Sebastien Nerig wrote:

> Hi,
>
> I am making a little "up" to this thread because I have the same problem as
> Kim. I use OSG 2.8, under windows XP and my graphic card is NVIDIA GeForce
> 8800 GTX.
> [Image: http://img147.imageshack.us/img147/3131/errorxk.jpg ]
> It appears each time I do a pre render renderig pass.
>
> It is very annoying because this error prevents me to debug my shaders with
> glslDevil.
>
> Thank you!
>
> Cheers,
> Sebastien[/img]
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17339#17339
>
>
>
>
>
> ___
> 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] OSG viewer blocks Qt window

2009-09-14 Thread Zoe Catz
Hi,

I've written a Qt application. It's used to configure some settings which 
should be considered it my visualisation later on. In addition, this window 
update handles sending keep-alive messages via UDP in the background. 

The visualisation itselft should be rendered in an own window by OSG. The 
problem is, as soon as I add the osg window the qt window incl. the UDP 
packages are not updated/sent anymore. 

So my question is, how can I force both (qt and osg) windows to update?

Thank you in advance!

Cheers,
grisu

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





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


Re: [osg-users] FBO OpenGL Error with new nVidia Driver

2009-09-14 Thread Sebastien Nerig
Hi,

I am making a little "up" to this thread because I have the same problem as 
Kim. I use OSG 2.8, under windows XP and my graphic card is NVIDIA GeForce 8800 
GTX.
[Image: http://img147.imageshack.us/img147/3131/errorxk.jpg ]
It appears each time I do a pre render renderig pass.

It is very annoying because this error prevents me to debug my shaders with 
glslDevil.

Thank you!

Cheers,
Sebastien[/img]

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





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


Re: [osg-users] setRenderBinDetails issue

2009-09-14 Thread Harold Comere
Well, this is not a setRenderBinDetails issue, but a material / color one.

If i define a color array for the label background it wont take anymore the
text color ... I am a bit confused with this kind of osg behavior but it
works for now.

Regards,
Harold



2009/9/14 Harold Comere 

> Hi all,
>
> To display some labels over 3D objects to name them, i draw a quad +
> osgText::Text per label in screen space with an orthogonal projection
> matrix.
> As i want one label can hide another one, i have disabled the depth test to
> be sure that the last thing drawed will be the one completly visible.
>
> Now i only have to draw my label in the desired order, what i am trying to
> do with the setRenderBinDetails function but i have an issue.
> If i draw a first label with render bin details = 0 for label background (
> a quad with a texture ) and render bin details = -1 for its text , it is ok,
> i obtain the text over the quad.
> But if i draw a second label with render bin detail = -2 for label
> background and render bin details = -3 for its text, the second label is ok
> but the first one become strange ... the quad takes the text color as the
> attached picture shows.
>
> And another strange behavior is when the second label is not in view
> frustum, the first one become normal ...
> Does anyone can explain it ?
>
> Thank you for your attention.
> Regards,
> Harold
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] A question about the example OSGMFC

2009-09-14 Thread Tomlinson, Gordon
I believe the has been answered several times recently, a search of the
OSG mail archives should provide the answer to your question 


Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Geo Xin
Sent: Sunday, September 13, 2009 5:00 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] A question about the example OSGMFC

Hi,
Today,I run the example OSGMFC and I found the app can't display the
modle correctly. Some modle stretch in the x direction. How can I avoid
this.
... 

Thank you!

Cheers,
Geo xy


There is a long way to go.

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





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


Re: [osg-users] Focus object/scene (clamping frustum)

2009-09-14 Thread J.P. Delport

Hi,

Johannes Schüth wrote:

Hi,

Yes, the computeHomePosition calculates a position and set's it. In my case i'm 
not able to change the camera positon at all because it is fixed.
I'm able to change the orientation and the fov (by the frustum). 


bs = bounding sphere

You have the range (cam pos - bs center) and the bs radius, so atan 
would give half the fov needed to fit the bs. You'll have to adjust 
horiz/vert fov depending on your window aspect.


jp



Perhaps the osgShadow::MinimalShadowMap class does this kind of frustum calculation to minimize the fov of the camera that collects the shadowmap? 


Thank you!

Cheers,
Johannes

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





___
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


[osg-users] Problems with camera default views

2009-09-14 Thread Felipe Lemus
Hi,

I am new with OSG. I am trying to do an scene with a plane flying over a 
terrain. I want to use two cameras, one with the plane and looking at the floor 
and with freedom to rotate it. And another camera placed well above the plane 
looking to it. I use NodetrackerManipulator to do that, but the default view is 
not what I want. 

Here is the code to define the NodetrackerManipulator of the camera placed 
above the plane:

osg::PositionAttitudeTransform * Superiorcamera =
  new osg::PositionAttitudeTransform();
   Superiorcamera->setPosition( osg::Vec3(0.0,0.0,500.0) );
   Superiorcamera->setAttitude(
  osg::Quat( osg::DegreesToRadians(-90.0), osg::Vec3(1,0,0) ));
   
   ownTank.get()->addChild(Superiorcamera);
   osgGA::NodeTrackerManipulator* tm2 = new osgGA::NodeTrackerManipulator;
tm2->setTrackerMode( osgGA::NodeTrackerManipulator::NODE_CENTER);
tm2->setRotationMode( osgGA::NodeTrackerManipulator::ELEVATION_AZIM);
tm2->setTrackNode(Superiorcamera);


Then I have changed createview to take a NodetrackerManipultor instead of 
TrackballManipulator.

I am looking for solutions in the forum but I have not find what I need. I 
think that sethomeposition() is not valid in this case because my cameras are 
on the move and i have two views in the same viewer.

Thanks for your help and excuse my English.
... 

Thank you!

Cheers,
Felipe

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





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


Re: [osg-users] Focus object/scene (clamping frustum)

2009-09-14 Thread Johannes Schüth
Hi,

Yes, the computeHomePosition calculates a position and set's it. In my case i'm 
not able to change the camera positon at all because it is fixed.
I'm able to change the orientation and the fov (by the frustum). 

Perhaps the osgShadow::MinimalShadowMap class does this kind of frustum 
calculation to minimize the fov of the camera that collects the shadowmap? 

Thank you!

Cheers,
Johannes

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





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


Re: [osg-users] Focus object/scene (clamping frustum)

2009-09-14 Thread J.P. Delport

Hi,

I don't think the frustum is calculated per se. Have a look at how 
NodeTrackerManipulator.cpp (and others) uses setHomePosition(). I think 
a certain camera FOV is assumed and then distance from the object is 
adjusted so that the bounding sphere fits into the FOV.


jp

Johannes Schüth wrote:

Hi,

Thank for your advice. I took a look at:
http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/branches/OpenSceneGraph-2.6/src/osgGA/TrackballManipulator.cpp

But i can't find any place in the code where the frustum will be calculated.

Thank you!

Cheers,
Johannes

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





___
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] Focus object/scene (clamping frustum)

2009-09-14 Thread Johannes Schüth
Hi,

Thank for your advice. I took a look at:
http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/branches/OpenSceneGraph-2.6/src/osgGA/TrackballManipulator.cpp

But i can't find any place in the code where the frustum will be calculated.

Thank you!

Cheers,
Johannes

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





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


Re: [osg-users] Overlay nodes and Lod's

2009-09-14 Thread Robert Osfield
Hi Vaibhav,

On Mon, Sep 14, 2009 at 9:20 AM, Vaibhav Bansal wrote:

> Does overlay subgraph support LOD's?
>

yes it'll just inherit the standard OSG's functional, but there is a
context to how it judges the LOD range.


> I tried to assign a paged lod as overlaysubgraph for overlay node, but it
> does not seem to page the lod's.
> Is there any special way to use lod's with overlay?
>

Could it be that the RTT camera is taking it's picture from a position that
does require the high levels of detail you are perhaps looking for.  With
RTT's camera's it's possible to choose the current view's eye point rather
(termed the View point) than local Camera's eye point.  osgShadow uses
this.  I don't recall what osgSim::OverlayNode does in this context, go have
a look at the source.

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


Re: [osg-users] OSG MultiThreading

2009-09-14 Thread Robert Osfield
Hi Prasad,

You question is way too open ended to give an answer.  The osgViewer library
implements multi-threading of cameras and graphics context out of the box,
you don't need to do anything.  But as to whether this is what you after I
have absolutely no clue.

Tell us what you mean by multi-threading, i.e. what do you want to thread
and for what reason.

Robert.

On Mon, Sep 14, 2009 at 9:57 AM, prasad pokala wrote:

> Hi All,
>   How can implement multithreading in OSGApplication. Can anyone
> provide some examples how to return back the control after displaying the
> scene??
>
>
>  Thanking You
>
>
>
>Prasad.
>
> ___
> 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] OSG MultiThreading

2009-09-14 Thread prasad pokala
Hi All,
  How can implement multithreading in OSGApplication. Can anyone provide
some examples how to return back the control after displaying the scene??


 Thanking You



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


[osg-users] Overlay nodes and Lod's

2009-09-14 Thread Vaibhav Bansal
Hello,

Does overlay subgraph support LOD's?
I tried to assign a paged lod as overlaysubgraph for overlay node, but it
does not seem to page the lod's.
Is there any special way to use lod's with overlay?

Thanks and Regards
Vaibhav Bansal



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


Re: [osg-users] How to get the camera in UpdateCallback Node?

2009-09-14 Thread Robert Osfield
Hi Geo,

The camera callback will be called on each frame.  Or if you don't want to
use a callback you can simply roll your own frame loop and do the setting
there.

Robert.

On Wed, Sep 9, 2009 at 3:28 AM, Geo Xin  wrote:

> Hi,
> osg::Matrixd mt;
> mt->setUpdateCallback (New UpdateNode(camera));
>
> class UpdateNode::: public osg::NodeCallback
> {
> osg::camera* camera;
> UpdateNode(*camera)
> {camera=camera;}
> operate(osg::Node* node, osg::NodeVisitor* nv)
> {
> mt=camera->getMatrix();
> traverse(osg::Node* node, osg::NodeVisitor* nv);
> }
> }
>
> If can I use this way to get the camera in every Callback?
>
> If not,how can I get the camera in UpdateCallback Node everytime?
>
> Thank you!
>
> Cheers,
> GeoXY
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17166#17166
>
>
>
>
>
> ___
> 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] glmultmatrix in osg

2009-09-14 Thread Robert Osfield
Hi Tim,

On Sun, Sep 13, 2009 at 9:26 PM, Tim Allen  wrote:

> Hi,
>
> I want set my matrix to current modelview matrix and want to multiply it
> myself.Can someone please help me how  to do it in osg.
>

osg::Matrix matrix = viewer.getCamera()->getViewMatrix();
// do the stuff you want to matrix ...
viewer.getCamera()->setViewMatrix(matrix);

The OSG uses the form x' = x * M; while OpenGL now uses x' = M * x; so you
just flip the ordering.

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


[osg-users] How to add OSGViewer window to C++(.Net) application

2009-09-14 Thread prasad pokala
Hi All,
  I want to add OSGViewer to inside my c++ form(.net). I have tried with
some examples from this Forum but I am unable to add the scene to my form.
Can any one give me complete example how can i add a OSGScene inside a Form
or other window.

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