Re: [osg-users] Browser integration

2008-11-03 Thread Ralph Kern
Just use Google Translate for it. It is able to give you a basic
english translation, which is not perfect but understandable.

regards Ralph

Andreas Goebel schrieb:
 Hello Wang Rui,
 
 if this is all code needed, it is quite simple. Very nice! Thank you for
 posting this.
 
 Unfortunately I do not understand enough to see if this would be useful
 for me. Maybe my interest motivates you to translate your wiki (at least
 this part of it) to english, I am sure other users could benefit from it
 as well.
 
 Regards,
 
 Andreas
 

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


Re: [osg-users] RenderBin understanding

2008-11-03 Thread Wang Rui
Hi Peter,


 what I'm asking:
 -if an object has a parent osg::Group that has been set to RenderBin with
 a value of 10 and the object itself uses
 RenderBin with a value of 20 then which is used?


I think the object should be rendered after its parent, no matter whose bin
number is greater, because renderbins are generated in
CullVisitor::pushStateSet().
And the CullVisitor will traverse nodes from parents to children.


  -an .osg file can have renderbin values too? so if I load an .osg file
 and set it to have RenderBin 10 do I override the renderbin values
 in the file? or are they pushed relative to my given value 10? sometimes
 the .osg file consist of many renderbin values.


I think bin number and bin name can both be stored in .osg files. And the
root node of file would also have renderbin settings if you set one.

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


[osg-users] Varying shader variable /= 0 in vertex shader, is == 0 in fragment shader

2008-11-03 Thread Engvall Åsa
Hi osg-users!

I'm trying to write my first shader, it is a very simple test program which 
sets the color on a sphere. 
The color depends on whether the sphere has moved relative to its position in 
the previous frame.

I use two varying variables, which are set in the vertex shader, see the code 
below. If the sphere has moved, the variable called displacementNDC is /= 0.
Then I expect that it should still be /= 0 in the fragment shader, but by some 
reason the value is == 0.
The other varying variable, green, does not change when going from vertex 
shader to fragment shader.
(Just for test, I also tried to put the variable called currentPosClip in a 
varying variable. Testing for currentPosClip == 0 in the vertex shader returned 
false, but it returned true in the fragment shader.)

Please, can anybody explain what is happening? Why are the values changing to 
zero?

Regards, 
Asa 

---Vertex shader --
uniform mat4 prevModelViewProjectionMatrix;
varying vec2 displacementNDC;
varying vec4 green; 

void main()
{
// Calculate the previous and current position in clip space.
vec4 currentPosClip = gl_ModelViewProjectionMatrix*gl_Vertex;   // 
Transforms vertex position 
vec4 previousPosClip = prevModelViewProjectionMatrix*gl_Vertex; // from 
object space to clip space.

gl_Position = ftransform(); 

// Calculate displacement in NDC space.
vec2 displacementNDC = currentPosClip.xy/currentPosClip.w - 
previousPosClip.xy/previousPosClip.w;

// If the displacement is zero, varying variable green is set to the RGBA 
value for green.
if (displacementNDC == vec2(0,0))   // 
Object has not moved.
green = vec4(0, 1, 0, 0);
else
// Object has moved.
green = vec4(0.0);
}
---End vertex shader --

---Fragment shader --
varying vec2 displacementNDC;
varying vec4 green; 

void main()
{
if (displacementNDC == vec2(0,0))
gl_FragColor = vec4(1,0,0,1) + green;
else
gl_FragColor = vec4(0,0,1,1) + green;
}
---End fragment shader --


When the sphere has moved, the resulting color should be blue. But it becomes 
red.

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


Re: [osg-users] Debugging using Visual Studio

2008-11-03 Thread Jean-Sébastien Guay

Hi Renan,

I've realized I wasn't too specific... Next time I'll come with details. 
But thanks, anyway.


Yes, that will help pinpoint the problem. As I said, you should be able 
to debug without too much trouble, so if you're having problems, we can 
help you get through them.


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


Re: [osg-users] RenderBin understanding

2008-11-03 Thread Peter Wraae Marino
thanks, this helped.

the nested makes perfect sense..
i'm on track again,

once again thanks,
peter

On Mon, Nov 3, 2008 at 3:06 PM, Lionel Lagarde [EMAIL PROTECTED]wrote:

 Hi Peter,

 Peter Wraae Marino wrote:

 Hi Users,

 trying to clarify some specs on the renderbin, perhaps someone could help:

 what I'm assuming:
 -there are two default renderbins created at startup RenderBin and
 DepthSortedBin
 -DepthSortedBin is always render after RenderBin
 -DepthSortedBin sorts objects from back to front
 -higher renderbin number means rendering is done later
 -renderbins are sorted by states

 what I'm asking:
 -if an object has a parent osg::Group that has been set to RenderBin with
 a value of 10 and the object itself uses
 RenderBin with a value of 20 then which is used?


 RenderBins are nested. If a node has a bin number different from the
 current render bin (or its StateSet render bin mode is set
 to override), a new render bin is created and is added to the current
 render bin. It become the current render bin.

 So, if a node has a bin number of 20 and it is different from the current
 bin number, a render bin 20 is added to the current
 render bin.

  -an .osg file can have renderbin values too? so if I load an .osg file
 and set it to have RenderBin 10 do I override the renderbin values
 in the file? or are they pushed relative to my given value 10? sometimes
 the .osg file consist of many renderbin values.


 An osg file can contain render bin values. If you load an osg file and set
 the render bin number of the root node to 10, you don't
 override the render bin numbers of the nodes (or just the render bin number
 of the root node). Because render bins are nested
 during the scene culling, it will force the cull visitor to create a
 specific render bin for the whole sub-graph.

  --
 Regards,
 Peter Wraae Marino

 www.osghelp.com - OpenSceneGraph support site

 --

 ___
 osg-users mailing [EMAIL 
 PROTECTED]://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




-- 
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] auto-capture example: capturing an image from a PagedLOD Database

2008-11-03 Thread John Vidar Larring

Hi Robert,

 One way around this would be just write a custom CullVisitor that
 kicks of the database request for a given camera set up.

Just one small problem, where would I add the custom CullVisitor? 
Neither osgViewer::Viewer nor any of its base classes has any public 
methods for assigning a custom CullVisitor to the Cull traversal. This 
is only (as far as I can see) available in the depricated SceneView 
class...!?


Should I add a void setCullVisitor (osgUtil::CullVisitor *cv) to 
osgViewer::ViewerBase so that the assigned CullVisitor can be assed to 
there Renderer's cull() method?


Or have I just misunderstood your suggestion? Furthermore, I am not 
quite sure how a custom CullVisitor would to the trick, since what I 
want to do is to run the cull visitor but avoid rendering the the result;)


Best Regards,
John

Robert Osfield wrote:

Hi John,

I'll do a review of the submission and provide a bit more in the way
of thoughts once completed.

In terms of possible optimizations, disabling the precompile and only
doing the update, event, and cull would be probably the most efficient
way to get tiles loaded, then once the tiles are loaded do the final
render.   The awkward part of this is that the cull and draw are
closely coupled in the Viewer...

One way around this would be just write a custom CullVisitor that
kicks of the database request for a given camera set up.

Robert.



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [osg-users] Many light0 in the same scene ?

2008-11-03 Thread Sukender
Hi,

About the openGL limitation of 8 lights: I recently coded a small and simple 
light sources manager. Its goal is to simply switch on the most important 
light sources of the current RenderStage. By most important, I mean that each 
source has a priority you can define (depending on the intensity, the distance 
to the camera, etc.). It's NOT a way to have more than 8 lights per 
RenderStage, but it simplifies some uses.
It's included in PVLE (my small game engine - http://pvle.sourceforge.net/ ) 
and used in a tiny game (Paratrooper - 
http://sukender.free.fr/paratrooper/index_en.php ).
The code is rather independant of the engine ; so feel free to use the 
LightSourceManager from the code. Just also feel free to send back improvements 
and potential fixes!...

Sincerely,

Sukender


PS: for example, in the game, there are 2 global lights (always on) and 
explosions and flares. When explosions + flares 6, the manager switches off 
the less intense lights.

Browse for PVLE sources : http://pvle.svn.sourceforge.net/viewvc/pvle/
Last LightSourceManager header : 
http://pvle.svn.sourceforge.net/viewvc/pvle/trunk/Include/PVLE/3D/LightSourceManager.h?view=markup





Le Fri, 24 Oct 2008 10:33:53 +0200, Robert Osfield [EMAIL PROTECTED] a écrit:

 HI Kevin,

 RIght now the way to do multiple lights is to use the OpenGL hardware
 lights GL_LIGHT0... GL_LIGHT7, must this is limited just one entry per
 light per RenderStage.  To scale up to more lights than 8 then you
 have use tricks with multiple RenderStage.  This topics is rather
 complex and has been discussed on osg-users alot previously so please
 search the archives for info on it.

 Robert.

 On Fri, Oct 24, 2008 at 8:59 AM, Kévin FAURE [EMAIL PROTECTED] wrote:
 Hi everyone,

 I have a problem with light. Later, my scene should be consist of a
 multitude of planetary system each lit by a light, and for this reason that
 I would have several light0.
I have also seen the project osgmanylights but this method doesn't suit
 me.

For now, I have done a very simple osg file which display four spheres,
 two on the left side of the scene and two on the right side. My two lights
 are also located on both sides of the scene, each in a sphere.
I would like use many light0 in my scene but osg display only the last.
 Here is a screenshot with two light0 :

 a href=http://imageshack.us;img
 src=http://img185.imageshack.us/img185/4232/light0sj6.png; border=0
 alt=Image Hosted by ImageShack.us//abr/a
 href=http://g.imageshack.us/img185/light0sj6.png/1/;img
 src=http://img185.imageshack.us/img185/light0sj6.png/1/w652.png;
 border=0/a

 Only the last light0 (one the right) is displayed.

 I have tried to understand the RenderStage and RenderBin class but for now,
 still nothing...

 Regards.



 ___
 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] RenderBin understanding

2008-11-03 Thread Jeremy Moles
Whoops, forgot to attach.

MONDAY... *sigh*

On Mon, 2008-11-03 at 09:48 -0500, Jeremy Moles wrote:
 Here's a quick example you can use to play around with RenderBin
 settings; notice how you can make one object appear on top of another,
 just by changing the binNum.
 
 I'm not sure if this is a worth examples addition, but perhaps.
 
 On Mon, 2008-11-03 at 15:19 +0100, Peter Wraae Marino wrote:
  thanks, this helped.
   
  the nested makes perfect sense.. 
  i'm on track again,
   
  once again thanks,
  peter
  
  
  On Mon, Nov 3, 2008 at 3:06 PM, Lionel Lagarde
  [EMAIL PROTECTED] wrote:
  Hi Peter, 
  
  
  Peter Wraae Marino wrote: 
   Hi Users,

   trying to clarify some specs on the renderbin, perhaps
   someone could help:

   what I'm assuming:
   -there are two default renderbins created at startup
   RenderBin and DepthSortedBin
   -DepthSortedBin is always render after RenderBin
   -DepthSortedBin sorts objects from back to front
   -higher renderbin number means rendering is done later
   -renderbins are sorted by states

   what I'm asking:
   -if an object has a parent osg::Group that has been set to
   RenderBin with a value of 10 and the object itself uses 
   RenderBin with a value of 20 then which is used?
  
  
  RenderBins are nested. If a node has a bin number different
  from the current render bin (or its StateSet render bin mode
  is set
  to override), a new render bin is created and is added to the
  current render bin. It become the current render bin.
  
  So, if a node has a bin number of 20 and it is different from
  the current bin number, a render bin 20 is added to the
  current
  render bin. 
  
  
   -an .osg file can have renderbin values too? so if I load
   an .osg file and set it to have RenderBin 10 do I override
   the renderbin values
   in the file? or are they pushed relative to my given value
   10? sometimes the .osg file consist of many renderbin
   values. 
   
   
  
  
  An osg file can contain render bin values. If you load an osg
  file and set the render bin number of the root node to 10, you
  don't
  override the render bin numbers of the nodes (or just the
  render bin number of the root node). Because render bins are
  nested
  during the scene culling, it will force the cull visitor to
  create a specific render bin for the whole sub-graph.
  
   -- 
   Regards,
   Peter Wraae Marino
   
   www.osghelp.com - OpenSceneGraph support site
   
   
   
   
   ___
   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
  
  
  
  
  -- 
  Regards,
  Peter Wraae Marino
  
  www.osghelp.com - OpenSceneGraph support site
  ___
  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
 
#include osg/Geode
#include osg/Geometry
#include osg/MatrixTransform
#include osgViewer/Viewer
#include osgViewer/ViewerEventHandlers

osg::Geometry* createGeometry(int renderBin, const osg::Vec4 color)
{
static osg::Vec3::value_type size = 1.0f;

osg::Geometry*  geom= new osg::Geometry();
osg::Vec3Array* coords  = new osg::Vec3Array(4);
osg::Vec4Array* colors  = new osg::Vec4Array(1);
osg::Vec3Array* normals = new osg::Vec3Array(1);

(*coords)[0]  = osg::Vec3(-size, 0.0f, -size);
(*coords)[1]  = osg::Vec3(size, 0.0f, -size);
(*coords)[2]  = osg::Vec3(size, 0.0f, size);
(*coords)[3]  = osg::Vec3(-size, 0.0f, size);
(*colors)[0]  = color;
(*normals)[0] = osg::Vec3(0.0f, -1.0f, 0.0f);

geom-setVertexArray(coords);
geom-setColorArray(colors);
geom-setColorBinding(osg::Geometry::BIND_OVERALL);
geom-setNormalArray(normals);
geom-setNormalBinding(osg::Geometry::BIND_OVERALL);
geom-addPrimitiveSet(new 

Re: [osg-users] RenderBin understanding

2008-11-03 Thread Lionel Lagarde




Hi Peter,

Peter Wraae Marino wrote:

  Hi Users,
  
  trying to clarify some specs on the renderbin, perhaps someone
could help:
  
  whatI'm assuming:
  -there are two default renderbins created at startup "RenderBin"
and "DepthSortedBin"
  -"DepthSortedBin" is always render after "RenderBin"
  -"DepthSortedBin"sorts objects from back to front
  -higher renderbin number means rendering is done later
  -renderbins are sorted by states
  
  what I'm asking:
  -if an object has a parent osg::Group that has been set to
"RenderBin" with a value of 10 and the object itself uses 
  "RenderBin" with a value of 20 then which is used?


RenderBins are nested. If a node has a bin number different from the
current render bin (or its StateSet render bin mode is set
to override), a new render bin is created and is added to the current
render bin. It become the current render bin.

So, if a node has a bin number of 20 and it is different from the
current bin number, a render bin 20 is added to the current
render bin.


  -an .osg file can have renderbin values too? so if I load an
.osg file and set it to have "RenderBin" 10 do I override the renderbin
values
  in the file? or are they pushed relative to my given value 10?
sometimes the .osg file consist of many renderbin values. 
  
  


An osg file can contain render bin values. If you load an osg file and
set the render bin number of the root node to 10, you don't
override the render bin numbers of the nodes (or just the render bin
number of the root node). Because render bins are nested
during the scene culling, it will force the cull visitor to create a
specific render bin for the whole sub-graph.


  -- 
Regards,
Peter Wraae Marino
  
  www.osghelp.com
- OpenSceneGraph support site
  
  

___
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] RenderBin understanding

2008-11-03 Thread Jeremy Moles
Here's a quick example you can use to play around with RenderBin
settings; notice how you can make one object appear on top of another,
just by changing the binNum.

I'm not sure if this is a worth examples addition, but perhaps.

On Mon, 2008-11-03 at 15:19 +0100, Peter Wraae Marino wrote:
 thanks, this helped.
  
 the nested makes perfect sense.. 
 i'm on track again,
  
 once again thanks,
 peter
 
 
 On Mon, Nov 3, 2008 at 3:06 PM, Lionel Lagarde
 [EMAIL PROTECTED] wrote:
 Hi Peter, 
 
 
 Peter Wraae Marino wrote: 
  Hi Users,
   
  trying to clarify some specs on the renderbin, perhaps
  someone could help:
   
  what I'm assuming:
  -there are two default renderbins created at startup
  RenderBin and DepthSortedBin
  -DepthSortedBin is always render after RenderBin
  -DepthSortedBin sorts objects from back to front
  -higher renderbin number means rendering is done later
  -renderbins are sorted by states
   
  what I'm asking:
  -if an object has a parent osg::Group that has been set to
  RenderBin with a value of 10 and the object itself uses 
  RenderBin with a value of 20 then which is used?
 
 
 RenderBins are nested. If a node has a bin number different
 from the current render bin (or its StateSet render bin mode
 is set
 to override), a new render bin is created and is added to the
 current render bin. It become the current render bin.
 
 So, if a node has a bin number of 20 and it is different from
 the current bin number, a render bin 20 is added to the
 current
 render bin. 
 
 
  -an .osg file can have renderbin values too? so if I load
  an .osg file and set it to have RenderBin 10 do I override
  the renderbin values
  in the file? or are they pushed relative to my given value
  10? sometimes the .osg file consist of many renderbin
  values. 
  
  
 
 
 An osg file can contain render bin values. If you load an osg
 file and set the render bin number of the root node to 10, you
 don't
 override the render bin numbers of the nodes (or just the
 render bin number of the root node). Because render bins are
 nested
 during the scene culling, it will force the cull visitor to
 create a specific render bin for the whole sub-graph.
 
  -- 
  Regards,
  Peter Wraae Marino
  
  www.osghelp.com - OpenSceneGraph support site
  
  
  
  
  ___
  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
 
 
 
 
 -- 
 Regards,
 Peter Wraae Marino
 
 www.osghelp.com - OpenSceneGraph support site
 ___
 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] Error compiling plugin collada 2.1 and osg 2.6.1

2008-11-03 Thread Adonai S . Canêz
Hi,

 

I'm trying compile osg 2.6.1 and collada dom 2.1, but I am taking errors
during compilatiom. I am create the project of osg with Cmake 2.6.2 and
compile the source of collada with built.bat localted in
\colladadom\dom\projects\vc8. I'm put the file generated
libcollada14dom21-s.lib and libcollada14dom21-sd.lib to folder \3drParty\lib
and copied folder \colladadom\dom\include to folder 3rdParty. 

The erros is down.

 

libcollada14dom21-s.lib(daeURI.obj) : error LNK2019: unresolved external
symbol private: static bool __cdecl pcrecpp::Arg::parse_string(char const
*,int,void *) ([EMAIL PROTECTED]@pcrecpp@@[EMAIL PROTECTED]) referenced in
function public: __thiscall pcrecpp::Arg::Arg(class
std::basic_stringchar,struct std::char_traitschar,class
std::allocatorchar  *)
([EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@std@@[EMAIL PROTECTED]
@2@@std@@@Z)

 

libcollada14dom21-s.lib(daeLIBXMLPlugin.obj) : error LNK2019: unresolved
external symbol _xmlStrlen referenced in function unsigned char * __cdecl
`anonymous namespace'::utf8ToLatin1(unsigned char const *)
([EMAIL PROTECTED]@@[EMAIL PROTECTED])

 

C:\Documents and Settings\adonai\My Documents\Visual Studio
2005\Projects\OpenSceneGraph-2.6.1\bin\Release\..\osgPlugins-2.6.1\osgdb_dae
.dll : fatal error LNK1120: 36 unresolved externals
Build log was saved at file://c:\Documents file:///c:\Documents  and
Settings\adonai\My Documents\Visual Studio
2005\Projects\OpenSceneGraph-2.6.1\src\osgPlugins\dae\osgdb_dae.dir\Release\
BuildLog.htm
Plugins dae - 37 error(s), 128 warning(s)

 

  _  

Novos endereços, o Yahoo! que você conhece. Crie
http://br.rd.yahoo.com/mail/taglines/mail/*http:/br.new.mail.yahoo.com/addr
esses  um email novo com a sua cara @ymail.com ou @rocketmail.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] deadlock loading io plugin?

2008-11-03 Thread Max Pfingsthorn
Dear list,

I have a very simple program such as this:

int main(int argc, char** argv) {
osg::ArgumentParser arguments(argc,argv);
cout  start!  endl;

osg::ref_ptrosg::Node loadedModel = osgDB::readNodeFiles(arguments);

if (!loadedModel)
{
cout  argv[0] : No data loaded  endl;
return 1;
}

cout  loaded  endl;
}

I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
8.04. The program hangs on the line with osgDB::readNodeFiles. I have
no idea why.

This is what GDB says:

#0  0xb7fc8410 in __kernel_vsyscall ()
#1  0xb75c4589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb75bfba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
#3  0xb75bf58a in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
#4  0xb76b3ea6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
#5  0xb785ce43 in OpenThreads::Mutex::lock () from
/usr/local/OpenSceneGraph/lib/libOpenThreads.so.11
#6  0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
/usr/local/OpenSceneGraph/lib/libosg.so.50
#7  0xb7d4bcbc in osgDB::Registry::addReaderWriter () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#8  0xb7350e0e in __static_initialization_and_destruction_0 () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#9  0xb7364325 in __do_global_ctors_aux () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#10 0xb730bb50 in _init () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#11 0xb7fd6990 in ?? () from /lib/ld-linux.so.2
#12 0xb7fd6ac3 in ?? () from /lib/ld-linux.so.2
#13 0xb7fda774 in ?? () from /lib/ld-linux.so.2
#14 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#15 0xb7fd9f4e in ?? () from /lib/ld-linux.so.2
#16 0xb73ac98d in ?? () from /lib/tls/i686/cmov/libdl.so.2
#17 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#18 0xb73ac2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
#19 0xb73aca0f in dlopen () from /lib/tls/i686/cmov/libdl.so.2
#20 0xb7d26005 in osgDB::DynamicLibrary::getLibraryHandle () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#21 0xb7d262a9 in osgDB::DynamicLibrary::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#22 0xb7d4875c in osgDB::Registry::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#23 0xb7d57b25 in osgDB::Registry::read () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#24 0xb7d58d35 in osgDB::Registry::readImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#25 0xb7d594b4 in osgDB::Registry::readNodeImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#26 0xb7d44fed in osgDB::readNodeFile () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#27 0xb7d46651 in osgDB::readNodeFiles () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#28 0x080511ab in osgDB::readNodeFiles ([EMAIL PROTECTED]) at
/usr/local/OpenSceneGraph/include/osgDB/ReadFile:132
#29 0x08050df8 in main (argc=2, argv=0xbfc260e4) at src/main.cc:30

This looks like there is a deadlock somewhere, otherwise
pthread_mutex_lock() wouldn't block. The same happens with cessna.osg
file from the sample files, however frames 8-10 are in osgdb_osg.so,
of course. Any ideas? I've already rebuilt OSG once, no luck.

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


Re: [osg-users] Building a modified

2008-11-03 Thread Jeremy Moles
On Mon, 2008-11-03 at 09:51 -0600, Ed wrote:
 I am trying out OSG by taking an example and modifying it.  I have 
 pulled the example out from under the OSG tree and put it in my dev 
 tree.  When building OSG, I used the BUILD_EXAMPLES flag (or whatever it 
 was, the exact name escapes me at this moment).  How do I build my 
 modified example?  I ran ccmake . in the folder of my modified example,

If all you did was modify an existing example in place, just re-run make
from the original folder in which you built OSG; if nothing else has
changed, only the example will be rebuilt. Alternatively, you can run:

# make example_osgfoo

...which will save you a few seconds.

If you added a new example, that's a bit more work--but not much. Just
edit examples/CMakeLists.txt and examples/$MYEXAMPLE/CMakeLists.txt
appropriately.

 which I thought was a way to generate the make files, but I get the 
 following when I try to configure.
 
  CMake Error at CMakeLists.txt:7 (SETUP_EXAMPLE):
Unknown CMake command SETUP_EXAMPLE.
 
 
 
  CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present.  A line of code such as
 
  cmake_minimum_required(VERSION 2.6)
 
should be added at the top of the file.  The version specified may be 
 lower
if you wish to support older CMake versions for this project.  For more
information run cmake --help-policy CMP.
  This warning is for project developers.  Use -Wno-dev to suppress it.
 
 Ed
 
 ___
 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] Untextured materials = pure black

2008-11-03 Thread Jefferson Pinheiro
Can you tell me, please, how to set a default texture for the root?

2008/11/2 Jean-Sébastien Guay [EMAIL PROTECTED]

 Hi Jefferson,

 Just to add to what Terry said:

  b) set a simple default texture (for example, a 1x1 white texture) on
 the root node of your scene.


 This is what ShadowMap does (and the new ViewDependentShadow too) which is
 why you don't have that problem when using ShadowMap. SoftShadowMap could be
 modified to do it too, but hasn't yet, which probably just means not too
 many people use it.

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

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




-- 
Jefferson Pinheiro
(51) 9192 3535
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] deadlock loading io plugin?

2008-11-03 Thread Robert Osfield
Hi Max,

Do the osg examples fail in a similar way?

Could you do a clean build of the OSG and your app and try again?

Robert.

On Mon, Nov 3, 2008 at 4:08 PM, Max Pfingsthorn
[EMAIL PROTECTED] wrote:
 Dear list,

 I have a very simple program such as this:

 int main(int argc, char** argv) {
osg::ArgumentParser arguments(argc,argv);
cout  start!  endl;

osg::ref_ptrosg::Node loadedModel = osgDB::readNodeFiles(arguments);

if (!loadedModel)
{
cout  argv[0] : No data loaded  endl;
return 1;
}

cout  loaded  endl;
 }

 I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
 8.04. The program hangs on the line with osgDB::readNodeFiles. I have
 no idea why.

 This is what GDB says:

 #0  0xb7fc8410 in __kernel_vsyscall ()
 #1  0xb75c4589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
 #2  0xb75bfba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
 #3  0xb75bf58a in pthread_mutex_lock () from 
 /lib/tls/i686/cmov/libpthread.so.0
 #4  0xb76b3ea6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
 #5  0xb785ce43 in OpenThreads::Mutex::lock () from
 /usr/local/OpenSceneGraph/lib/libOpenThreads.so.11
 #6  0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
 /usr/local/OpenSceneGraph/lib/libosg.so.50
 #7  0xb7d4bcbc in osgDB::Registry::addReaderWriter () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #8  0xb7350e0e in __static_initialization_and_destruction_0 () from
 /usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
 #9  0xb7364325 in __do_global_ctors_aux () from
 /usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
 #10 0xb730bb50 in _init () from
 /usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
 #11 0xb7fd6990 in ?? () from /lib/ld-linux.so.2
 #12 0xb7fd6ac3 in ?? () from /lib/ld-linux.so.2
 #13 0xb7fda774 in ?? () from /lib/ld-linux.so.2
 #14 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
 #15 0xb7fd9f4e in ?? () from /lib/ld-linux.so.2
 #16 0xb73ac98d in ?? () from /lib/tls/i686/cmov/libdl.so.2
 #17 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
 #18 0xb73ac2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
 #19 0xb73aca0f in dlopen () from /lib/tls/i686/cmov/libdl.so.2
 #20 0xb7d26005 in osgDB::DynamicLibrary::getLibraryHandle () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #21 0xb7d262a9 in osgDB::DynamicLibrary::loadLibrary () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #22 0xb7d4875c in osgDB::Registry::loadLibrary () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #23 0xb7d57b25 in osgDB::Registry::read () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #24 0xb7d58d35 in osgDB::Registry::readImplementation () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #25 0xb7d594b4 in osgDB::Registry::readNodeImplementation () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #26 0xb7d44fed in osgDB::readNodeFile () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #27 0xb7d46651 in osgDB::readNodeFiles () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #28 0x080511ab in osgDB::readNodeFiles ([EMAIL PROTECTED]) at
 /usr/local/OpenSceneGraph/include/osgDB/ReadFile:132
 #29 0x08050df8 in main (argc=2, argv=0xbfc260e4) at src/main.cc:30

 This looks like there is a deadlock somewhere, otherwise
 pthread_mutex_lock() wouldn't block. The same happens with cessna.osg
 file from the sample files, however frames 8-10 are in osgdb_osg.so,
 of course. Any ideas? I've already rebuilt OSG once, no luck.

 Thank you!
 max
 ___
 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] animtk release 0.0.9

2008-11-03 Thread Jeremy Moles
On Sun, 2008-11-02 at 23:05 +0200, Ümit Uzun wrote:
 Hi Sukender,
 
 I will try this week again and I wonder get success. I am new to cmake
 too, so it will take time as you guess.

I'm pretty sure that J-S got pkg-config in Windows when he installed (or
had already installed) The Gimp for Windows when messing around w/
osgCairo and whatnot. I could be wrong, but this is the path I will be
taking when I try it on my own machine...

 Regards.
 
 2008/11/2 Sukender [EMAIL PROTECTED]
 Hello Umıt Uzun,
 
 I propose you and I (an any other that wants) work a little
 bit on porting animTK to Windows. Do you agree?
 Unfortunately, I'm completely new to CMake (as I said before)
 and I will not be very helpful fot that. But I think I'll be
 able to adapt the code so that it will be more portable. I
 created a VisualC++ (8 SP1 Express) project by commenting a
 few lines of the CMake script:
 INCLUDE(FindPkgConfig)
 and
 PKG_CHECK_MODULES(LIBXML REQUIRED libxml-2.0)
 
 I'm trying to compile but I have one main problem: I don't
 have much time! Well, if you are a little bit patient, then
 you'll receive soon the work I did.
 
 'till next time!
 
 --
 Sukender
 
 
 Le Sat, 01 Nov 2008 08:48:37 +0100, Ümit Uzun
 [EMAIL PROTECTED] a écrit:
 
  Hi Sukender,
 
  I have same problem under Windows. If you achive, please
 show how. And
  another question to Cedric and Robert, In which version
 osganimation library
  will be added ?
 
  Best Regards.
 
  Umıt Uzun
 
  2008/11/1 Sukender [EMAIL PROTECTED]
 
   Yes i guess i would need to add export in order it
 compiles on windows.
 
  Hum... I'm interested in using animTK in a cross-platform
 way... I tried to
  CMake-it under Windows but it can't find pkg-config (of
 course). I guess the
  CMake script has to be changed, but I'm new to CMake and I
 can't. I will try
  to bybass that problem. If I get something compiled under
 Windows, I'll let
  you know.
  But if anyone did it before, please tell me!
 
  Sukender
  ___
  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
 
 
 
 -- 
 Ümit Uzun,
 Environmental Tectonics Corporation Turkey
 ODTU Teknokent
 Gumus Bloklar A Blok
 Zemin Kat Bati Cephe Suit 1
 06531 ODTU
 Ankara, Turkey
 Tel: 90 (312) 210 17 80
 Fax: 90 (312) 210 17 84
 E-Mail: umituzun84atgmaildotcom
 Website: http://www.etc-turkey.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


Re: [osg-users] VNC client done in 3D

2008-11-03 Thread Robert Osfield
Hi All,

At the start of this thread I mentioned my plan to move this
functionality into a plugin, this work is now complete, so you can do:

  osgviewer 10.0.0.1.vnc

And it'll open create a quad with an image attached as vnc client, the
quad has an osgViewer::InteractiveImageHandler attached to it to
enable it to automatically catch events and redirect them into the vnc
client via the image.

You can also just load the image using 10.0.0.1.vnc and then create
your own geometry and associate the event handler to this.  I have
modified the osgvnc example to use this approach, and also enable it
to open multiple vnc client quads at one time.

  osgvnc --host 10.0.0.1 --host 10.0.0.2

LibVNCServer doesn't always succeed in opening a connection so you
might not always see all the quads you expect as quads are only
created for successful connections.

One final note, LibVNCServer is GPL'd, the the plugin is GPL'd as well.

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


Re: [osg-users] Error compiling plugin collada 2.1 and osg 2.6.1

2008-11-03 Thread Wilhelm Medetz
I have successfully built OpenSceneGraph 2.6.1 with Collada 2.1 under
VisualStudio 2008.

 

I set COLLADA_USE_STATIC to true and made the following changes 

 

OpenSceneGraph\Plugins\dae

Linker|Input|Ignore specific library[Debug]: msvcrt.lib

Linker|Input|Additional Dependencies[Debug]:

 
..\..\..\..\colladadom\dom\external-libs\libxml2\win32\lib\libxml2_a.lib

   ..\..\..\..\colladadom\dom\external-libs\libxml2\win32\lib\zlib.lib

   ..\..\..\..\colladadom\dom\external-libs\pcre\lib\vc9\pcre-d.lib

   ..\..\..\..\colladadom\dom\external-libs\pcre\lib\vc9\pcrecpp-d.lib

Linker|Input|Additional Dependencies[Release]:

 
..\..\..\..\colladadom\dom\external-libs\libxml2\win32\lib\libxml2_a.lib

   ..\..\..\..\colladadom\dom\external-libs\libxml2\win32\lib\zlib.lib

   ..\..\..\..\colladadom\dom\external-libs\pcre\lib\vc9\pcre.lib

   ..\..\..\..\colladadom\dom\external-libs\pcre\lib\vc9\pcrecpp.lib

 

Then both the Release and the Debug build worked fine.

You should change the above paths to .\vc8\... for Visual Studio 2005.

 

Hope this helps.

 

Wilhelm Medetz

 

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


Re: [osg-users] auto-capture example: capturing an image from a PagedLOD Database

2008-11-03 Thread John Vidar Larring

Hi,

 A custom cull visitor wouldn't be related to the osgViewer, rather
 it's something you'd instantiate and call yourself on demand.  The
 custom cull visitor needn't even subclass from CullVisitor.  The
 subclass from IntersectionVisitor with a Polytope representing the
 view frustum way actually be the best place to start.

Before I read Roberts response I tried to follow a different route to 
solve the speed problem. The basic strategy was to sub-class 
osgViewer::Renderer and implement the operator() so that only cull 
(not draw) was done during osgViewer::ViewerBase::renderTraversals() 
while PagedLOD were being loaded:


[...snip...]
class CustomRenderer : public osgViewer::Renderer
{
public:
CustomRenderer(osg::Camera* camera)
: osgViewer::Renderer(camera),
  _cullOnly(true)
{
setTargetFrameRate(1);
setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1);
}

void setCullOnly(bool on) { _cullOnly = on; }

void operator () (osg::GraphicsContext* /*context*/)
{
if (_graphicsThreadDoesCull)
{
if (_cullOnly)
cull();
else
cull_draw();
}
}

void cull()
{
osgUtil::SceneView* sceneView = _sceneView[0].get();
if (!sceneView || _done ) return;

updateSceneView(sceneView);

	osgViewer::View* view = 
dynamic_castosgViewer::View*(_camera-getView());
	if (view) 
sceneView-setFusionDistance(view-getFusionDistanceMode(), 
view-getFusionDistanceValue());


sceneView-inheritCullSettings(*(sceneView-getCamera()));
sceneView-cull();
}

bool _cullOnly;
};
[...snip...]


The CustomRenderer was installed and used as shown below:

[...snip...]
// Install custom renderer
 osg::ref_ptrCustomRenderer customRenderer = new 
CustomRenderer(getCamera());

 getCamera()-setRenderer(customRenderer);

// Initiate the first PagedLOD request
frame();

osgDB::DatabasePager* pager = getDatabasePager();
osg::Timer_t beforeLoadTick = osg::Timer::instance()-tick();

// Keep updating and culling until full level of detail is reached
while(!done()  pager-getRequestsInProgress())
{
updateTraversal();
renderingTraversals();
}
osg::Timer_t afterLoadTick = osg::Timer::instance()-tick();

std::coutTime used to load all PageLODs = 
osg::Timer::instance()-delta_s(beforeLoadTick, afterLoadTick) 
secondsstd::endl;


// Do cull _and_ draw to render the scene correctly
customRenderer-setCullOnly(false);

// Add the WindowCaptureCallback now that we have full resolution
getCamera()-setFinalDrawCallback(new 
WindowCaptureCallback(GL_BACK, _fileName));


// Do rendering with capture callback
renderingTraversals();

// Automatically close after capture
close();
[...snip...]


The image rendered just fine, but the time saved was minimal / 
insignificant. On average the above approach yields a load time of 
approx. 47.2 seconds, while the original load time without the 
CustomRenderer was about 48.8 seconds. An improvement of only 0.04% is 
quite disappointing, and could just as well be ascribed to other factors.


At the time of implementation the approach seemed like a clever idea, 
but the timing results shows that it has a big flaw. Is it the approach 
or the implementation that is flawed? (The complete example is attached 
to this email.)


PS: The database pager was configured as follows;

osgDB::DatabasePager* pager = viewerWindow-getDatabasePager();
pager-setTargetFrameRate(1);
pager-setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1);
pager-setMaximumNumOfObjectsToCompilePerFrame(100);
pager-setDoPreCompile(false);

I guess I'll try the IntersectionVisitor approach now, but I'm not 
totally convinced that this will be any faster if it is the colling that 
makes things go slow.


Best regards,
John

Robert Osfield wrote:

Hi John,

A custom cull visitor wouldn't be related to the osgViewer, rather
it's something you'd instantiate and call yourself on demand.  The
custom cull visitor needn't even subclass from CullVisitor.  The
subclass from IntersectionVisitor with a Polytope representing the
view frustum way actually be the best place to start.


Robert.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



osgautocapture.tgz
Description: GNU Zip compressed data
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] HeadUpDisplay Problem

2008-11-03 Thread Ümit Uzun
Hi Folks,

I have tried to create HUD for textured quad. I have read all about archive
and looked to osgHUD sample but it isn't working for textured quad. And same
time given code works for text. I can create HUD text on the screen but can
not create textured quad on the screen. I know giving lots of code isn't
good for you but I will paste all of them if anyone want to look for find
out the problem.

If created texture quad add as a child to the root node, it works without
giving any problem. But if add as a child to the osg::Camera node it get
visible and is seen nothing. I think so, the problem is in osg::Camera node
which was initilazed by;

/--Camera-/
  // create a camera to set up the projection and model view matrices, and
the subgraph to drawn in the HUD
   osg::ref_ptrosg::Camera camera = new osg::Camera;

   // set the projection matrix
   camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));

   // set the view matrix
   camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
   camera-setViewMatrix(osg::Matrix::identity());

   // only clear the depth buffer
   camera-setClearMask(GL_DEPTH_BUFFER_BIT);

   // draw subgraph after main camera view.
   camera-setRenderOrder(osg::Camera::POST_RENDER);

   // add geode to the camera node as a child
   camera-addChild( geode );
/--Camera-/

Best Regards.
-- 
Ümit Uzun,
Environmental Tectonics Corporation Turkey
ODTU Teknokent
Gumus Bloklar A Blok
Zemin Kat Bati Cephe Suit 1
06531 ODTU
Ankara, Turkey
Tel: 90 (312) 210 17 80
Fax: 90 (312) 210 17 84
E-Mail: umituzun84atgmaildotcom
Website: http://www.etc-turkey.com

/---HUD---/
int main()
{
   osg::Vec3 coords[] =
   {
  osg::Vec3(-1, 0.f ,-1), //LL
  osg::Vec3( 1, 0.f, -1), //LR
  osg::Vec3( 1, 0.f, 1), //UR
  osg::Vec3( -1, 0.f, 1) //UL
   };

   osg::Vec2 tCoords[] =
   {
  osg::Vec2(0,0),
  osg::Vec2(1,0),
  osg::Vec2(1,1),
  osg::Vec2(0,1)
   };

   int numCoords = sizeof(coords) / sizeof(osg::Vec3);
   int numTexCoords = sizeof(tCoords) / sizeof(osg::Vec2);

  osg::ref_ptrosg::Group root = new osg::Group();
  osgViewer::Viewer viewer;
  osg::Geode *geode = new osg::Geode();
  osg::Geometry *quad = new osg::Geometry();

  quad-setVertexArray(new osg::Vec3Array(numCoords, coords));
  quad-setTexCoordArray(0, new osg::Vec2Array(numTexCoords, tCoords));
  quad-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS, 0,
numCoords));

  geode-addDrawable(quad);

  osg::Image* image = osgDB::readImageFile( RWR_256_256.bmp );
  if (image == NULL)
  {
  osg::notify(osg::WARN)  Can't find texture file:  std::endl;
  }

  osg::Texture2D* texture = new osg::Texture2D();
  texture-setImage(image);
  texture-setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::REPEAT);
  texture-setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::REPEAT);

  osg::StateSet *stateSet = quad-getOrCreateStateSet();
  stateSet-setTextureAttributeAndModes(0, texture,
osg::StateAttribute::ON);
  stateSet-setMode(GL_BLEND,osg::StateAttribute::ON);
  stateSet-setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
  stateSet-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

   // create a camera to set up the projection and model view matrices, and
the subgraph to drawn in the HUD
   osg::ref_ptrosg::Camera camera = new osg::Camera;

   // set the projection matrix
   camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));

   // set the view matrix
   camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
   camera-setViewMatrix(osg::Matrix::identity());

   // only clear the depth buffer
   camera-setClearMask(GL_DEPTH_BUFFER_BIT);

   // draw subgraph after main camera view.
   camera-setRenderOrder(osg::Camera::POST_RENDER);

   // add geode to the camera node as a child
   camera-addChild(geode);

   // add  camera to the root node as a child
   root-addChild(camera.get());

   viewer.setSceneData(root.get());
   viewer.setCameraManipulator(new osgGA::TrackballManipulator());

   viewer.run();

   return 0;
}
/---HUD---/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Intersections with Particle Effects

2008-11-03 Thread Sause, William
Hi

 

I am trying to do intersections with particle effects, however I am not
getting any hits returned since Particle system does not have
intersection support.  Robert suggested implementing the
Drawable::accept(PrimtiveFunctor) method in osgParticle::ParticleSystem.
For reference, I looked at the implementations of this method in
Geometry and ShapeDrawable, but they were quite different from each
other and a little confusing.  Can anyone shed some light on this?  

 

Thanks,

 

Bill

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


Re: [osg-users] deadlock loading io plugin?

2008-11-03 Thread Csaba Halász
On Mon, Nov 3, 2008 at 5:08 PM, Max Pfingsthorn
[EMAIL PROTECTED] wrote:

 I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
 8.04. The program hangs on the line with osgDB::readNodeFiles. I have
 no idea why.

 This is what GDB says:
 #6  0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
 /usr/local/OpenSceneGraph/lib/libosg.so.50

Works here.
As the call stack shows a ReentrantMutex, the thread can not deadlock
on itself. Thus, another thread must be involved. Please check call
stacks for all threads. Also, if you have debugging symbols, you could
check the _threadHoldingMutex member of the ReentrantMutex to see who
is the owner.

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


Re: [osg-users] deadlock loading io plugin?

2008-11-03 Thread Max Pfingsthorn
Hi Robert,

no, it doesn't seem so. The osgviewer works fine. I did a clean build
just before.

There is only one thread says info threads...

I'm stumped. Seems only to happen on apps I compile seperately.

Cheers,
max

Robert Osfield wrote:
 Hi Max,
 
 Do the osg examples fail in a similar way?
 
 Could you do a clean build of the OSG and your app and try again?
 
 Robert.
 
 On Mon, Nov 3, 2008 at 4:08 PM, Max Pfingsthorn
 [EMAIL PROTECTED] wrote:
 Dear list,

 I have a very simple program such as this:

 int main(int argc, char** argv) {
osg::ArgumentParser arguments(argc,argv);
cout  start!  endl;

osg::ref_ptrosg::Node loadedModel = osgDB::readNodeFiles(arguments);

if (!loadedModel)
{
cout  argv[0] : No data loaded  endl;
return 1;
}

cout  loaded  endl;
 }

 I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
 8.04. The program hangs on the line with osgDB::readNodeFiles. I have
 no idea why.

 This is what GDB says:

 #0  0xb7fc8410 in __kernel_vsyscall ()
 #1  0xb75c4589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
 #2  0xb75bfba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
 #3  0xb75bf58a in pthread_mutex_lock () from 
 /lib/tls/i686/cmov/libpthread.so.0
 #4  0xb76b3ea6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
 #5  0xb785ce43 in OpenThreads::Mutex::lock () from
 /usr/local/OpenSceneGraph/lib/libOpenThreads.so.11
 #6  0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
 /usr/local/OpenSceneGraph/lib/libosg.so.50
 #7  0xb7d4bcbc in osgDB::Registry::addReaderWriter () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #8  0xb7350e0e in __static_initialization_and_destruction_0 () from
 /usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
 #9  0xb7364325 in __do_global_ctors_aux () from
 /usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
 #10 0xb730bb50 in _init () from
 /usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
 #11 0xb7fd6990 in ?? () from /lib/ld-linux.so.2
 #12 0xb7fd6ac3 in ?? () from /lib/ld-linux.so.2
 #13 0xb7fda774 in ?? () from /lib/ld-linux.so.2
 #14 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
 #15 0xb7fd9f4e in ?? () from /lib/ld-linux.so.2
 #16 0xb73ac98d in ?? () from /lib/tls/i686/cmov/libdl.so.2
 #17 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
 #18 0xb73ac2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
 #19 0xb73aca0f in dlopen () from /lib/tls/i686/cmov/libdl.so.2
 #20 0xb7d26005 in osgDB::DynamicLibrary::getLibraryHandle () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #21 0xb7d262a9 in osgDB::DynamicLibrary::loadLibrary () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #22 0xb7d4875c in osgDB::Registry::loadLibrary () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #23 0xb7d57b25 in osgDB::Registry::read () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #24 0xb7d58d35 in osgDB::Registry::readImplementation () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #25 0xb7d594b4 in osgDB::Registry::readNodeImplementation () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #26 0xb7d44fed in osgDB::readNodeFile () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #27 0xb7d46651 in osgDB::readNodeFiles () from
 /usr/local/OpenSceneGraph/lib/libosgDB.so.50
 #28 0x080511ab in osgDB::readNodeFiles ([EMAIL PROTECTED]) at
 /usr/local/OpenSceneGraph/include/osgDB/ReadFile:132
 #29 0x08050df8 in main (argc=2, argv=0xbfc260e4) at src/main.cc:30

 This looks like there is a deadlock somewhere, otherwise
 pthread_mutex_lock() wouldn't block. The same happens with cessna.osg
 file from the sample files, however frames 8-10 are in osgdb_osg.so,
 of course. Any ideas? I've already rebuilt OSG once, no luck.

 Thank you!
 max
 ___
 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] HeadUpDisplay Problem

2008-11-03 Thread Jeremy Moles
On Mon, 2008-11-03 at 18:56 +0200, Ümit Uzun wrote:
 Hi Folks,
 
 I have tried to create HUD for textured quad. I have read all about
 archive and looked to osgHUD sample but it isn't working for textured
 quad. And same time given code works for text. I can create HUD text
 on the screen but can not create textured quad on the screen. I know
 giving lots of code isn't good for you but I will paste all of them if
 anyone want to look for find out the problem. 

I really think you should try using osgWidget; even in it's very young
stage of development, it can handle easy stuff like this without a
hitch. And, of course, I'm very responsive to questions about it so
you're bound to get the help you need (except on the weekends, which I
waste playing video games).

If I have my way, all e-mails about creating custom HUDs will be
gone. :)

 If created texture quad add as a child to the root node, it works
 without giving any problem. But if add as a child to the osg::Camera
 node it get visible and is seen nothing. I think so, the problem is in
 osg::Camera node which was initilazed by;
 
 /--Camera-/
   // create a camera to set up the projection and model view matrices,
 and the subgraph to drawn in the HUD
osg::ref_ptrosg::Camera camera = new osg::Camera;
 
// set the projection matrix
camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
 
// set the view matrix
camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera-setViewMatrix(osg::Matrix::identity());
 
// only clear the depth buffer
camera-setClearMask(GL_DEPTH_BUFFER_BIT);
 
// draw subgraph after main camera view.
camera-setRenderOrder(osg::Camera::POST_RENDER);

// add geode to the camera node as a child 
camera-addChild( geode );
 /--Camera-/
 
 Best Regards.
 -- 
 Ümit Uzun,
 Environmental Tectonics Corporation Turkey
 ODTU Teknokent
 Gumus Bloklar A Blok
 Zemin Kat Bati Cephe Suit 1
 06531 ODTU
 Ankara, Turkey
 Tel: 90 (312) 210 17 80
 Fax: 90 (312) 210 17 84
 E-Mail: umituzun84atgmaildotcom
 Website: http://www.etc-turkey.com
 
 /---HUD---/
 int main()
 {
osg::Vec3 coords[] =
{
   osg::Vec3(-1, 0.f ,-1), //LL
   osg::Vec3( 1, 0.f, -1), //LR
   osg::Vec3( 1, 0.f, 1), //UR
   osg::Vec3( -1, 0.f, 1) //UL
};
 
osg::Vec2 tCoords[] =
{  
   osg::Vec2(0,0),
   osg::Vec2(1,0),
   osg::Vec2(1,1),
   osg::Vec2(0,1)
};
 
int numCoords = sizeof(coords) / sizeof(osg::Vec3);
int numTexCoords = sizeof(tCoords) / sizeof(osg::Vec2);
 
   osg::ref_ptrosg::Group root = new osg::Group();
   osgViewer::Viewer viewer;
   osg::Geode *geode = new osg::Geode();
   osg::Geometry *quad = new osg::Geometry();
 
   quad-setVertexArray(new osg::Vec3Array(numCoords, coords));
   quad-setTexCoordArray(0, new osg::Vec2Array(numTexCoords,
 tCoords));
   quad-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,
 0, numCoords));
   
   geode-addDrawable(quad);
 
   osg::Image* image = osgDB::readImageFile( RWR_256_256.bmp );
   if (image == NULL)
   {
   osg::notify(osg::WARN)  Can't find texture file: 
 std::endl;
   }
 
   osg::Texture2D* texture = new osg::Texture2D();
   texture-setImage(image);
   texture-setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::REPEAT);
   texture-setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::REPEAT);
 
   osg::StateSet *stateSet = quad-getOrCreateStateSet();
   stateSet-setTextureAttributeAndModes(0, texture,
 osg::StateAttribute::ON);
   stateSet-setMode(GL_BLEND,osg::StateAttribute::ON);
   stateSet-setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
   stateSet-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
 
// create a camera to set up the projection and model view
 matrices, and the subgraph to drawn in the HUD
osg::ref_ptrosg::Camera camera = new osg::Camera;
 
// set the projection matrix
camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
 
// set the view matrix
camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera-setViewMatrix(osg::Matrix::identity());
 
// only clear the depth buffer
camera-setClearMask(GL_DEPTH_BUFFER_BIT);
 
// draw subgraph after main camera view.
camera-setRenderOrder(osg::Camera::POST_RENDER);

// add geode to the camera node as a child 
camera-addChild(geode);
 
// add  camera to the root node as a child
root-addChild(camera.get());
 
viewer.setSceneData(root.get());
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
 
viewer.run();
 
return 0;
 }
 /---HUD---/
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 

Re: [osg-users] deadlock loading io plugin?

2008-11-03 Thread Csaba Halász
On Mon, Nov 3, 2008 at 6:12 PM, Robert Osfield [EMAIL PROTECTED] wrote:

 If this all fails then it looks like there is a bug in ReentrantMutex.

Hmm, looking at it, I wonder why the thread checking is disabled in
the unlock path? Is it for performance reasons? (couldn't find the
relevant svn comment) Don't think this could cause deadlock, rather
quite the opposite.
Also, is the _lockCountMutex at all necessary? At first glance the
_lockCount value is only ever modified from the owner thread and that
can not cause problems.

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


Re: [osg-users] animtk release 0.0.9

2008-11-03 Thread Jean-Sébastien Guay

Hi all,


I'm pretty sure that J-S got pkg-config in Windows when he installed (or
had already installed) The Gimp for Windows when messing around w/
osgCairo and whatnot. I could be wrong, but this is the path I will be
taking when I try it on my own machine...


Yes, you can get a gtk binary installer with pkg-config and all the gtk 
libs which might work for you.


Although I don't think requiring gtk for animtk would be a good choice. 
In the case of osgCairo/osgPango, you need some gtk libs anyways, so 
it's ok. But animtk doesn't require any of that does it? (I genuinely 
don't know)


I think it would be better to make a completely cross-platform CMake 
config which can generate build files without requiring anything other 
than CMake and your compiler/development tool.


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


Re: [osg-users] animtk release 0.0.9

2008-11-03 Thread Jeremy Moles
On Mon, 2008-11-03 at 13:07 -0500, Jean-Sébastien Guay wrote:
 Hi all,
 
  I'm pretty sure that J-S got pkg-config in Windows when he installed (or
  had already installed) The Gimp for Windows when messing around w/
  osgCairo and whatnot. I could be wrong, but this is the path I will be
  taking when I try it on my own machine...
 
 Yes, you can get a gtk binary installer with pkg-config and all the gtk 
 libs which might work for you.
 
 Although I don't think requiring gtk for animtk would be a good choice. 
 In the case of osgCairo/osgPango, you need some gtk libs anyways, so 
 it's ok. But animtk doesn't require any of that does it? (I genuinely 
 don't know)

osgPango and osgCairo require their respective libs (but not GTK, that's
way larger and unnecessary and is only used for creating interface), but
AnimTK certainly doesn't require any of that stuff. As a matter of fact,
with the changes that Cedric is introducing, I'd be surprised if
pkg-config is really required at all anymore--it's just used for
libxml2, and now that it uses native OSG format, XML may be a moot
point.

Maybe I can use my POWERS OF INFLUENCE to convince him. :)

 I think it would be better to make a completely cross-platform CMake 
 config which can generate build files without requiring anything other 
 than CMake and your compiler/development tool.
 
 J-S

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


Re: [osg-users] VNC client done in 3D

2008-11-03 Thread Jean-Sébastien Guay

Hi Robert,


  osgvnc --host 10.0.0.1 --host 10.0.0.2


Just curious, what if the VNC server requests a password? Is there a 
command-line argument to specify this?


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


Re: [osg-users] animtk release 0.0.9

2008-11-03 Thread Jean-Sébastien Guay

Hi Jeremy,


osgPango and osgCairo require their respective libs (but not GTK, that's
way larger and unnecessary and is only used for creating interface),


Yeah, sorry, that was me being overly ambiguous... I meant that pango 
and cairo are libs that are required by gtk and thus are part of gtk 
binary packages (which makes it convenient to get them as part of such 
packages - which in turn means you'll have gotten pkg-config indirectly).



AnimTK certainly doesn't require any of that stuff. As a matter of fact,
with the changes that Cedric is introducing, I'd be surprised if
pkg-config is really required at all anymore--it's just used for
libxml2, and now that it uses native OSG format, XML may be a moot
point.


Cool, I think that would be best. pkg-config is really not standard on 
Windows so if it's possible to do without it, great.


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


Re: [osg-users] VNC client done in 3D

2008-11-03 Thread Robert Osfield
Hi J-S.

On Mon, Nov 3, 2008 at 6:08 PM, Jean-Sébastien Guay
[EMAIL PROTECTED] wrote:
 Hi Robert,

  osgvnc --host 10.0.0.1 --host 10.0.0.2

 Just curious, what if the VNC server requests a password? Is there a
 command-line argument to specify this?

I haven't implemented the code to handle passwords yet.  There is the
osgDB::AthenticationMap that is currently used by the libcurl plugin
that could be reused for the vnc plugin.

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


Re: [osg-users] Varying shader variable /= 0 in vertex shader, is == 0 in fragment shader

2008-11-03 Thread Andreas Lindmark
This line:
vec2 displacementNDC = currentPosClip.xy/currentPosClip.w -
previousPosClip.xy/previousPosClip.w;
should be
displacementNDC = currentPosClip.xy/currentPosClip.w -
previousPosClip.xy/previousPosClip.w;

Otherwise you will be declaring a new variable with the name displacementNDC
the main function as scope.

/Andreas

2008/11/3 Engvall Åsa [EMAIL PROTECTED]

  Hi osg-users!

 I'm trying to write my first shader, it is a very simple test program which
 sets the color on a sphere.
 The color depends on whether the sphere has moved relative to its position
 in the previous frame.

 I use two varying variables, which are set in the vertex shader, see the
 code below. If the sphere has moved, the variable called displacementNDC is
 /= 0.

 Then I expect that it should still be /= 0 in the fragment shader, but by
 some reason the value is == 0.
 The other varying variable, green, does not change when going from vertex
 shader to fragment shader.
 (Just for test, I also tried to put the variable called currentPosClip in a
 varying variable. Testing for currentPosClip == 0 in the vertex shader
 returned false, but it returned true in the fragment shader.)

 Please, can anybody explain what is happening? Why are the values changing
 to zero?

 Regards,
 Asa

 ---Vertex shader --
 uniform mat4 prevModelViewProjectionMatrix;
 varying vec2 displacementNDC;
 varying vec4 green;

 void main()
 {
 // Calculate the previous and current position in clip space.
 vec4 currentPosClip = gl_ModelViewProjectionMatrix*gl_Vertex;   //
 Transforms vertex position
 vec4 previousPosClip = prevModelViewProjectionMatrix*gl_Vertex; //
 from object space to clip space.

 gl_Position = ftransform();

 // Calculate displacement in NDC space.
 vec2 displacementNDC = currentPosClip.xy/currentPosClip.w -
 previousPosClip.xy/previousPosClip.w;

 // If the displacement is zero, varying variable green is set to the
 RGBA value for green.
 if (displacementNDC == vec2(0,0))   //
 Object has not moved.
 green = vec4(0, 1, 0, 0);
 else
 // Object has moved.
 green = vec4(0.0);
 }
 ---End vertex shader --

 ---Fragment shader --
 varying vec2 displacementNDC;
 varying vec4 green;

 void main()
 {
 if (displacementNDC == vec2(0,0))
 gl_FragColor = vec4(1,0,0,1) + green;
 else
 gl_FragColor = vec4(0,0,1,1) + green;
 }
 ---End fragment shader --

 When the sphere has moved, the resulting color should be blue. But it
 becomes red.

 ___
 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] HeadUpDisplay Problem

2008-11-03 Thread Ümit Uzun
Hi Jeremy,

Thanks for reply. My target with creating HUD display is playing osgMovie
imagestreamed texture in it. If I can achive this operation by osgWidget I
glad to use this API. And if it is possible, which osgWidget sample should I
glimps? Because I have never tried osgWidget before except looking built-in
samples in osg.

Best Regards.

2008/11/3 Jeremy Moles [EMAIL PROTECTED]

 On Mon, 2008-11-03 at 18:56 +0200, Ümit Uzun wrote:
  Hi Folks,
 
  I have tried to create HUD for textured quad. I have read all about
  archive and looked to osgHUD sample but it isn't working for textured
  quad. And same time given code works for text. I can create HUD text
  on the screen but can not create textured quad on the screen. I know
  giving lots of code isn't good for you but I will paste all of them if
  anyone want to look for find out the problem.

 I really think you should try using osgWidget; even in it's very young
 stage of development, it can handle easy stuff like this without a
 hitch. And, of course, I'm very responsive to questions about it so
 you're bound to get the help you need (except on the weekends, which I
 waste playing video games).

 If I have my way, all e-mails about creating custom HUDs will be
 gone. :)

  If created texture quad add as a child to the root node, it works
  without giving any problem. But if add as a child to the osg::Camera
  node it get visible and is seen nothing. I think so, the problem is in
  osg::Camera node which was initilazed by;
 
 
 /--Camera-/
// create a camera to set up the projection and model view matrices,
  and the subgraph to drawn in the HUD
 osg::ref_ptrosg::Camera camera = new osg::Camera;
 
 // set the projection matrix
 camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
 
 // set the view matrix
 camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
 camera-setViewMatrix(osg::Matrix::identity());
 
 // only clear the depth buffer
 camera-setClearMask(GL_DEPTH_BUFFER_BIT);
 
 // draw subgraph after main camera view.
 camera-setRenderOrder(osg::Camera::POST_RENDER);
 
 // add geode to the camera node as a child
 camera-addChild( geode );
 
 /--Camera-/
 
  Best Regards.
  --
  Ümit Uzun,
  Environmental Tectonics Corporation Turkey
  ODTU Teknokent
  Gumus Bloklar A Blok
  Zemin Kat Bati Cephe Suit 1
  06531 ODTU
  Ankara, Turkey
  Tel: 90 (312) 210 17 80
  Fax: 90 (312) 210 17 84
  E-Mail: umituzun84atgmaildotcom
  Website: http://www.etc-turkey.com
 
 
 /---HUD---/
  int main()
  {
 osg::Vec3 coords[] =
 {
osg::Vec3(-1, 0.f ,-1), //LL
osg::Vec3( 1, 0.f, -1), //LR
osg::Vec3( 1, 0.f, 1), //UR
osg::Vec3( -1, 0.f, 1) //UL
 };
 
 osg::Vec2 tCoords[] =
 {
osg::Vec2(0,0),
osg::Vec2(1,0),
osg::Vec2(1,1),
osg::Vec2(0,1)
 };
 
 int numCoords = sizeof(coords) / sizeof(osg::Vec3);
 int numTexCoords = sizeof(tCoords) / sizeof(osg::Vec2);
 
osg::ref_ptrosg::Group root = new osg::Group();
osgViewer::Viewer viewer;
osg::Geode *geode = new osg::Geode();
osg::Geometry *quad = new osg::Geometry();
 
quad-setVertexArray(new osg::Vec3Array(numCoords, coords));
quad-setTexCoordArray(0, new osg::Vec2Array(numTexCoords,
  tCoords));
quad-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,
  0, numCoords));
 
geode-addDrawable(quad);
 
osg::Image* image = osgDB::readImageFile( RWR_256_256.bmp );
if (image == NULL)
{
osg::notify(osg::WARN)  Can't find texture file: 
  std::endl;
}
 
osg::Texture2D* texture = new osg::Texture2D();
texture-setImage(image);
texture-setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::REPEAT);
texture-setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::REPEAT);
 
osg::StateSet *stateSet = quad-getOrCreateStateSet();
stateSet-setTextureAttributeAndModes(0, texture,
  osg::StateAttribute::ON);
stateSet-setMode(GL_BLEND,osg::StateAttribute::ON);
stateSet-setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
stateSet-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
 
 // create a camera to set up the projection and model view
  matrices, and the subgraph to drawn in the HUD
 osg::ref_ptrosg::Camera camera = new osg::Camera;
 
 // set the projection matrix
 camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
 
 // set the view matrix
 camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
 camera-setViewMatrix(osg::Matrix::identity());
 
 // only clear the depth buffer
 camera-setClearMask(GL_DEPTH_BUFFER_BIT);
 
 // draw subgraph after main camera view.
 camera-setRenderOrder(osg::Camera::POST_RENDER);
 
 // add geode to the 

Re: [osg-users] animtk release 0.0.9

2008-11-03 Thread Sukender
I agree: pkg-config should be replaced by a CMake find module for appropriate 
libs (that is to say libxml, if needed).

Sukender


Le Mon, 03 Nov 2008 19:19:03 +0100, Jean-Sébastien Guay [EMAIL PROTECTED] a 
écrit:

 Hi Jeremy,

 osgPango and osgCairo require their respective libs (but not GTK, that's
 way larger and unnecessary and is only used for creating interface),

 Yeah, sorry, that was me being overly ambiguous... I meant that pango
 and cairo are libs that are required by gtk and thus are part of gtk
 binary packages (which makes it convenient to get them as part of such
 packages - which in turn means you'll have gotten pkg-config indirectly).

 AnimTK certainly doesn't require any of that stuff. As a matter of fact,
 with the changes that Cedric is introducing, I'd be surprised if
 pkg-config is really required at all anymore--it's just used for
 libxml2, and now that it uses native OSG format, XML may be a moot
 point.

 Cool, I think that would be best. pkg-config is really not standard on
 Windows so if it's possible to do without it, great.

 J-S

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


Re: [osg-users] Untextured materials = pure black

2008-11-03 Thread Jean-Sébastien Guay

Hello Jefferson,


Can you tell me, please, how to set a default texture for the root?


See src/osgShadow/ShadowMap.cpp around line 290, which starts with this 
comment:


// fake texture for baseTexture, add a fake texture
// we support by default at least one texture layer
// without this fake texture we can not support
// textured and not textured scene

You can set this 1x1 white texture at the root of your graph, and if any 
node has a different texture on unit 0 it will override it automatically.


Hope this helps,

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


Re: [osg-users] HeadUpDisplay Problem

2008-11-03 Thread Jeremy Moles
On Mon, 2008-11-03 at 21:10 +0200, Ümit Uzun wrote:
 Hi Jeremy,
 
 Thanks for reply. My target with creating HUD display is playing
 osgMovie imagestreamed texture in it. If I can achive this operation
 by osgWidget I glad to use this API. And if it is possible, which
 osgWidget sample should I glimps? Because I have never tried osgWidget
 before except looking built-in samples in osg.

Here's basically all you need:

---

WindowManager* wm = new WindowManager(...);
Box*   box= new Box(...);
Widget*widget = new Widget(...);
ImageStream*   stream = new ImageStream(...);

widget-setImage(stream, true);

box-addWidget(widget);

wm-addChild(box);

viewer.setSceneData(wm-createParentOrthoCamera(...));

---

Send me your ImageStream data directly (not over the lists) and I'll
whip up a real example if you wish. :)

 Best Regards.
 
 2008/11/3 Jeremy Moles [EMAIL PROTECTED]
 On Mon, 2008-11-03 at 18:56 +0200, Ümit Uzun wrote:
  Hi Folks,
 
  I have tried to create HUD for textured quad. I have read
 all about
  archive and looked to osgHUD sample but it isn't working for
 textured
  quad. And same time given code works for text. I can create
 HUD text
  on the screen but can not create textured quad on the
 screen. I know
  giving lots of code isn't good for you but I will paste all
 of them if
  anyone want to look for find out the problem.
 
 
 I really think you should try using osgWidget; even in it's
 very young
 stage of development, it can handle easy stuff like this
 without a
 hitch. And, of course, I'm very responsive to questions about
 it so
 you're bound to get the help you need (except on the weekends,
 which I
 waste playing video games).
 
 If I have my way, all e-mails about creating custom HUDs
 will be
 gone. :)
 
 
  If created texture quad add as a child to the root node, it
 works
  without giving any problem. But if add as a child to the
 osg::Camera
  node it get visible and is seen nothing. I think so, the
 problem is in
  osg::Camera node which was initilazed by;
 
  
 /--Camera-/
// create a camera to set up the projection and model view
 matrices,
  and the subgraph to drawn in the HUD
 osg::ref_ptrosg::Camera camera = new osg::Camera;
 
 // set the projection matrix
 
  camera-setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
 
 // set the view matrix
 camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
 camera-setViewMatrix(osg::Matrix::identity());
 
 // only clear the depth buffer
 camera-setClearMask(GL_DEPTH_BUFFER_BIT);
 
 // draw subgraph after main camera view.
 camera-setRenderOrder(osg::Camera::POST_RENDER);
 
 // add geode to the camera node as a child
 camera-addChild( geode );
  
 /--Camera-/
 
  Best Regards.
  --
  Ümit Uzun,
  Environmental Tectonics Corporation Turkey
  ODTU Teknokent
  Gumus Bloklar A Blok
  Zemin Kat Bati Cephe Suit 1
  06531 ODTU
  Ankara, Turkey
  Tel: 90 (312) 210 17 80
  Fax: 90 (312) 210 17 84
  E-Mail: umituzun84atgmaildotcom
  Website: http://www.etc-turkey.com
 
  
 /---HUD---/
  int main()
  {
 osg::Vec3 coords[] =
 {
osg::Vec3(-1, 0.f ,-1), //LL
osg::Vec3( 1, 0.f, -1), //LR
osg::Vec3( 1, 0.f, 1), //UR
osg::Vec3( -1, 0.f, 1) //UL
 };
 
 osg::Vec2 tCoords[] =
 {
osg::Vec2(0,0),
osg::Vec2(1,0),
osg::Vec2(1,1),
osg::Vec2(0,1)
 };
 
 int numCoords = sizeof(coords) / sizeof(osg::Vec3);
 int numTexCoords = sizeof(tCoords) / sizeof(osg::Vec2);
 
osg::ref_ptrosg::Group root = new osg::Group();
osgViewer::Viewer viewer;
osg::Geode *geode = new osg::Geode();
osg::Geometry *quad = new osg::Geometry();
 
quad-setVertexArray(new osg::Vec3Array(numCoords,
 coords));
quad-setTexCoordArray(0, new osg::Vec2Array(numTexCoords,
  tCoords));
quad-addPrimitiveSet(new
 

Re: [osg-users] deadlock loading io plugin?

2008-11-03 Thread Robert Osfield
Hi Max,

On Mon, Nov 3, 2008 at 5:06 PM, Max Pfingsthorn
[EMAIL PROTECTED] wrote:
 no, it doesn't seem so. The osgviewer works fine. I did a clean build
 just before.

 There is only one thread says info threads...

 I'm stumped. Seems only to happen on apps I compile seperately.

Check if you have other OSG libs that you might be linking to, as
there is chance that you are compiling against one version of the OSG
but linking at runtime to another.   It might be worth doing removing
the CMakeCache.txt on the OSG and your app and then re-run CMake to
make sure that it everything is wired up correctly.

If this all fails then it looks like there is a bug in ReentrantMutex.
 Recreating elsewhere will be the key to tracking it down and fixing
it.

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


[osg-users] osg::Plane

2008-11-03 Thread Renan Mendes
Stupid but fast question. Just want to make sure I'm getting it right, as
notations can vary and there is no explanation at the reference docs.
Let's say I have an osg::Plane that can be represented as ax + by + cz + d =
0. The method asVec4() from that class gives me an osg::Vec4 object with x =
a, y = b, z = c and w = d?
Thanks for your answer.

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


Re: [osg-users] Disable self shadows (ShadowMap)

2008-11-03 Thread Jefferson Pinheiro

 Or, attach an empty osg::Program to get the fixed pipeline. If you're just
 using the default shadow shader for your shadows, the fixed pipeline for
 your cars might be sufficient instead of having to write a shader without
 shadowing yourself.

car_node-getOrCreateStateSet()-setAttributeAndModes(
new osg::Program, osg::StateAttribute::ON);


That makes every car receive some weird, colorful noise.


Firstly, I notice that you are using OSG 2.6. The versatility of the API
 into the shadowing stuff is much better in the 2.7 versions, and allows you
 better control over what is being applied, so I recommend you move to that
 if you can.


I've just compiled and tried OSG 2.7.4. But I don't understand what you mean
by better control. I was expecting to see, in the header ShadowedScene,
something like:
- setOnlyReceivesShadowTraversalMask
- setOnlyCastsShadowTraversalMask
- setCastsAndReceivesShadowTraversalMask

Perhaps that could be implemented? Otherwise, how would you do, in OSG 2.7,
to disable self-shadowing?

Thanks,
Jefferson

2008/11/2 Jean-Sébastien Guay [EMAIL PROTECTED]

 Hi Jefferson,

 Once again, a complement to the info David provided:

  Create a shader - you can use the GLSL in ShadowMap.cpp as a starting
 point - and then bind it to your car node stateset with the usual methods


 Or, attach an empty osg::Program to get the fixed pipeline. If you're just
 using the default shadow shader for your shadows, the fixed pipeline for
 your cars might be sufficient instead of having to write a shader without
 shadowing yourself.

car_node-getOrCreateStateSet()-setAttributeAndModes(
new osg::Program, osg::StateAttribute::ON);

 Hope this helps,

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

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


Re: [osg-users] Untextured materials = pure black

2008-11-03 Thread Jefferson Pinheiro
Yes, that solved the problem. Many thanks, you both!

I'm posting the code, for reference.

osg::ref_ptrosg::StateSet stateSet(root-getOrCreateStateSet());
osg::Image* image = new osg::Image;
// allocate the image data, noPixels x 1 x 1 with 4 rgba floats -
equivilant to a Vec4!
int noPixels = 1;
image-allocateImage(noPixels,1,1,GL_RGBA,GL_FLOAT);
image-setInternalTextureFormat(GL_RGBA);
// fill in the image data.
osg::Vec4* dataPtr = (osg::Vec4*)image-data();
osg::Vec4 color(1,1,1,1);
*dataPtr = color;
// make fake texture
osg::Texture2D* fakeTex = new osg::Texture2D;
fakeTex-setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_EDGE);
fakeTex-setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_EDGE);
fakeTex-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
fakeTex-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
fakeTex-setImage(image);
// add fake texture
stateSet-setTextureAttribute(0,fakeTex,osg::StateAttribute::ON);
stateSet-setTextureMode(0,GL_TEXTURE_1D,osg::StateAttribute::OFF);
stateSet-setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::ON);
stateSet-setTextureMode(0,GL_TEXTURE_3D,osg::StateAttribute::OFF);


2008/11/3 Jean-Sébastien Guay [EMAIL PROTECTED]

 Hello Jefferson,

  Can you tell me, please, how to set a default texture for the root?


 See src/osgShadow/ShadowMap.cpp around line 290, which starts with this
 comment:

// fake texture for baseTexture, add a fake texture
// we support by default at least one texture layer
// without this fake texture we can not support
// textured and not textured scene

 You can set this 1x1 white texture at the root of your graph, and if any
 node has a different texture on unit 0 it will override it automatically.

 Hope this helps,


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




-- 
Jefferson Pinheiro
(51) 9192 3535
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RenderBin understanding

2008-11-03 Thread Paul Martz
The way I've come to look at RenderBins...
 
The bin details are instructions to the CullVisitor. As the CullVisitor
walks your scene graph during the cull traversal, it uses these values to
build a render graph. (You could say, then, that the structure of this
render graph is specified or implied by the bin details associated with each
StateSet.) When the CullVisitor finds Drawables, it throws them into the
current render graph bin.
 
Alternatively, one could imagine a different scene graph design that
features an explicit, application-created render graph, with
application-specified association between scene graph nodes/drawables and
render graph nodes. If you can picture this type of implementation in your
head, then step back a second and consider that OSG is simply creating this
render graph for you during the cull traversal.
 
So what are the bin details?
- number: Determines relative processing order of bins in the render graph.
This takes nesting into account (unless explicitly disabled), so you could
imagine each render graph bin has a unique number that is a std::vector
composed of all the bin numbers in a NodePath.
- name: Determines how Drawables are sorted within a render graph bin (for
example, by depth, by state, by some combination of depth and state, or by
some other mechanism).
- mode: Tells the CullVisitor whether or not to change the value of the
current bin as it walks the scene graph.
 
This stuff is fairly opaque to even those of us experienced with OSG and
could really benefit from some proper documentation. In my infinite amount
of spare time, I'm considering writing a white paper that documents OSG's
bin details scheme, plus maybe creating a NodeVisitor that creates a
GraphViz .dot file to visualize the render graph.
 
Hope this helps.
   -Paul
 



  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Peter Wraae
Marino
Sent: Monday, November 03, 2008 2:44 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] RenderBin understanding


Hi Users,
 
trying to clarify some specs on the renderbin, perhaps someone could help:
 
what I'm assuming:
-there are two default renderbins created at startup RenderBin and
DepthSortedBin
-DepthSortedBin is always render after RenderBin
-DepthSortedBin sorts objects from back to front
-higher renderbin number means rendering is done later
-renderbins are sorted by states
 
what I'm asking:
-if an object has a parent osg::Group that has been set to RenderBin with
a value of 10 and the object itself uses 
RenderBin with a value of 20 then which is used?
-an .osg file can have renderbin values too? so if I load an .osg file and
set it to have RenderBin 10 do I override the renderbin values
in the file? or are they pushed relative to my given value 10? sometimes the
.osg file consist of many renderbin values. 

-- 
Regards,
Peter Wraae Marino

www.osghelp.com - OpenSceneGraph support site


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


[osg-users] COLLADA on Linux

2008-11-03 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

I am sorry if this was asked before, but I didn't find it in the
archives. While trying to build the COLLADA DOM 2.1, I am getting this
compilation error right away:

$ make
Compiling src/dae/daeAtomicType.cpp to build/linux-1.4/obj/daeAtomicType.o
In file included from include/dae/daeDatabase.h:18,
 from src/dae/daeAtomicType.cpp:20:
include/dae.h:195: error: ISO C++ forbids declaration of 'auto_ptr' with
no type
include/dae.h:195: error: invalid use of '::'
include/dae.h:195: error: expected ';' before '' token
make: *** [build/linux-1.4/obj/daeAtomicType.o] Error 1

This is with gcc 4.3.2

Does anyone know how to fix this? I used to build COLLADA without
problems before, but with older version of gcc.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJD2bzn11XseNj94gRAmEeAKDxFAa0lBph0WhhWaHp79XrcBM+9wCgmBoq
J8EMjRPUfnQjO2OyNoIrGUQ=
=fb9A
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] animtk release 0.0.9

2008-11-03 Thread Cedric Pinson

Hi Robert,

I put osgAnimation in the svn osgwidget branch and i have a version to 
try. I think to work with mercurial then i will get and push my change 
to the osgWidget branch, it's easy for me and does not require an extra 
svn branch. For people interested the mercurial repository is 
http://hg.plopbyte.net/osg-branch/  ( hg clone 
http://hg.plopbyte.net/osg-branch/ )


Right now it contains only the library and the plugins to read it. I 
need a bit of work to add other component. I decided to let the 
scheduler in the current state even if there will be a new one (i guess 
after the 2.8 release). So osgAnimation should be considered as beta.


I have a few question about the exporter, where should i put it in the 
osg tree ?



The pkg-config issue is fixed.

Cheers,
Cedric

Sukender wrote:

I agree: pkg-config should be replaced by a CMake find module for appropriate 
libs (that is to say libxml, if needed).

Sukender


Le Mon, 03 Nov 2008 19:19:03 +0100, Jean-Sébastien Guay [EMAIL PROTECTED] a 
écrit:

  

Hi Jeremy,



osgPango and osgCairo require their respective libs (but not GTK, that's
way larger and unnecessary and is only used for creating interface),
  

Yeah, sorry, that was me being overly ambiguous... I meant that pango
and cairo are libs that are required by gtk and thus are part of gtk
binary packages (which makes it convenient to get them as part of such
packages - which in turn means you'll have gotten pkg-config indirectly).



AnimTK certainly doesn't require any of that stuff. As a matter of fact,
with the changes that Cedric is introducing, I'd be surprised if
pkg-config is really required at all anymore--it's just used for
libxml2, and now that it uses native OSG format, XML may be a moot
point.
  

Cool, I think that would be best. pkg-config is really not standard on
Windows so if it's possible to do without it, great.

J-S



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


--
+33 (0) 6 63 20 03 56  Cedric Pinson mailto:[EMAIL PROTECTED] 
http://www.plopbyte.net


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


Re: [osg-users] COLLADA on Linux

2008-11-03 Thread Jeremy Moles
On Mon, 2008-11-03 at 22:02 +0100, Jan Ciger wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hello,
 
 I am sorry if this was asked before, but I didn't find it in the
 archives. While trying to build the COLLADA DOM 2.1, I am getting this
 compilation error right away:
 
 $ make
 Compiling src/dae/daeAtomicType.cpp to build/linux-1.4/obj/daeAtomicType.o
 In file included from include/dae/daeDatabase.h:18,
  from src/dae/daeAtomicType.cpp:20:
 include/dae.h:195: error: ISO C++ forbids declaration of 'auto_ptr' with
 no type
 include/dae.h:195: error: invalid use of '::'
 include/dae.h:195: error: expected ';' before '' token
 make: *** [build/linux-1.4/obj/daeAtomicType.o] Error 1
 
 This is with gcc 4.3.2

I'm using gcc 4.3.0 on Fedora 9 and got SVN trunk to compile properly,
but I didn't try the 2.1 tag.

On a different note: do you happen to know what the 2.1 means, anyway? I
see 1.4 and 1.5 folders in the src directory, but surely these numbers
aren't versioning the same thing 2.1 is?

 Does anyone know how to fix this? I used to build COLLADA without
 problems before, but with older version of gcc.
 
 Regards,
 
 Jan
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)
 Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org
 
 iD8DBQFJD2bzn11XseNj94gRAmEeAKDxFAa0lBph0WhhWaHp79XrcBM+9wCgmBoq
 J8EMjRPUfnQjO2OyNoIrGUQ=
 =fb9A
 -END PGP SIGNATURE-
 ___
 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] COLLADA on Linux

2008-11-03 Thread Oleg Dedkow
Hello Jan,

you just have to include memory header file in dae.h. After adding this
line of code I was able to compile the actual COLLADA version under Xubuntu.

Regards,

Oleg

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Jan Ciger
Gesendet: Montag, 3. November 2008 22:03
An: OpenSceneGraph Users
Betreff: [osg-users] COLLADA on Linux

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

I am sorry if this was asked before, but I didn't find it in the
archives. While trying to build the COLLADA DOM 2.1, I am getting this
compilation error right away:

$ make
Compiling src/dae/daeAtomicType.cpp to build/linux-1.4/obj/daeAtomicType.o
In file included from include/dae/daeDatabase.h:18,
 from src/dae/daeAtomicType.cpp:20:
include/dae.h:195: error: ISO C++ forbids declaration of 'auto_ptr' with
no type
include/dae.h:195: error: invalid use of '::'
include/dae.h:195: error: expected ';' before '' token
make: *** [build/linux-1.4/obj/daeAtomicType.o] Error 1

This is with gcc 4.3.2

Does anyone know how to fix this? I used to build COLLADA without
problems before, but with older version of gcc.

Regards,

Jan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJD2bzn11XseNj94gRAmEeAKDxFAa0lBph0WhhWaHp79XrcBM+9wCgmBoq
J8EMjRPUfnQjO2OyNoIrGUQ=
=fb9A
-END PGP SIGNATURE-
___
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] Computing bullet collision models from .3ds files

2008-11-03 Thread Janusz

Paul, Dusten:

Are you trying to include the soft body animation (deforming surface 
(triangle) mesh constructed according to the tetrahedral element 
deformation) that is avaialble in bullet or are you just focusing on 
building triangle/collision meshes for rigid bodies ?


I work along similar lines but it is osg + physx :-)

Regards,
Janusz

Ulrich Hertlein pisze:

Hi Paul, hi Dusten,

On 1/11/08 5:44 AM, Dusten Sobotta wrote:

Thanks a lot; this has been incredibly useful.  What is the eta for the
first release of your library? I've also solved a few problems with
integrating osg + bullet, and might be able to contribute a few things
if you're up to it.

On Fri, Oct 31, 2008 at 12:20 PM, Paul Martz [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
...
I'm currently developing an open source library containing 
utilities for
integrating OSG with Bullet. Here is the code I use to create 
triangle

meshes. The code for ComputeTriMeshVisitor is attached.


I'd also be interested in helping out with a proper osg/Bullet 
integration, having done a half-hearted (it did what I needed) attempt 
two years ago.


Cheers,
/ulrich
___
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] animtk release 0.0.9 - Win32 SUCCESS

2008-11-03 Thread Sukender
I just acheived a first success to compile osgATK and run osgATK examples under 
Windows.
- solid works.
- animSkinning displays something but the console continuously says Channel 
rotation does not contain a valid symbolic name for this class.
- benchmark runs but displays nothing and exits after a while... Maybe it's 
okay for a benchmark!
- osgnode and osgnodeMakePath crach in setupAnimtkNode() (Stack 
corruption).
- AnimtkViewer works, and examples seem to work (Except Jansens and 
example that don't seem to move).

I compiled the last package (animTK 0.0.9) against OSG 2.7.1 under VC8 SP1 
(Express).
Modified source is in the message, or at 
http://sukender.free.fr/pvle/files/animtk-0.0.9_modified_Sukender.7z (but maybe 
not forever!). Notes are included in the archive.

I suggest Cédric to integrate changes, and Um?t Uzun to try testing... Have fun 
with animTK under Win32!
See you soon!

-- 
Sukender

animtk-0.0.9_modified_Sukender.7z
Description: Binary data
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Computing bullet collision models from .3ds files

2008-11-03 Thread Dusten Sobotta
I'm currently only dealing with rigid bodies at this point, however will
introduce soft bodies at some point for extra effects once my engine is
done.  I'm still implementing some core features like a scripting system and
built-in level editor, so it will be some time before I get around to the
extras.  Nevertheless, assuming my architecture isn't drastically different,
I'll be sure to contribute any major enhancements I've made to Paul's
library when that time comes.

On Mon, Nov 3, 2008 at 5:20 PM, Janusz [EMAIL PROTECTED] wrote:

 Paul, Dusten:

 Are you trying to include the soft body animation (deforming surface
 (triangle) mesh constructed according to the tetrahedral element
 deformation) that is avaialble in bullet or are you just focusing on
 building triangle/collision meshes for rigid bodies ?

 I work along similar lines but it is osg + physx :-)

 Regards,
 Janusz

 Ulrich Hertlein pisze:

  Hi Paul, hi Dusten,

 On 1/11/08 5:44 AM, Dusten Sobotta wrote:

 Thanks a lot; this has been incredibly useful.  What is the eta for the
 first release of your library? I've also solved a few problems with
 integrating osg + bullet, and might be able to contribute a few things
 if you're up to it.

 On Fri, Oct 31, 2008 at 12:20 PM, Paul Martz [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 ...
I'm currently developing an open source library containing utilities
 for
integrating OSG with Bullet. Here is the code I use to create triangle
meshes. The code for ComputeTriMeshVisitor is attached.


 I'd also be interested in helping out with a proper osg/Bullet
 integration, having done a half-hearted (it did what I needed) attempt two
 years ago.

 Cheers,
 /ulrich
 ___
 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] Computing bullet collision models from .3ds files

2008-11-03 Thread Paul Martz
 Are you trying to include the soft body animation (deforming surface
 (triangle) mesh constructed according to the tetrahedral element
 deformation) that is avaialble in bullet or are you just 
 focusing on building triangle/collision meshes for rigid bodies ?
 
 I work along similar lines but it is osg + physx :-)

So far my work has not had a soft body requirement, just rigid bodies. The
soft body stuff is pretty cool, though, and it'd be interesting to add
support for it. If it can be done in OpenGL, it should be possible in OSG as
well.
   -Paul

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


Re: [osg-users] animtk release 0.0.9 - Win32 SUCCESS

2008-11-03 Thread Cedric Pinson

Thank you for you report.
I will check and report modification on the osg branch

Cheers,
Cedric

Sukender wrote:

I just acheived a first success to compile osgATK and run osgATK examples under 
Windows.
- solid works.
- animSkinning displays something but the console continuously says Channel 
rotation does not contain a valid symbolic name for this class.
- benchmark runs but displays nothing and exits after a while... Maybe it's 
okay for a benchmark!
- osgnode and osgnodeMakePath crach in setupAnimtkNode() (Stack 
corruption).
- AnimtkViewer works, and examples seem to work (Except Jansens and 
example that don't seem to move).

I compiled the last package (animTK 0.0.9) against OSG 2.7.1 under VC8 SP1 
(Express).
Modified source is in the message, or at 
http://sukender.free.fr/pvle/files/animtk-0.0.9_modified_Sukender.7z (but maybe 
not forever!). Notes are included in the archive.

I suggest Cédric to integrate changes, and Um?t Uzun to try testing... Have fun 
with animTK under Win32!
See you soon!

  



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


--
+33 (0) 6 63 20 03 56  Cedric Pinson mailto:[EMAIL PROTECTED] 
http://www.plopbyte.net


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


Re: [osg-users] Varying shader variable /= 0 in vertex shader... resolved

2008-11-03 Thread Engvall Åsa
Of course!
Thank you very much! Sometimes it's hard to see such easy things,  I think this 
happens to other people too... Doesn't it? :-)
Getting this answer was a perfect start of the working day. Now I feel very 
happy and will take further steps into the shader world. 
 
Asa



Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Andreas Lindmark
Skickat: den 3 november 2008 17:31
Till: OpenSceneGraph Users
Ämne: Re: [osg-users] Varying shader variable /= 0 in vertex shader,is == 0 in 
fragment shader


This line:
vec2 displacementNDC = currentPosClip.xy/currentPosClip.w - 
previousPosClip.xy/previousPosClip.w;
should be
displacementNDC = currentPosClip.xy/currentPosClip.w - 
previousPosClip.xy/previousPosClip.w;

Otherwise you will be declaring a new variable with the name displacementNDC 
the main function as scope.

/Andreas


2008/11/3 Engvall Åsa [EMAIL PROTECTED]


Hi osg-users! 

I'm trying to write my first shader, it is a very simple test program 
which sets the color on a sphere. 
The color depends on whether the sphere has moved relative to its 
position in the previous frame. 

I use two varying variables, which are set in the vertex shader, see 
the code below. If the sphere has moved, the variable called displacementNDC is 
/= 0.

Then I expect that it should still be /= 0 in the fragment shader, but 
by some reason the value is == 0. 
The other varying variable, green, does not change when going from 
vertex shader to fragment shader. 
(Just for test, I also tried to put the variable called currentPosClip 
in a varying variable. Testing for currentPosClip == 0 in the vertex shader 
returned false, but it returned true in the fragment shader.)

Please, can anybody explain what is happening? Why are the values 
changing to zero? 

Regards, 
Asa 

---Vertex shader -- 
uniform mat4 prevModelViewProjectionMatrix; 
varying vec2 displacementNDC; 
varying vec4 green; 

void main()
{ 
// Calculate the previous and current position in clip space. 
vec4 currentPosClip = gl_ModelViewProjectionMatrix*gl_Vertex;   
// Transforms vertex position 
vec4 previousPosClip = prevModelViewProjectionMatrix*gl_Vertex; 
// from object space to clip space. 

gl_Position = ftransform(); 

// Calculate displacement in NDC space. 
vec2 displacementNDC = currentPosClip.xy/currentPosClip.w - 
previousPosClip.xy/previousPosClip.w; 

// If the displacement is zero, varying variable green is set to 
the RGBA value for green. 
if (displacementNDC == vec2(0,0))   
// Object has not moved. 
green = vec4(0, 1, 0, 0); 
else
// Object has moved. 
green = vec4(0.0); 
} 
---End vertex shader -- 

---Fragment shader -- 
varying vec2 displacementNDC; 
varying vec4 green; 

void main() 
{
if (displacementNDC == vec2(0,0)) 
gl_FragColor = vec4(1,0,0,1) + green; 
else 
gl_FragColor = vec4(0,0,1,1) + green; 
} 
---End fragment shader -- 


When the sphere has moved, the resulting color should be blue. But it 
becomes red. 


___
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