Re: [osg-users] [build] Compile error today

2009-11-01 Thread Robert Osfield
Hi Emmanuel,

On Sat, Oct 31, 2009 at 6:15 PM, BARANGER Emmanuel embaran...@free.fr wrote:
 No problem :) We must make mistakes sometimes. Otherwise life would be sad

 Hum... Updated SVN and.. http://pastebin.ca/1650694

 I'm sorry

I looks like your check out didn't update correctly to the the latest
revision.  Could you try an svn update again.  Make sure the
GraphicsWindowX11.cpp is updated.

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


Re: [osg-users] [build] Compile error today

2009-11-01 Thread BARANGER Emmanuel
Hi,

This Sunday morning I made a new update and this time it, yippee, the 
compilation is going to end.

Bravo for the quick response and a big thank you to you. I can go back to my 
planes:)

Thank you!

Cheers,
BARANGER


Some aircraft for FlightGear
http://helijah.free.fr

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





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


[osg-users] OSG uniforms in GLSL shaders

2009-11-01 Thread Himar Carmona
Hi,

   how can i use the uniform osg_ViewMatrixInverse in my shaders? My shader
compiles fine, but it seems i have the view inverse matrix wrong. I'm not
sure if OSG is initializing this uniform for me at runtime. In fact, i don't
know exactly what i have to take into account to use it. Can anyone give me
some hints regarding its (recommended) use?

Thanks and best regards,
Himar.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgManipulator error bug? in removeTransformUpdating

2009-11-01 Thread Matthias Asselborn
Hi,

iam using the trunk of OSG 
i ve a simple code snipped 
a Group with a dragger and two transformmatrix objects 
and their childs 

there is no problem to call the method 
pDragger-addTransformUpdating( pTransformBrick1 );
pDragger-addTransformUpdating( pTransformBrick2 );

but when i call the methods

pDragger-removeTransformUpdating( pTransformBrick1 );
pDragger-removeTransformUpdating( pTransformBrick2 );

the code crashes with Expression: (This-_has_container(),0)
in dragger.cpp line 204

Code:

void Dragger::removeTransformUpdating(osg::MatrixTransform* transform)
{
for(Dragger::DraggerCallbacks::iterator itr = _draggerCallbacks.begin();
itr != _draggerCallbacks.end();
++itr)




here is my test programm 


Code:

int main( int argc, char **argv )
{
osgViewer::Viewer viewer;

osg::ref_ptrosg::Group pRoot = new osg::Group;

osg::ref_ptrosg::Node pBrick1 = osgDB::readNodeFile( 
D:\\bricks\\obj\\3001.obj );
osg::ref_ptrosg::Node pBrick2 = osgDB::readNodeFile( 
D:\\bricks\\obj\\3005.obj );

osg::MatrixTransform* pTransformBrick1 = new osg::MatrixTransform;
pTransformBrick1-addChild( pBrick1 );

osg::MatrixTransform* pTransformBrick2 = new osg::MatrixTransform;
pTransformBrick2-addChild( pBrick2 );

osgManipulator::Dragger* pDragger = 0;
osg::ref_ptrosgManipulator::TabBoxDragger pTabBoxDragger = new 
osgManipulator::TabBoxDragger();
pTabBoxDragger-setupDefaultGeometry();
pDragger = pTabBoxDragger;

pRoot-addChild(pTransformBrick1);
pRoot-addChild(pTransformBrick2);
pRoot-addChild( pDragger );

 float scale = pBrick1-getBound().radius() * 1.6;
 pDragger-setMatrix(osg::Matrix::scale( scale, scale, scale ) *
osg::Matrix::translate( pBrick1-getBound().center() ) 
);

pDragger-addTransformUpdating( pTransformBrick1 );
pDragger-addTransformUpdating( pTransformBrick2 );
pDragger-removeTransformUpdating( pTransformBrick1 );
pDragger-removeTransformUpdating( pTransformBrick2 );

pDragger-setHandleEvents(true);
   
osgUtil::Optimizer optimizer;
optimizer.optimize( pRoot.get() );

viewer.setSceneData( pRoot.get() );
return viewer.run();
}



Why doesnt it work?
Is there another way to activate and deactivate the dragger to the nodes?

Thank you!

Cheers,
Matthias

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





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


[osg-users] Textures and Images

2009-11-01 Thread Julian Looser
Hi,

I have a question about osg::Textures. In my program I load an IVE file with 
embedded textures. Once it is loaded, I traverse the subgraph with a custom 
visitor which inspects each osg::StateSet. I find osg::Textures within these 
statesets, and I want to get the filenames for the images the textures are 
using.

I thought I had this working as a bunch of test models loaded and were analysed 
correctly. However, for some models, the textures are found, but if I call 
getImage(n) on the texture, NULL is returned. The texture looks fine in the 
viewer, so I know the image data has been loaded at some point.

Shouldn't an osg::Texture loaded from an image file always have a valid 
osg::Image you can access?

Why would this work for some models and not others? Is it a difference in the 
loaders for different image formats?

Cheers,
Julian

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





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


[osg-users] PagedLOD experts?

2009-11-01 Thread Chris 'Xenon' Hanson
  I'm just wondering -- other than myself, are there any others (excluding 
Robert,
obviously) who have delved into the code for PagedLOD and DatabasePager and 
actually done
any coding in there?

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] collada export

2009-11-01 Thread Maurizio Lodo
Hi all,
I was trying to find a way to export my model created with OSG so that I can 
play with it in Blender. The only solution at the moment seems the Collada 
plugin. So I compiled collada-dom 2.2, then I tried 2.1, and I even found some 
Ubuntu pre-compiled collada-dom/libminizip installers, and then I recompiled 
OSG 2.8.2 in turn with each of these versions of collada-dom. Results with all 
of them is that I can open .dae files with osgviewer, which makes me believe 
that the plugin is installed and working correctly. However if I add 
osgDB::writeNodeFile( *root, file.osg ) to the code that generates my model, 
this results in the complete model which i can then view with osgviewer; if I 
add osgDB::writeNodeFile( *root, file.dae ) the resulting .dae file is very 
small (few kBytes, against the 3 or 4 Mbytes of the .osg file) and when I open 
it with osgviewer, there is nothing there. Am I missing something obvious here? 
Same happens if i try to convert the .osg file to .dae using os
 gconv.

Would there be anyone so kind to use a working version of osgconv on a .osg 
file in order to convert it to .dae for me? It would be very much appreciated


Thank you!

Cheers,
Maurizio

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





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


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread sergey leontyev
Chris,
i dont know any, but since you are one of those few elite members of the OSG 
community :-) Maybe you can help me understand what is going on:

http://forum.openscenegraph.org/viewtopic.php?t=3782

Thanks!
Sergey


Chris 'Xenon' Hanson wrote:
 I'm just wondering -- other than myself, are there any others (excluding 
 Robert,
 obviously) who have delved into the code for PagedLOD and DatabasePager and 
 actually done
 any coding in there?
 
 -- 
 Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
 PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
 There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


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





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


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Wang Rui
Hi Chris,

I had done a series of tutorials a few months ago named The longest frame,
which discussed the implementation of DatabasePager, DataThread and PagedLOD
(You may find it at osgchina.org, in CHINESE). That is to say, I've studied
into the code, too, even though I'm not expert. :)
Wang Rui

2009/11/2 Chris 'Xenon' Hanson xe...@alphapixel.com

  I'm just wondering -- other than myself, are there any others (excluding
 Robert,
 obviously) who have delved into the code for PagedLOD and DatabasePager and
 actually done
 any coding in there?

 --
 Chris 'Xenon' Hanson, omo sanza lettere  Xenon
 AlphaPixel.com
 PixelSense Landsat processing now available!
 http://www.alphapixel.com/demos/
 There is no Truth. There is only Perception. To Perceive is to Exist. -
 Xen
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Paul Martz
Like Wang Rui, I have studied the code to help investigate issues with 
client databases. But I haven't done any coding there. I'm familiar with 
the environment variables that control its behavior, what operations are 
done at what phase of the frame, and am aware of how the PagedLOD class 
differs significantly from its base class.


In the vast majority of my current work, I'm not using the DatabasePager 
or PagedLOD classes at all, so am probably a bit rusty on the current 
code base.


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

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


Re: [osg-users] LineSegmentIntersector and alpha-blended polygons

2009-11-01 Thread Matthew Hielsberg
Hi,

I finally found another post that gets pretty close to what I wanted, but did 
not work right out of the box (see 
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-January/021653.html).
  I wrote the following function starting from the above post's code and it 
seems to work well, at least for my few test models.
 

Code:

float GetAlphaAtTexCoords(const osgUtil::LineSegmentIntersector::Intersection 
*hit)
{
osg::Vec2 tc(0.0f,0.0f);
float alpha = -1.0f;

osg::Drawable* drawable = hit-drawable.get();
osg::Geometry* geometry = drawable ? drawable-asGeometry() : NULL;
osg::Vec3Array* vertices = geometry ? 
dynamic_castosg::Vec3Array*(geometry-getVertexArray()) : NULL;
if (vertices)
{
// get the vertex indices.
const osgUtil::LineSegmentIntersector::Intersection::IndexList indices 
= hit-indexList;
const osgUtil::LineSegmentIntersector::Intersection::RatioList ratios 
= hit-ratioList;

if (3 == ratios.size()  3 == indices.size())
{
osg::Array* texcoords = (geometry-getNumTexCoordArrays()0) ? 
geometry-getTexCoordArray(0) : NULL;
osg::Vec2Array* texcoords_Vec2Array = 
dynamic_castosg::Vec2Array*(texcoords);
if (texcoords_Vec2Array)
{
osg::Vec2 tc0 = (*texcoords_Vec2Array)[indices[0]];
osg::Vec2 tc1 = (*texcoords_Vec2Array)[indices[1]];
osg::Vec2 tc2 = (*texcoords_Vec2Array)[indices[2]];
tc = tc0 * ratios[0] + tc1 * ratios[1] + tc2 * ratios[2];
}
else
return alpha;
}
else
return alpha;
}
else
return alpha;

osg::TexMat* activeTexMat = NULL;
osg::Texture2D* activeTexture = NULL;
osg::Image* activeImage = NULL;

if (geometry-getStateSet())
{
osg::TexMat* texMat = 
dynamic_castosg::TexMat*(geometry-getStateSet()-getTextureAttribute(0,osg::StateAttribute::TEXMAT));
if (texMat) 
activeTexMat = texMat;

osg::Texture2D* texture = 
dynamic_castosg::Texture2D*(geometry-getStateSet()-getTextureAttribute(0,osg::StateAttribute::TEXTURE));
if (texture) 
activeTexture = texture;
else
return alpha;
activeImage = activeTexture-getImage();
}
else if (drawable-getNumParents()  0)
{
// XXX - assumes texture info is at most one level up
for (unsigned int i = 0; i  drawable-getNumParents(); ++i)
{
// reset all ptrs just in case
activeTexMat = NULL;
activeTexture = NULL;
activeImage = NULL;
// get the current parent ptr
osg::Node *p = drawable-getParent(i);
if (p-getStateSet())
{
osg::TexMat* texMat = 
dynamic_castosg::TexMat*(p-getStateSet()-getTextureAttribute(0,osg::StateAttribute::TEXMAT));
if (texMat) 
activeTexMat = texMat;

osg::Texture2D* texture = 
dynamic_castosg::Texture2D*(p-getStateSet()-getTextureAttribute(0,osg::StateAttribute::TEXTURE));
if (texture) 
activeTexture = texture;
else
continue;
activeImage = activeTexture-getImage();
if (activeImage)
break;// bail from the for loop
}
}
}

if (activeTexMat)
{
osg::Vec4 tc_transformed = osg::Vec4(tc.x(),tc.y(),0.0f,0.0f) * 
activeTexMat-getMatrix();
tc.x() = tc_transformed.x();
tc.y() = tc_transformed.y();
}

if (activeImage)
{
// handle s wrapping
switch (activeTexture-getWrap(osg::Texture::WRAP_S))
{
case osg::Texture::CLAMP:
case osg::Texture::CLAMP_TO_BORDER:
case osg::Texture::CLAMP_TO_EDGE:
if (tc.x()  0.0f)
tc.x() = 0.0f;
if (tc.x()  1.0f)
tc.x() = 1.0f;
break;
case osg::Texture::MIRROR:
tc.x() = tc.x() - floor(tc.x());
if ((int)(floor(tc.x())) % 2)
tc.x() = 1.0f - tc.x();
break;
case osg::Texture::REPEAT:
tc.x() = tc.x() - floor(tc.x());
break;
}
// handle t wrapping
switch (activeTexture-getWrap(osg::Texture::WRAP_T))
{
case osg::Texture::CLAMP:
case osg::Texture::CLAMP_TO_BORDER:
case osg::Texture::CLAMP_TO_EDGE:
if (tc.y()  0.0f)
tc.y() = 0.0f;
if (tc.y()  1.0f)
tc.y() = 1.0f;
break;
case osg::Texture::MIRROR:
tc.y() = tc.y() - floor(tc.y());
if ((int)(floor(tc.y())) % 2)
tc.y() = 1.0f - tc.y();
break;
case osg::Texture::REPEAT:
tc.y() = tc.y() - floor(tc.y());
break;
 

Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Chris 'Xenon' Hanson
sergey leontyev wrote:
 Chris,
 i dont know any, but since you are one of those few elite members of the 
 OSG community :-) Maybe you can help me understand what is going on:
 http://forum.openscenegraph.org/viewtopic.php?t=3782

  I can't tell you much about TXP paging or multi-camera Database paging.

  What I can tell you is you need to do some in-situ debugging. You need to 
compile with
debugging and use memory debugging tools to see what sort of objects (what size 
of
allocations) are being allocated. Add code wherever needed to count these 
allocations, and
set breakpoints to see where they're being allocated from.

  Turn on as much OSG debugging info (OSG Notify level DEBUG_INFO) and watch 
what spits
out. Usually OSG tells you what it's doing in detail if it's loading or 
allocating stuff.
Add more Notify debugging to suspicious code areas if you need to.

  I could probably help you more with this, but I've got to help my paying 
client.

 Thanks!
 Sergey

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Chris 'Xenon' Hanson
Chris 'Xenon' Hanson wrote:
   I'm just wondering -- other than myself, are there any others (excluding 
 Robert,
 obviously) who have delved into the code for PagedLOD and DatabasePager and 
 actually done
 any coding in there?


  I'll throw out an item that I think should be discussed from my recent work:

DatabasePager.cpp, capped_removeExpiredSubgraphs() has a line of coding that 
says:

MarkPagedLODsVisitor markerVistor(NeedToRemove);

  This visitor, when applied, goes through the _inactivePagedLODList, and 
renames a
certain number of the contents to NeedToRemove. Later, if you are NOT using 
the
_deleteRemovedSubgraphsInDatabaseThread option, it removes PagedLOD nodes that 
have this name.

  This seems to me to be a dangerous usage of the node name. Granted, it's very 
unlikely
that you'd have a node named NeedToRemove, but it underscores that the 
practice of
assigning special meaning to the node name isn't especially safe. I think it 
would be wise
to clean the node names as the nodes are added to the _inactivePagedLODList so 
that none
of them could ever possibly enter into the list already bearing the name 
NeedToRemove.
What I haven't figured out is if there's ever a situation where a node _leaves_ 
the
inactive list and returns to the active scenegraph without being deleted. In 
this case,
any tampering of the node name would have undesirable results.

  It does raise another question -- is this a common practice and is there 
anywhere else
in OSG where node name has a special meaning during specific phases of 
operation? This
particular one is not documented anywhere I know of. In this case, the failure 
mode would
be pretty benign -- the DatabasePager could accidentally destroy too many 
inactive
PagedLOD nodes in one frame-idle period. Normally this is constrained by the
_targetMaximumNumberOfPageLOD. So, maybe this failure could cause the redraw to 
break
framerate. Nothing fatal.

  And finally, is there a better extensible way to go about marking arbitrary 
nodes for
later processing (while potentially still in the scenegraph, even though this 
case has
them removed from the scenegraph by this point)? Any fast boolean flag will be 
immediately
overwhelmed because everyone will want to use it and they'll collide. But any 
extensible
method would seem to involve allocating and attaching some sort of dynamic 
marker, which
is not especially efficient.

  Any thoughts?


-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Tim Moore
On 11/01/2009 10:42 PM, Chris 'Xenon' Hanson wrote:
   I'm just wondering -- other than myself, are there any others (excluding 
 Robert,
 obviously) who have delved into the code for PagedLOD and DatabasePager and 
 actually done
 any coding in there?
 
I've stared at the DatabasePager code a lot and made some contributions, but 
mostly in
order to do paging without using PagedLOD.

Tim

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


Re: [osg-users] PagedLOD experts?

2009-11-01 Thread Wang Rui
Hi Chris,

2009/11/2 Chris 'Xenon' Hanson xe...@alphapixel.com


 This visitor, when applied, goes through the _inactivePagedLODList, and
 renames a
 certain number of the contents to NeedToRemove. Later, if you are NOT
 using the
 _deleteRemovedSubgraphsInDatabaseThread option, it removes PagedLOD nodes
 that have this name.


Yes, it does. In my opinion, PagedLODs are seldom named NeedToRemove
because they are created by VPB automatically, or created by some
user-defined LOD generating tools, which may easily avoid this problem. So I
just ignore it while coding. But as you say, it is potentially dangerous.


 It does raise another question -- is this a common practice and is there
 anywhere else
 in OSG where node name has a special meaning during specific phases of
 operation?


I think so. There are some other special uses of setName(),
setUpdateCallback() and etc. in core osg libraries. For example,
osgAnimation::MorphGeometry applies setUpdateCallback() to itself
automatically, which may be invalid if a innocent developer set a customized
udpate callback to it again. Usage of ImageSequence::UpdateCallback in
osg::Texture classes may also have the same trouble.


  And finally, is there a better extensible way to go about marking
 arbitrary nodes for
 later processing (while potentially still in the scenegraph, even though
 this case has
 them removed from the scenegraph by this point)? Any fast boolean flag will
 be immediately
 overwhelmed because everyone will want to use it and they'll collide. But
 any extensible
 method would seem to involve allocating and attaching some sort of dynamic
 marker, which
 is not especially efficient.

  Any thoughts?




I don't think OSG can solve all those problems by itself. IMHO, the best way
is to write and improve documents and reference manuals, and try to tell
these exceptions and notes to developers all over the world: Don't rename
unrenamable nodes, and don't disturb self-propelled objects. :D


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


[osg-users] how to use pfd_draw_to_bitmap mode in GraphicsWindowWin32?

2009-11-01 Thread Dibo, Liu
Hi all,

I meet some problems when using pfd_draw_to_window, so I want to try 
pfd_draw_to_bitmap.

BUT, I found that there is no way to change the pixel format to 
pfd_draw_to_bitmap instead of the hard code pfd_draw_to_window in 
GraphicsWindowWin32 class. All initialization function is non-virtual.

How to use pfd_draw_to_bitmap mode in GraphicsWindowWin32?


Thanks for further help!

Cheers,
Dibo,

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





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


[osg-users] [osgOcean] Wind speed representation

2009-11-01 Thread Dimitrios Filiagos
Hi,

I was wondering if there is a connection of wind speed parameter of the ocean 
surface to real world wind speed. Is it representing m/sec or Km/h or it has 
some connection with ocean sea state?


Thank you!


Dimitrios

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





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