Re: [osg-users] Depth test and RenderBin details

2012-06-11 Thread Bob Slobodan
Hi guys,
First of all, thank you for the answers. Unfortunately, I couldn't solve my 
problem. I already tried the first solution that consisted in giving different 
render bin to the axis and the sphere, but then I either have the sphere always 
on top of the axis, or the axis always on top of the sphere.

This image illustrates my problem :

[Image: http://img15.hostingpics.net/pics/490598Sanstitre4.png ] 
(http://www.hostingpics.net/viewer.php?id=490598Sanstitre4.png)

The image 1 illustrates what i have  when the sphere has a lower render bin 
than the axis. The images 2 and 3 illustrates the opposite.
The image 4 illustrates a shading problem that I have in both situation.

So what I want is a mix between the image 2 and 5. This is basically what I 
have when I don't deactivate the depth test and don't use render bin details. 
But then, if I have anything (like a plane for example) between my dragger and 
the camera, I won't see it anymore.

Thank you so much for helping me.

Cheers,
Bob

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





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


[osg-users] R: Depth test and RenderBin details

2012-06-11 Thread Gianluca Natale
What I would do in standard OpenGL is this:
1) Draw your whole model first (with depth test enabled);
2) Clean the depth buffer only (glClear(GL_DEPTH_BUFFER_BIT););
3) Draw the dragger (with depth test enabled).
In this way the dragger would always appear on top of the model, no matter its 
position in the world.

How can you achieve this in a scene graph using OSG?
1) I would set the rendering bin for the whole model to the lowest value, to 
force it to be drawn first. Keeping depth test enabled during drawing.
2) I would define a CleanDrawable, derived from osg::drawable, whose 
drawImplementation is just a glClear(GL_DEPTH_BUFFER_BIT). And assign the 
rendering bin for such drawable to a value
   greater than the one assign to the whole model. Then, I would attach a geode 
containing such drawable somewhere in your scenegraph.
3) I would set for the dragger a rendering bin even greater than that assigned 
to the CleanDrawable. Keeping the depth test enabled in this case also.

I did do it in my application and it seems to work. But I don't know if there 
is a better and more elegant solution.
Just my 2 cents. 

-Messaggio originale-
Da: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] Per conto di Bob Slobodan
Inviato: lunedì 11 giugno 2012 10:15
A: osg-users@lists.openscenegraph.org
Oggetto: Re: [osg-users] Depth test and RenderBin details

Hi guys,
First of all, thank you for the answers. Unfortunately, I couldn't solve my 
problem. I already tried the first solution that consisted in giving different 
render bin to the axis and the sphere, but then I either have the sphere always 
on top of the axis, or the axis always on top of the sphere.

This image illustrates my problem :

[Image: http://img15.hostingpics.net/pics/490598Sanstitre4.png ] 
(http://www.hostingpics.net/viewer.php?id=490598Sanstitre4.png)

The image 1 illustrates what i have  when the sphere has a lower render bin 
than the axis. The images 2 and 3 illustrates the opposite.
The image 4 illustrates a shading problem that I have in both situation.

So what I want is a mix between the image 2 and 5. This is basically what I 
have when I don't deactivate the depth test and don't use render bin details. 
But then, if I have anything (like a plane for example) between my dragger and 
the camera, I won't see it anymore.

Thank you so much for helping me.

Cheers,
Bob

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





___
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] Help! Particles in OSG 3.0.1 flip halfway through their lifetime...

2012-06-11 Thread Robert Osfield
Hi Nick,

I've just tried your test model and see the problem but as yet don't
know the cause.  I experimented with changing various parameters and
consistently it looked like the textures flipped halfway through their
lifetime.  I have had a bash at looking at the revision logs for
Particle.cpp and ParticleSystem.cpp to see if there is any change that
looks like it might be repossible but the old server isn't responding
right now so can't check.

Robert.

On 8 June 2012 16:06, Nick Jones suvlak...@yahoo.com wrote:
 Hi,

  My project has recently upgraded to OSG 3.0.1. We have a set of particle 
 systems that we have been using for a while. After upgrading to OSG 3.0.1 
 from OSG 2.8.1, however, I noticed something strange with the way the 
 particles are being updated.  It seems that halfway through the particles' 
 lifetimes, they flip vertically.

  In example, I created a simple particle with an image of an arrow pointing 
 up. When I run this particle in OSG 2.8.1, the arrow remains pointing up 
 throughout the end of its lifetime. When I run it in OSG 3.0.1, the arrow 
 starts off pointing up but then suddenly points down at about the halfway 
 mark in its lifetime. It remains pointing down until the particle is 
 extinguished.

  Attached in the .zip file is the .osgx of the particle system. If you run it 
 in OSG 3.0.1, you'll notice the flipping. If you convert it to an .osg file 
 and run it in OSG 2.8.1, you'll notice that it does not flip.

  Has anyone run into this issue before?

  System Information: OSG 3.0.1, Ubuntu 10.04

 Thank you!
 Nick

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




 ___
 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] R: Depth test and RenderBin details

2012-06-11 Thread Tim Moore
On Mon, Jun 11, 2012 at 12:31 PM, Gianluca Natale
nat...@europe.altair.com wrote:
 What I would do in standard OpenGL is this:
 1) Draw your whole model first (with depth test enabled);
 2) Clean the depth buffer only (glClear(GL_DEPTH_BUFFER_BIT););
 3) Draw the dragger (with depth test enabled).
 In this way the dragger would always appear on top of the model, no matter 
 its position in the world.
Yes

 How can you achieve this in a scene graph using OSG?
 1) I would set the rendering bin for the whole model to the lowest value, to 
 force it to be drawn first. Keeping depth test enabled during drawing.
...
A less intrusive way to do this is with slave cameras. The main scene
is drawn in a slave. Another slave camera draws your dragger by having
it as its child. Its clear mask is set to GL_DEPTH_BUFFER_BIT.

Tim

 2) I would define a CleanDrawable, derived from osg::drawable, whose 
 drawImplementation is just a glClear(GL_DEPTH_BUFFER_BIT). And assign the 
 rendering bin for such drawable to a value
   greater than the one assign to the whole model. Then, I would attach a 
 geode containing such drawable somewhere in your scenegraph.
 3) I would set for the dragger a rendering bin even greater than that 
 assigned to the CleanDrawable. Keeping the depth test enabled in this case 
 also.

 I did do it in my application and it seems to work. But I don't know if there 
 is a better and more elegant solution.
 Just my 2 cents.

 -Messaggio originale-
 Da: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] Per conto di Bob Slobodan
 Inviato: lunedì 11 giugno 2012 10:15
 A: osg-users@lists.openscenegraph.org
 Oggetto: Re: [osg-users] Depth test and RenderBin details

 Hi guys,
 First of all, thank you for the answers. Unfortunately, I couldn't solve my 
 problem. I already tried the first solution that consisted in giving 
 different render bin to the axis and the sphere, but then I either have the 
 sphere always on top of the axis, or the axis always on top of the sphere.

 This image illustrates my problem :

 [Image: http://img15.hostingpics.net/pics/490598Sanstitre4.png ] 
 (http://www.hostingpics.net/viewer.php?id=490598Sanstitre4.png)

 The image 1 illustrates what i have  when the sphere has a lower render bin 
 than the axis. The images 2 and 3 illustrates the opposite.
 The image 4 illustrates a shading problem that I have in both situation.

 So what I want is a mix between the image 2 and 5. This is basically what I 
 have when I don't deactivate the depth test and don't use render bin details. 
 But then, if I have anything (like a plane for example) between my dragger 
 and the camera, I won't see it anymore.

 Thank you so much for helping me.

 Cheers,
 Bob

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





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


Re: [osg-users] Set Viewport background color as transparen​t

2012-06-11 Thread Robert Osfield
Hi Vishwa,

On 10 June 2012 14:55, shekhar vishwa vishwa.shek...@gmail.com wrote:
 I have implemented above code in my program, but it doesnot make the
 background transparent. I want to see the underlying views being the
 viewport.

We've provide a *lot* of support and guidance to try and help you out,
there really isn't anything else much we can add.  You aren't clear
about what you are trying to do, and why the suggestions don't work.
Repeating the same questions in the same information poor way isn't
going to help anyone help you.

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


Re: [osg-users] Display the multi lingual text

2012-06-11 Thread John Vidar Larring

Hi Vishma,

First thing to check: Is the c++ file which contains this line of code:

osgText::String* string = newosgText::String(గౌతమి, 
osgText::String::ENCODING_UTF8);


...utf-8 encoded? It has to be since the text is hard-coded in the source.

Second thing to check: does the actual font that you are using include 
the characters in the text? And does the font support uft-8? Use a font 
viewing application to find out.


Best regards,
John

On 06/10/2012 02:50 PM, shekhar vishwa wrote:

Hi
I want to display the multi lingual text. I have implemented following 
code.

osg::ref_ptrosgText::Text text =
newosgText::Text;
osgText::String* string = newosgText::String(గౌతమి, 
osgText::String::ENCODING_UTF8);

std::string test = string-createUTF8EncodedString();
text-setFont(fonts/gautami.ttf);
text-setCharacterSize(20);
text-setPosition(pos);
text-setAxisAlignment(osgText::Text::XY_PLANE);
text-setText(test);
But text is displays as ??? in osg view.
Please help me to display the multi lingual font text.
Thanks
Vishwa
--
This email was Anti Virus checked by Astaro Security Gateway. 
http://www.astaro.com


___
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] Keyboard Event handler Problem

2012-06-11 Thread Koduri Lakshmi
Hi,

I want to get events from the keyboard. To do this I created a class by 
deriving osgGA::GUIEventHandler and implemented hanlder method.

But  my program is not catching the events. Here is my code


Code:
class KeyboardEventHandler : public osgGA::GUIEventHandler
{
bool isImageCaptured;
public:
KeyboardEventHandler(): osgGA::GUIEventHandler()
{
isImageCaptured=false;
}
   virtual bool handle(const osgGA::GUIEventAdapter 
ea,osgGA::GUIActionAdapter);
   
   bool getImageCapFlag()
   {
   return isImageCaptured;
   }
};
bool KeyboardEventHandler::handle(const osgGA::GUIEventAdapter 
ea,osgGA::GUIActionAdapter aa)
 {
  std::coutIn Event Handlerstd::endl;
   switch(ea.getEventType())
   {
   case(osgGA::GUIEventAdapter::KEYDOWN):
  {
 std::coutEvent handerler std::endl;

 switch(ea.getKey())
 {
 case 'i':
std::cout  I Pressed   std::endl;
isImageCaptured=false;
return false;
break;
 default:
return false;
 } 
  }
   default:
  return false;
   }
}



In the above code I am getting In Event Handler message but not getting I 
Pressed. 

I also implemented the following code to take a screen capture. If I remove 
this code than key board events are working


Code:
HMONITOR monitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO info;
info.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(monitor, info);
int XRes = info.rcMonitor.right - info.rcMonitor.left;
int YRes = info.rcMonitor.bottom - info.rcMonitor.top;


traits = new osg::GraphicsContext::Traits;
traits-target = osg::Camera::FRAME_BUFFER_OBJECT;
traits-x =0;
traits-y =0;
traits-width = XRes;
traits-height = YRes;
traits-windowDecoration = true;
traits-doubleBuffer = true;
traits-sharedContext = 0;
traits-pbuffer = false;

gContext= osg::GraphicsContext::createGraphicsContext(traits.get());

viewer-getCamera()-setGraphicsContext(gContext);
gCamera = viewer-getCamera();

gCamera-setViewport(new osg::Viewport(0,0,XRes,YRes));

double fovy, aspectRatio, zNear, zFar;
gCamera-getProjectionMatrixAsPerspective(fovy, aspectRatio, zNear, 
zFar);

fovy+=41.0;

gCamera-setProjectionMatrixAsPerspective(fovy, aspectRatio, zNear, 
zFar);


viewer-setDataVariance(osg::Object::DYNAMIC);
viewer-setThreadingModel(osgViewer::Viewer::SingleThreaded);


sCapImage = new osg::Image;
sCapImage-allocateImage(720, 576, 1, GL_RGB, GL_UNSIGNED_BYTE);
gCamera-attach(osg::Camera::COLOR_BUFFER, sCapImage);





I added setAllowEventFocus(false) for both gCamera and main camera. Even I am 
not getting key board events

Can you please help me where am I doing wrong?


... 

Thank you!

Cheers,
Koduri

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




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


[osg-users] How to draw a tube connecting two geometries

2012-06-11 Thread Michael Schanne
Hi,

I am creating a scene in which there will be two geometries connected by a 
tube.  The geometries can move around in between frames, so the tube must also 
move and resize.  The way I am trying to do this is to have a geometry for a 
tube of unit length and diameter.  Then, if the position of either endpoint 
changes, I recalculate the midpoint and use a translation matrix to move the 
tube there, and give it the correct scaling and rotation to connect the two 
endpoint geometries.

The graph would look something like this:

 Root
  /| \  
 Matrix  MatrixMatrix
   \/\
   Geode  Geode (Tube Geometry)
  (Endpoint Geometry)

Is this the most efficient way to do this?  Is there some way I could tie in to 
the two MatrixTransforms for the endpoints to automatically update the tube's 
location?

... 

Thank you!

Cheers,
Michael

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





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


Re: [osg-users] Help! Particles in OSG 3.0.1 flip halfway through their lifetime...

2012-06-11 Thread Nick Jones
Robert,

  Thank you for your quick reply. It may also be worth noting that if the 
particle system is created at run time, it seems to work correctly. However, 
when the particle system is saved to a file and then read back in is when the 
problem begins to show.

  I am in the process of creating a quick test case to show this. If I get it 
done in time before you find the issue, I'll post it on this thread.

Thank You,
Nick

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





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


Re: [osg-users] Help! Particles in OSG 3.0.1 flip halfway through their lifetime...

2012-06-11 Thread Peter Amstutz
I did encounter this, and I did track it down.  The quick fix is that 
you probably have a line in your particle system .osg file that looks 
like this:


textureTile 1 1 1

To fix the problem, you need to change it to this:

textureTile 0 0 0

Slightly longer explanation:
OSG is interpreting the file slightly differently than it did in 2.8.  
The textureTile parameter controls changing the texture over the life if 
the particle, and in OSG 2.8 the particle generator only lists 
textureTile 1 1 1 it was interpreted as a single texture for the life 
of the particle.  In osg 3.0 it is interpreted as the *second* tile 
(tile index 1), the first being tile index 0.  Since no tile 0 is 
actually specified, OSG creates a default tile 0.  What is happening is 
that partway through the life of the particle, it switches from tile 0 
to tile 1.  Through some mechanism I don't now recall, this causes a 
transform to be applied to the texture coordinates, which is why the 
particle texture gets flipped.


Hope this helps,
- Pete

On 6/8/2012 11:06 AM, Nick Jones wrote:

Hi,

   My project has recently upgraded to OSG 3.0.1. We have a set of particle 
systems that we have been using for a while. After upgrading to OSG 3.0.1 from 
OSG 2.8.1, however, I noticed something strange with the way the particles are 
being updated.  It seems that halfway through the particles' lifetimes, they 
flip vertically.

   In example, I created a simple particle with an image of an arrow pointing 
up. When I run this particle in OSG 2.8.1, the arrow remains pointing up 
throughout the end of its lifetime. When I run it in OSG 3.0.1, the arrow 
starts off pointing up but then suddenly points down at about the halfway mark 
in its lifetime. It remains pointing down until the particle is extinguished.

   Attached in the .zip file is the .osgx of the particle system. If you run it 
in OSG 3.0.1, you'll notice the flipping. If you convert it to an .osg file and 
run it in OSG 2.8.1, you'll notice that it does not flip.

   Has anyone run into this issue before?

   System Information: OSG 3.0.1, Ubuntu 10.04

Thank you!
Nick

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





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



--
Peter Amstutz
Senior Software Engineer
Technology Solutions Experts
Natick, MA
02131

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


[osg-users] server is down !

2012-06-11 Thread Carlos Sanches
Hi .  I m trying to access the OSG website and download by svn the new
version but looks like the that the site is down .
Do you know how long to back on line ?


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


[osg-users] Reset my account

2012-06-11 Thread Glenn, David E CTR NAVAIR, 535100D
Hay! I tried to change my e-mail address and got locked out! Is there any way 
to fix that?

-
Evil Beware! We have Waffles!

D Glenn



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Render to texture, display pre-rendered scene

2012-06-11 Thread Christian Rumpf
This really sounds helpful, Robert, but for some reason this examples you 
recommended aren't understandable for me. They all tells about reflecting, 
printing it into a flag and so on. isn't there an example which just renders a 
single node, a single box or something else into a texture and projects it into 
the viewer? Just a single object, no camera effects, no artefacts, no 
movements, nothing but a single object.

My problem is that all this examples (and I found a lot in the internet) 
explains how useful this RTT technique is, but aren't understandable after all. 
This sounds like I'm not good in graphics programming, but sometimes small 
steps are necessary. I can't take this big stuffs as start.

lg Christian

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





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


Re: [osg-users] server is down !

2012-06-11 Thread Jordi Torres
Hi all,

We are experiencing problems with the old server, it seems there is a
problem with the university network, nothing related to the trac. Now I
can't reach the server using ssh, so till tomorrow I won't be able to take
a look. In the meanwhile you can use the github[1] or mercurial[2] mirror
to get the code.

Sorry for the inconvenience.

[1]
http://www.openscenegraph.com/index.php/downloads/code-repositories/31-git-mirror
[2]
http://www.openscenegraph.com/index.php/downloads/code-repositories/32-mercurial-mirror


2012/6/11 Carlos Sanches ces...@gmail.com

 Hi .  I m trying to access the OSG website and download by svn the new
 version but looks like the that the site is down .
 Do you know how long to back on line ?


 --



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




-- 
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Reset my account

2012-06-11 Thread Robert Osfield
On 11 June 2012 16:30, Glenn, David E CTR NAVAIR, 535100D
david.e.glenn@navy.mil wrote:
 Hay! I tried to change my e-mail address and got locked out! Is there any way 
 to fix that?

Could you be a bit more specific about what email address, what you
got locked out from, what do you mean you got locked out...  Is it
simply that you've forgotten your password for something?

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


Re: [osg-users] Render to texture, display pre-rendered scene

2012-06-11 Thread Robert Osfield
Hi Christian,

I'm afraid I do have time to walk you through the baby steps of this
type of problem.  The OSG has lots of examples, there are several
books, lots of resources you can call upon to learn about the OSG.

Robert.

On 11 June 2012 16:26, Christian Rumpf ru...@student.tugraz.at wrote:
 This really sounds helpful, Robert, but for some reason this examples you 
 recommended aren't understandable for me. They all tells about reflecting, 
 printing it into a flag and so on. isn't there an example which just renders 
 a single node, a single box or something else into a texture and projects it 
 into the viewer? Just a single object, no camera effects, no artefacts, no 
 movements, nothing but a single object.

 My problem is that all this examples (and I found a lot in the internet) 
 explains how useful this RTT technique is, but aren't understandable after 
 all. This sounds like I'm not good in graphics programming, but sometimes 
 small steps are necessary. I can't take this big stuffs as start.

 lg Christian

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





 ___
 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] How to draw a tube connecting two geometries

2012-06-11 Thread Chris Hanson

 I am creating a scene in which there will be two geometries connected by a
 tube.  The geometries can move around in between frames, so the tube must
 also move and resize.  The way I am trying to do this is to have a geometry
 for a tube of unit length and diameter.  Then, if the position of either
 endpoint changes, I recalculate the midpoint and use a translation matrix
 to move the tube there, and give it the correct scaling and rotation to
 connect the two endpoint geometries.
 Is this the most efficient way to do this?


   Without using a vertex shader, this is probably the best way to do it.


 Is there some way I could tie in to the two MatrixTransforms for the
 endpoints to automatically update the tube's location?



  No. Geometries that meet each other can only be under a common
transform.

-- 

Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Render to texture, display pre-rendered scene

2012-06-11 Thread Christian Rumpf
No need anymore, Robert. I finally a homepage which explains everything about 
render to texture:

http://beefdev.blogspot.de/2012/01/render-to-texture-in-openscenegraph.html

It really helped me, and I finally could load my shader files with texture as 
uniform sampler2D. Nevertheless thank you very much, Robert.

lg Christian

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





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


Re: [osg-users] Monitoring time elapsed

2012-06-11 Thread Maia Randria
Hi,

I'd like to know what would be the difference between:
viewer.getViewerFrameStamp()-getReferenceTime();

and 
osg::Timer::instance()-delta_m(startTick,endTick)

in the following codes:


Code:

int main( int argc, char** argv )
{
/* Add models to the scene */
osg::ref_ptrosg::Node model = osgDB::readNodeFile( cessna.osg );

if(model == NULL)
{
osg::notify( osg::FATAL )  Unable to load data file. 
Exiting.  std::endl;
return 1; 
}

/* create the scene graph */
osg::ref_ptrosg::Group root = new osg::Group;
root-addChild( model.get() );

/* view the scene */
osgViewer::Viewer viewer;

/* set scene data */
viewer.setSceneData( root.get() );

// take start time
osg::Timer_t startTick = osg::Timer::instance()-tick();

// Run the viewer
viewer.run();


// take the end of time after viewing 
osg::Timer_t endTick = osg::Timer::instance()-tick();

// time elapsed since osgviewer started running and the model is 
displayed on the screen
double t = viewer.getFrameStamp()-getReferenceTime();

//display elapsed times
cout   With osg::Timer_t, completed in 
osg::Timer::instance()-delta_m(startTick,endTick)  milliseconds endl;
cout   With viewer.getFrameStamp()-getReferenceTime =   t*1000 
  milliseconds  endl;

}




I got very different values, e.g.:

With osg::Timer_t = 2036.44 ms
With viewer.getFrameStamp() = 1887.5 ms

Thank you very much,

Maia


robertosfield wrote:
 Hi Utkarsh,
 
 viewer.getViewerFrameStamp()-getReferenceTime();
 
 Robert.
 
 On 2 May 2012 17:27, Utkarsh Patankar  wrote:
 
  Hi,
  
  In an OSG application, is there any way to find out how much time has 
  elapsed since osgviewer started running? I don't want to use any external 
  time based functions.
  
  Thank you!
  
  Cheers,
  Utkarsh
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=47508#47508
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum

Code:




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





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


[osg-users] Visible vertex count visitor on a subgraph

2012-06-11 Thread Roberto Garrido
Hi there!

We want to develop a visitor to count all visible vertices given a subgraph. 
Our first approach has been the VertexCounter that can be found in 
osgocclusionquery.cpp. 

The problem with this approach is that we get all vertices, but not only the 
visible ones.

What we want to achieve is something like the StatsHandler does for us, but 
only for a subgraph.

Any ideas?

Thank you!

Cheers,
Roberto

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





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


[osg-users] Post-render Camera reusing the Depth Buffer

2012-06-11 Thread Marko Srebre
Hello,

I have the following setup. The main camera renders the scene to frame-buffer. 
Attached in the subgraph below the main camera, there is a post-render camera 
which does its work after the main has completed and renders to texture. 
However, in this second camera I want to reuse the depth buffer from the main 
camera.

I have something like:


Code:

osg::Camera* rt = new osg::Camera;
rt-setRenderOrder(osg::Camera::POST_RENDER, 0);
rt-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
rt-attach(osg::Camera::COLOR_BUFFER, tex);
rt-setClearMask(0);




This doesn't seem to work well, when ClearMask is 0; there are weird artifacts 
in rendering. It works fine when depth is cleared, though this is not what I am 
after. I am guessing that I should explicitly attach the depth buffer (that was 
previously used by main camera), but I am not really sure how to do that. If 
anyone has experience with this or ideas where to look, I'd very much 
appreciate it. Thanks.

Cheers,
Marko[/code]

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





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


Re: [osg-users] Post-render Camera reusing the Depth Buffer

2012-06-11 Thread Sebastian Messerschmidt

Hello Marko,

In my deferred rendering setup I had the same problem.
Just bind the depth buffer in the second pass as input. Just be sure not 
to write to the depth buffer (if you don't want to) by disabling depth 
writes for the pass.

I'm bit busy right now, so just ask me again if the problem persists.
snip

rt-attach(osg::Camera::DEPTH_BUFFER, depth_tex);

/snip

cheers
psy

Hello,

I have the following setup. The main camera renders the scene to frame-buffer. 
Attached in the subgraph below the main camera, there is a post-render camera 
which does its work after the main has completed and renders to texture. 
However, in this second camera I want to reuse the depth buffer from the main 
camera.

I have something like:


Code:

osg::Camera* rt = new osg::Camera;
rt-setRenderOrder(osg::Camera::POST_RENDER, 0);
rt-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
rt-attach(osg::Camera::COLOR_BUFFER, tex);
rt-setClearMask(0);




This doesn't seem to work well, when ClearMask is 0; there are weird artifacts 
in rendering. It works fine when depth is cleared, though this is not what I am 
after. I am guessing that I should explicitly attach the depth buffer (that was 
previously used by main camera), but I am not really sure how to do that. If 
anyone has experience with this or ideas where to look, I'd very much 
appreciate it. Thanks.

Cheers,
Marko[/code]

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





___
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] Monitoring time elapsed

2012-06-11 Thread Robert Osfield
Hi Maia,

The FrameStamo::getReferenceTime() is the reference time for the
current frame, it's updated during the viewer.advance() and isn't
updated till the next advance().  advance() is called as the first
part of the viewer.frame().

Robert.

On 11 June 2012 19:12, Maia Randria
veneree.randrianari...@crulrg.ulaval.ca wrote:
 Hi,

 I'd like to know what would be the difference between:
 viewer.getViewerFrameStamp()-getReferenceTime();

 and
 osg::Timer::instance()-delta_m(startTick,endTick)

 in the following codes:


 Code:

 int main( int argc, char** argv )
 {
        /* Add models to the scene */
        osg::ref_ptrosg::Node model = osgDB::readNodeFile( cessna.osg );

        if(model == NULL)
        {
                osg::notify( osg::FATAL )  Unable to load data file. 
 Exiting.  std::endl;
                return 1;
        }

        /* create the scene graph */
        osg::ref_ptrosg::Group root = new osg::Group;
        root-addChild( model.get() );

        /* view the scene */
        osgViewer::Viewer viewer;

        /* set scene data */
        viewer.setSceneData( root.get() );

        // take start time
        osg::Timer_t startTick = osg::Timer::instance()-tick();

                // Run the viewer
        viewer.run();


        // take the end of time after viewing
        osg::Timer_t endTick = osg::Timer::instance()-tick();

        // time elapsed since osgviewer started running and the model is 
 displayed on the screen
        double t = viewer.getFrameStamp()-getReferenceTime();

        //display elapsed times
        cout   With osg::Timer_t, completed in 
 osg::Timer::instance()-delta_m(startTick,endTick)  milliseconds 
 endl;
        cout   With viewer.getFrameStamp()-getReferenceTime =   t*1000 
   milliseconds  endl;

 }




 I got very different values, e.g.:

 With osg::Timer_t = 2036.44 ms
 With viewer.getFrameStamp() = 1887.5 ms

 Thank you very much,

 Maia


 robertosfield wrote:
 Hi Utkarsh,

 viewer.getViewerFrameStamp()-getReferenceTime();

 Robert.

 On 2 May 2012 17:27, Utkarsh Patankar  wrote:

  Hi,
 
  In an OSG application, is there any way to find out how much time has 
  elapsed since osgviewer started running? I don't want to use any external 
  time based functions.
 
  Thank you!
 
  Cheers,
  Utkarsh
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=47508#47508
 
 
 
 
 
  ___
  osg-users mailing list
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 ___
 osg-users mailing list

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

  --
 Post generated by Mail2Forum

 Code:




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





 ___
 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] Monitoring time elapsed

2012-06-11 Thread Maia Randria
OK, thank you very much.
Maia


robertosfield wrote:
 Hi Maia,
 
 The FrameStamo::getReferenceTime() is the reference time for the
 current frame, it's updated during the viewer.advance() and isn't
 updated till the next advance().  advance() is called as the first
 part of the viewer.frame().
 
 Robert.
 
 On 11 June 2012 19:12, Maia Randria
  wrote:
 
  Hi,
  
  I'd like to know what would be the difference between:
  viewer.getViewerFrameStamp()-getReferenceTime();
  
  and
  osg::Timer::instance()-delta_m(startTick,endTick)
  
  in the following codes:
  
  
  Code:
  
  int main( int argc, char** argv )
  {
         /* Add models to the scene */
         osg::ref_ptrosg::Node model = osgDB::readNodeFile( cessna.osg );
  
         if(model == NULL)
         {
                 osg::notify( osg::FATAL )  Unable to load data file. 
  Exiting.  std::endl;
                 return 1;
         }
  
         /* create the scene graph */
         osg::ref_ptrosg::Group root = new osg::Group;
         root-addChild( model.get() );
  
         /* view the scene */
         osgViewer::Viewer viewer;
  
         /* set scene data */
         viewer.setSceneData( root.get() );
  
         // take start time
         osg::Timer_t startTick = osg::Timer::instance()-tick();
  
                 // Run the viewer
         viewer.run();
  
  
         // take the end of time after viewing
         osg::Timer_t endTick = osg::Timer::instance()-tick();
  
         // time elapsed since osgviewer started running and the model is 
  displayed on the screen
         double t = viewer.getFrameStamp()-getReferenceTime();
  
         //display elapsed times
         cout   With osg::Timer_t, completed in 
  osg::Timer::instance()-delta_m(startTick,endTick)  milliseconds 
  endl;
         cout   With viewer.getFrameStamp()-getReferenceTime =   
  t*1000   milliseconds  endl;
  
  }
  
  
  
  
  I got very different values, e.g.:
  
  With osg::Timer_t = 2036.44 ms
  With viewer.getFrameStamp() = 1887.5 ms
  
  Thank you very much,
  
  Maia
  
  
  robertosfield wrote:
  
   Hi Utkarsh,
   
   viewer.getViewerFrameStamp()-getReferenceTime();
   
   Robert.
   
   On 2 May 2012 17:27, Utkarsh Patankar  wrote:
   
   
Hi,

In an OSG application, is there any way to find out how much time has 
elapsed since osgviewer started running? I don't want to use any 
external time based functions.

Thank you!

Cheers,
Utkarsh

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





___
osg-users mailing list

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


   ___
   osg-users mailing list
   
   http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
   
    --
   Post generated by Mail2Forum
   
  
  Code:
  
  
  
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=48177#48177
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


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





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


Re: [osg-users] Post-render Camera Reusing the Depth-buffer

2012-06-11 Thread Marko Srebre
Hello Sebastian,

thanks for a quick reply. I wanted to do something like that, but I am missing 
the depth_tex part. The first camera doesn't render to texture, but to a 
classical frame buffer/depth_buffer. The second camera is then RTT, but it 
should be using the depth buffer from the first one.

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





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


Re: [osg-users] Reset my account

2012-06-11 Thread David Glenn
Well, it sent me an e-mail to fix it! Think I'm up and running agein! Sorry for 
the bother!!

D Glenn


David Glenn
---
D Glenn 3D Computer Graphics amp; Media Systems.
www.dglenn.com

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





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


Re: [osg-users] Help! Particles in OSG 3.0.1 flip halfway through their lifetime...

2012-06-11 Thread Nick Jones
Pete,

  That did it for me! It works once I changed the .osg file from 1 1 1 to 0 0 
0. Thank you very much for your help.

Thank You,
Nick

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





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