Re: [osg-users] osgText::readFontFile returns NULL on valid argument

2009-03-19 Thread Guy
Hi jesper,

 You could in the start of your program call
osgDB::Registry::instance()-getLibraryPathList().push_front(your dlls
path). In that case it doesn't depend on environment settings.

 

Guy.

 



 

 

Thank you for your answers.

 

I have actually found out that the problem is that my program can't find
the osgdb_freetype.dll plugin, even though it is in the osgPlugins-2.6.1
directory in the private assembly I have created for OSG distribution.
I'm currently messing about a bit with the manifests to try and get it
to find it. Apparently it doesn't use it if I just add it to the
manifest along with the osg48-osg.dll and other dll's, but if I place it
in the same directory as my application it works just fine.

I don't want to have to add OSG to the path of the computer as I want to
preserve backwards compatability when my program gets ported to a newer
OSG version.
BTW: have anybody tried creating an OSG shared assembly?

 

Jesper D. Thomsen



From: osg-users-boun...@lists.openscenegraph.org
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cole, Charles
E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
[charles.e.c...@nasa.gov]
Sent: Wednesday, March 18, 2009 1:54 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgText::readFontFile returns NULL on valid
argument

Hi Jesper,

 

My first inclination is that the path is incorrect, or at least doesn't
match with where the font file actually is.  With the code snippet you
listed, I believe that the file (and path) that you list must be
relative to your project's compiled executable.  That would be the first
thing that I'd check, and Paul's tip on adding the OSG_NOTIFY_LEVEL can
help if you can run your executable from a DOS window.  Another means of
checking is to place the font file in the same directory as your
executable and change the readFontFile parameter to just arial.ttf.
If that works, then that confirms that it's a path issue.

 

Hope that helps.

 

Chuck

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper
D. Thomsen
Sent: Wednesday, March 18, 2009 7:57 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] osgText::readFontFile returns NULL on valid
argument

 

Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from
this method:

 

osgText::Font* t_font = osgText::readFontFile(fonts/arial.ttf);

 

The strange part is that when I compile and run the osgText and osgHud
examples, it works just fine (so it isn't the font-file which is
missing). It only happens in my own program. 
So far I have tested it on both Vista and XP machines in the office, and
this doesn't seem to affect the problem. However, my program works just
fine on a single XP machine, but not on any of the other machines. I
have tried in both debug and release modes, and tried both copying the
executable and building it on different machines, and so far it is
consistent in that the deciding factor is which machining is running the
program and not which machine it was built on.

 

I'm using OSG 2.6.1 in Visual Studio 2005 sp1 on a Vista machine (but
have tested on XP also).

 

Since the osg examples work just fine on the same machine, I guess it is
something I have done in either the project settings or somewhere in the
code, but I'm running out of ideas. If anybody have tried something like
this, or knows what could cause this, I would very much appreciate it.

 

regards, and thanks in advance.

 

Jesper D. Thomsen

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


Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-19 Thread Guy
Hi Steven,
 
 Two things, first, in the code you entered there are 5 values you set
in vec4... so maybe it's a mistake in the email, and maybe in the shader
code.

 Second, to have alpha values between 0-1 you don't need MRT.

Guy.



danielh wrote:
 Try attaching a texture to the COLOR_BUFFER0 instead of an image
directly.
 That's what worked for me.



Thats what this code is doing. I've written to COLOR_BUFFER0 and
whenever I change the shader alpha value to something other than 1 all
color values come back incorrect.

This will be read correctly:
 
Code:
gl_FragColor = vec4(1,2,3,4, 1);



But this will be read incorrectly:

Code:
gl_FragColor = vec4(1,2,3,4, .5);



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





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


Re: [osg-users] distant nodes in orthographic projection turn black

2009-03-19 Thread Guy

Hi Peter,
 I had something similar in my program. For me it happened when the
object where VERY FAR from the camera in the orthographic projection.
There were some distances that the objects disappeared and at even
greater distances it reappeared. 
 I think it have to be something with the computation of the near far
planes.

 I made a patch for this which work for me, at the same geometry that I
wanted to put in the problematic distance I added another primitive that
was as twice that distance. That primitive had zero alpha and I use
alpha blending. I need the alpha blending anyhow, but you could just put
very small primitive (point?) that you icon will hide anyway.

 What I don't get is if that's an orthographic projection, why does your
icons get smaller when you zoom out?

Hope it helps,
 Guy. 

: Re: [osg-users] distant nodes in orthographic projection turn black

It's not erratic, it's pretty strongly correlated to the projection 
matrix settings (determining the zoom level), camera distance and size 
of the icon.

I looked at the icon model, from inspecting the .osg file (converted 
from .ive with osgconv) it appears that the relevant state settings are:

  GL_CULL_FACE ON
  GL_LIGHTING ON
  GL_NORMALIZE ON
  Material {
DataVariance STATIC
ColorMode OFF
ambientColor 1 0 0 1
diffuseColor 1 0 0 1
specularColor 0 0 0 1
emissionColor 0 0 0 1
shininess 0
  }
 From what I can tell from reading the OpenGL documentation and looking 
at the OSG code, this means it should ignore any per-vertex colors and 
just use the material settings, correct?  Does it still need a color
array?

The normals looks fine:
NormalBinding PER_VERTEX
NormalArray Vec3Array 6
{
  0 0 1
  0 0 1
  0 0 1
  0 0 1
  0 0 1
  0 0 1
}

The original .ive file was produced using OSGExp with 3D Studio Max 2008

(the plugin is still using OSG 1.2, though.)I don't have much 
control over whether it outputs materials or per-vertex colors, unless I

go and noodle around with the nodes in code after loading them.  I 
suppose I could modify a file by hand to see if it makes a difference.

Another thing I noticed is that all the icons go black just before the 
camera zooms far enough that the icons are too small to render -- 
although in that case, it isn't very noticeable because the icons are 
already only a few pixels across on screen.

Also, I forgot to mention in my previous email but I'm using Open Scene 
Graph 2.6.1.

Thanks,
- Peter

Robert Osfield wrote:
 Hi Peter,

 Irratic changes of lighting + colour of objects in the scene as your 
 move the camera is typically due missing normals or colour arrays on 
 the geometry in the scene that is behaving oddly, as these missing 
 arrays will mean that their settings will be inherited from geometries

 that just happen to be rendered before them.  Have a look at the 
 problem geometry to see if that it have any normal or colour arrays, 
 and if they don't add them in.

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

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

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


Re: [osg-users] Shader aliasing

2009-03-19 Thread Guy
Hi Andres,

 

If there are different geometries you could use uniforms else you could
use attributes to set the class id.

 

If you plan to use different map textures on the same geometry (the more
general solution) than use Robert's advice :-)

 

Can you describe what are distx and disty? 

Your filter seems to smooth the texture neighborhood with a slight
emphasis of the value in texcoord. Generally smoothing does remove
aliasing, but for indexing how does it help? Suppose you get a 1.23
value, what path in the shader r u planning to use?!?

 

And what ever path you eventually use, u draw adjacent pixels with
distinct shader paths, so you will still have aliasing in the resulting
image.

 

Hmm... I ment to help but now I'm not sure I really do :-)

 

Guy.

 

   

 

 



 

 

Hi all,

 

We are drawing textured terrain tiles, and want to write a shader that
uses different code paths for different types of terrain. Water
surfaces, for instance, are to be drawn differently than forested
surfaces. To do this we have a texture with different discrete values
for different classes of terrain as a basis for selecting code path.

 

In the shader, it is obviously not possible to simply use an if
statement, and select code path depending on values in the
classification texture, since that would introduce aliasing.

 

To reduce aliasing I tried to reduce the frequency by filtering the
texture like this:

 

vec2 distx = dFdx(texcoord);

vec2 disty = dFdy(texcoord);

float r = texture2D(classmap,texcoord-distx) +
texture2D(classmap,texcoord+distx) +

texture2D(classmap,texcoord-disty) +
texture2D(classmap,texcoord+disty) +

texture2D(classmap,texcoord-distx-disty) +
texture2D(classmap,texcoord+distx+disty) +

texture2D(classmap,texcoord-distx+disty) +
texture2D(classmap,texcoord+distx-disty) +

texture2D(classmap,texcoord)*2.0;

r = r/10.0;

...and using the value r as basis for the final fragment color. (In this
case, the classmap only contains two values (0 and 1) and aliasing could
be removed by using mipmap filtering etc of the classmap texture, but we
will extend this into using more classes, and then normal texture
filtering can't be used. I hope this illustrates the aliasing problem
anyway.)

 

This filter is probably too simple, but am I on the correct path? Is
it possible to create a filter that reduces the aliasing to an
acceptable level, and if so, what should it look like?

 

I can't be the first one that wants to use terrain class maps like this,
how is it generally done?

 

We're using OSG 2.6.1, RHEL 5.1 and GTX280.

 

Regards;

Anders Wallerman, Saab AB, Sweden

 

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


[osg-users] question about qt example

2009-03-19 Thread ami guru
Hello Ben,

I have the same question as well.

I personally using the AdapterWidget with Qt.

The only diffrence i found is that AdapterWidget is derived from GLWidget
and the other
from QWidget.


The former one is more concrete than the latter one i guess, GLwidget is
using the OpenGL framework.
Whereas the QWidget is using something that i did not understand much.


I even put seveeral cout statement to see which one is running by default.
But i did not get any output even though i think
that adapter widget is running if you run it without any flag. Did you
encounter that particular issue?
I wanted to see how the arguments are passed to the function concerned.

I hope that some one will put more light into  that matter.


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


Re: [osg-users] My own main loop witout viewer.run()

2009-03-19 Thread Viacheslav
Yeah, quesion  40Can I use OSG within an existing Renderer engine just is 
what I need.

Thanks for helping.
And I need another advice:
as I understand whole OSG architecture, I must to render my dynamic scene in 
such way (in addition to question #40):
1) set callbacks functions to each Geode which will reset position and rotation 
(any graphical properties) of it's Geode
2) call sceneViewer-update () where this callback functions will be called
3) end infinite cycle with:
   sceneViewer-cull ();
   sceneViewer-draw ();

Did I got the point?

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





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


Re: [osg-users] FFmpeg plugin

2009-03-19 Thread Adrian Egli OpenSceneGraph (3D)
Hi Carlos
You have to donwload ffmpeg and build the plugin by setting up the right
parameters in cmake. then osg will build the ffmpeg plugin as well as the
other 3rd party plugins will be build.

adrian

2009/3/18 Carlos Sanches ces...@gmail.com

 Hi Robert.
 I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have the
 plugin for ffmpeg .
 this is correct ?
 I put this in my code ...
 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but how I know if it is using ffmpeg ?

 tks




 2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the option -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 Robert.

 2009/3/16 Carlos Sanches ces...@gmail.com


 Hi all !
 I downloaded osg 2.9.1 . I m using  pImageStream =
 dynamic_castosg::ImageStream*(hudImage);
 to open a movie.
 What have I to do to use ffmpeg to read my movies ?

 tks




 ___
 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




-- 

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


Re: [osg-users] Draw a triangle with front and back faces

2009-03-19 Thread Robert Osfield
Hi Raqin,

To enable/disabe modes in OSG you use:

   stateset-setMode(GLenum, osg::StateAttribute::ON/OFF);

In you case you probably want to disable back face culling.

  stateset-setMode(GL_CULL_FACE, osg::StateAttribute::OFF);

Robert.

2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Yes, the openGL code enabled the back face culling. I think I didn't do
 this in osg, my bad. Where should I look for back face culling in osg?
 Something in example? Thanks!


 Ruqin

 2009/3/18 Robert Osfield robert.osfi...@gmail.com

 Hi Ruqin,

 I'm not going to review your code as it's pointless, it's not seeing the
 wood from the trees.  Answer the question I asked, is it back face culling
 that you are talking about??  In your OpenGL app did you enable/disable back
 face culling?

 Robert.


 2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Sorry about the confusion. Here is the openGL code that works:

 *triangle t;*
 *const float* pFltArrayN = t.getNormal();*
 *const float* pFltArray1 = t.getVert1();*
 *const float* pFltArray2 = t.getVert2();*
 *const float* pFltArray3 = t.getVert3();*

 *glNormal3fv(pFltArrayN);*
 *glVertex3fv(pFltArray1);*
 *glVertex3fv(pFltArray2);*
 *glVertex3fv(pFltArray3);*
 **
 *a[0] = -pFltArrayN[0];*
 *a[1] = -pFltArrayN[1];*
 *a[2] = -pFltArrayN[2];*
 *glNormal3fv(a);*
 *glVertex3fv(pFltArray3);*
 *glVertex3fv(pFltArray2);*
 *glVertex3fv(pFltArray1);*

 I tried to do the same thing in osg, here is my code:

 *osg::ref_ptrosg::Material material = new osg::Material();

 material-setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4f(0.00f,0.00f,0.00f,0.00f));
 osg::ref_ptrosg::PolygonMode polymode = new osg::PolygonMode();

 polymode-setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::FILL);
 osg::ref_ptrosg::StateSet stateset = new osg::StateSet();

 stateset-setAttributeAndModes(material.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setAttributeAndModes(polymode.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
 *

 *for(int j = 0; j  mesh-getNumTriangles(); j ++)*
 *{*
 *osg::DrawElementsUInt* frontTriElement = new
 osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
 *frontTriElement-push_back(mesh-getTri(j).getVert1Index());*
 *frontTriElement-push_back(mesh-getTri(j).getVert2Index());*
 *frontTriElement-push_back(mesh-getTri(j).getVert3Index());*
 *meshGeometry-addPrimitiveSet(frontTriElement);*
 *osg::Vec3f normalVec(mesh-getTri(j).getNormalVec3().x,
 mesh-getTri(j).getNormalVec3().y,*
 *
 mesh-getTri(j).getNormalVec3().z);*
 *normalArray-push_back(normalVec);*

 *osg::DrawElementsUInt* backTriElement = new
 osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
 *backTriElement-push_back(mesh-getTri(j).getVert3Index());*
 *backTriElement-push_back(mesh-getTri(j).getVert2Index());*
 *backTriElement-push_back(mesh-getTri(j).getVert1Index());*
 *meshGeometry-addPrimitiveSet(backTriElement);*
 *normalArray-push_back(-normalVec);*
 *}*
 *meshGeometry-setStateSet(stateset.get());*
 *meshGeometry-setVertexArray(vertexArray.get());*
 *meshGeometry-setNormalArray(normalArray.get());*
 *meshGeometry-setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);*

 While seems this doesn't work. Any problem or mistake? Thanks a lot!

 Ruqin


 2009/3/18 Robert Osfield robert.osfi...@gmail.com

 Hi Ruqin,


 2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D
 triangular mesh with osg. For some mesh, the calculated normal points
 to the inside. So, I want to draw both the front and back faces, which
 have opposite normals. Then you can render the mesh visible.
 Is there an example of this? Thanks!


 Are you talking about two face lighting of back face culling here??
 Originally your email sounded like you were talking about lighting at back
 face culling has nothing to do with normals, but this new emails sounds 
 like
 you might be refering to back face culling...

 Robert.

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

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





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



 ___
 osg-users 

Re: [osg-users] how to force databasepager before drawing

2009-03-19 Thread Robert Osfield
HI Fabien,

See the osgautocapture for example of how to do this.

Robert.

On Wed, Mar 18, 2009 at 5:34 PM, Fabien Dachicourt d...@spaceyes.fr wrote:

 Hi all,
 To make a snapshot i would need to wait for all pagedlod loading before
 drawing,
 The databasepager getRequestsInProgress() works well during real time
 rendering, and returns false when everything is loaded, but how could i wait
 for all pagedlod loading without drawing ?

 I tried an update/cull loop, but it sometimes locks with remaining file
 requests (FileRequestListSize  0).

 Is there anything to do to force the databasepager to handle all requests
 before drawing ?

 Thanks for any help
 Fabien


 ___
 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] getDistanceToViewPoint not implemented in osgUtil::IntersectionVisitor

2009-03-19 Thread Robert Osfield
Hi Jason,

This change would be appropriate.  Although we might want to review the eye
point management, and perhaps eye + view points as potentially they aren't
the same.  An stack for eye/viewpoint point might be need as well to cope
with internal camera nodes.

Robert.

2009/3/18 Jason Beverage jasonbever...@gmail.com

 Hi Robert,

 I'm using LOD's in one of my apps to control the distance at which models
 first begin to appear and noticed that the IntersectionVisitor will still
 hit these nodes even if they are not visible.

 I tried setting the LODSelectionMode to
 USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION but it still selected invisible
 nodes.  After looking through the code I noticed that the
 getDistanceToViewPoint function is used by the LOD class but is not
 implemented by the IntersectionVisitor, so will always have the value of 0.

 I made a small class deriving from IntersectionVisitor that just returned
 getDistanceToEyePoint (which is overriden by IntersectionVisitor) and things
 seemed to behave more appropriately.

 class MyIntersectionVisitor : public osgUtil::IntersectionVisitor
 {
 public:
 MyIntersectionVisitor(osgUtil::Intersector* intersector=0,
 osgUtil::IntersectionVisitor::ReadCallback* readCallback=0)
 :IntersectionVisitor(intersector, readCallback)
 {
 }

 virtual float getDistanceToViewPoint(const osg::Vec3 pos, bool
 useLODScale) const
 {
return getDistanceToEyePoint(pos, useLODScale);
 }
 };

 Would this change, or something similar, be appropriate for inclusions in
 OSG?

 Thanks!

 Jason


 ___
 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] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-03-19 Thread Robert Osfield
Hi John,

This does sounds like a CMake bug.  I wonder if reverting to old version of
CMake might help.

Robert.

On Wed, Mar 18, 2009 at 8:17 PM, john casu j...@chiraldynamics.com wrote:

 Robert,

 I put debugging messages in FindFreeType.cmake, and the behavior is as
 expected within that cmake file, i.e. FREETYPE_INCLUDE_DIRS gets set
 correctly.

 The issue, as far as I can tell, is why cmake on os/x either isn't
 exporting FREETYPE_INCLUDE_DIRS, or there's a typo somewhere outside that
 file so that the variable isn't getting picked up.

 I spent a little time trying to debug this, but I'm not really getting
 anywhere, given that I have little cmake experience.  But, everything does
 seem to be working as expected, so it's a little bit of a mystery.

 certainly, the code in Find3rdPartyDependencies.cmake doesn't seem to be
 traversed, and src/osgPlugins/freetype/CMakeLists.txt seems to be correct.

 Unfortunately, I don't have enough time, right now, to devote to debugging
 this in any depth.   And since I do have a workaround, I'm not blocked.

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





 ___
 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] OpenGL EXTENSION support

2009-03-19 Thread Robert Osfield
HI Sajjad,

2009/3/18 ami guru dosto.wa...@gmail.com

 Is there any class or interface in OSG that can query and print out the
 supported extensions within the OpenGL driver ?


There isn't a single method that returns a list of all supported extensions,
but there are various methods for getting OpenGL function pointers and
checking whether a specific extension is supported.  See
include/osg/GLExtensions.

Please note you'll need to have a valid graphics context, and for the
extensions to be initialised before the functions will work as you can only
do OpenGL calls from a thread with a valid graphics context.

If you have happy do debug work on your app, then enable the verbose debug
messages and this will output the lists of supported extensions for you.
set the env var OSG_NOTIFY_LEVEL to DEBUG.

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


Re: [osg-users] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-03-19 Thread Mattias Helsing
Hi John

I'm catching up with the list and just saw this. I'm not a mac user
but I recently made a submission in the Find3rdPartyDependencies.cmake
and freetype area that is in the osg-2.8 branch (not 2.8.0). As I
understand you have 2.8.0?

If you want to try it out I've attached the file

Mattias

On 3/19/09, Robert Osfield robert.osfi...@gmail.com wrote:
 Hi John,

 This does sounds like a CMake bug.  I wonder if reverting to old version of
 CMake might help.

 Robert.

 On Wed, Mar 18, 2009 at 8:17 PM, john casu j...@chiraldynamics.com wrote:

 Robert,

 I put debugging messages in FindFreeType.cmake, and the behavior is as
 expected within that cmake file, i.e. FREETYPE_INCLUDE_DIRS gets set
 correctly.

 The issue, as far as I can tell, is why cmake on os/x either isn't
 exporting FREETYPE_INCLUDE_DIRS, or there's a typo somewhere outside that
 file so that the variable isn't getting picked up.

 I spent a little time trying to debug this, but I'm not really getting
 anywhere, given that I have little cmake experience.  But, everything does
 seem to be working as expected, so it's a little bit of a mystery.

 certainly, the code in Find3rdPartyDependencies.cmake doesn't seem to be
 traversed, and src/osgPlugins/freetype/CMakeLists.txt seems to be correct.

 Unfortunately, I don't have enough time, right now, to devote to debugging
 this in any depth.   And since I do have a workaround, I'm not blocked.

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





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




Find3rdPartyDependencies.cmake
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] Fwd: OpenGL EXTENSION support

2009-03-19 Thread Robert Osfield
Hi Sajjad,

I don't have to time to teach you everything you need to know to do your
job, you'll need to go look at online docs on OpenGL, and looks through the
OSG examples and online docs, and review the OSG archives.

Robert.

2009/3/19 ami guru dosto.wa...@gmail.com

 Hello Robert,


 Thanks for the hint.

 But i did not understand the idea of Current OpenGL context

 And the class that you specified requires a context id to instantiate
 GL2Extensions object.

 Any more reference into that matter would be of great help



 Regards
 Sajjad

 -- Forwarded message --
 From: Robert Osfield robert.osfi...@gmail.com
 Date: 2009/3/19
 Subject: Re: [osg-users] OpenGL EXTENSION support
 To: OpenSceneGraph Users osg-users@lists.openscenegraph.org


 HI Sajjad,

 2009/3/18 ami guru dosto.wa...@gmail.com

 Is there any class or interface in OSG that can query and print out the
 supported extensions within the OpenGL driver ?


 There isn't a single method that returns a list of all supported
 extensions, but there are various methods for getting OpenGL function
 pointers and checking whether a specific extension is supported.  See
 include/osg/GLExtensions.

 Please note you'll need to have a valid graphics context, and for the
 extensions to be initialised before the functions will work as you can only
 do OpenGL calls from a thread with a valid graphics context.

 If you have happy do debug work on your app, then enable the verbose debug
 messages and this will output the lists of supported extensions for you.
 set the env var OSG_NOTIFY_LEVEL to DEBUG.

 Robert.



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



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


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


[osg-users] Fwd: creating widget for Qt

2009-03-19 Thread ami guru
Hello Ivan,


What is the difference betwen  the AdapterWidget and QOSGWidget.

I found one to be the subclass of GLWidget and the other is QWidget.

Which one is better ?

Any explanation?


Regards
Sajjad


-- Forwarded message --
From: Iván Cuevas okd...@gmail.com
Date: 2009/3/19
Subject: Re: [osg-users] creating widget for Qt
To: osg-users@lists.openscenegraph.org


Hi Sajjad,
The warnigs are because I'm rendering in a QWidget out of the paint event.
These warnings doesn't appear if you render in a QGLWidget, but the
CompositeViewer framework with multiple OSG views in different widgets and
multi-threaded does no render properly (at least for me [Crying or Very sad]
)

Recently I moved to Qt 4.5.0 and I had a new problem with undesired repaint
event when the OSG widget lost the focus. For example when a modal dialog is
shown, my QWidget embbeding the osg::View is repainted with the background
color and the content are removed until the osg widget recovers the focus
and is repainted again.
I solved this problem using QWidget::setUpdatesEnabled(false) but still I
have the problem of the warnings.

I think is not the same situation than yours because you are extending from
AdapterWidget, but tell if you discover something ;)

Regards,
Iván

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





___
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] DoomLike manipulator

2009-03-19 Thread Simon Loic
Hi guys,
I was looking for an osg manipulator fitted for walkthrough in architectural
environments. I found that the best ones were UFO, Drive and Flight. Though,
I was not really convinced by any of them as there is no direct control on
the speed but only on the acceleration. Thus, it is hard to change quickly
the direction of the movement.

Based on the UFO maipulator, I've implemented a manipulator closer to the
ones used in 3rd person games. I think it's documented enough and coded in a
simple way and so easy to review. So if some of you find it  promising and
useful, we could improve it and eventually submit it, so as to integrate it
in the osg Core.

Waiting for your suggestions.

Note: you may need to edit DoomLikeManipulator.cpp:16 #include
../inc/DoomLikeManipulator.h to get it compile.

-- 
Loïc Simon
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 *
 * This library is open source and may be redistributed and/or modified under  
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * OpenSceneGraph Public License for more details.
*/

#ifndef OSGGA_DOOM_LIKE_MANIPULATOR_DEF
#define OSGGA_DOOM_LIKE_MANIPULATOR_DEF 1

#include iostream

#include osgGA/MatrixManipulator
#include osg/Node
#include osg/Matrix

/**
  \class osgGA::DoomLikeManipulator
  \brief A DoomLike manipulator driven with keybindings.

  The DoomLikeManipulator is better suited for applications that employ architectural walk-throughs.
  The camera control is fone via keyboard arrows concerning the position and via mouse draging concerning the orientation.
  There are two modes : the horizontal and the free. In the free one the translation direction is exactly aligned with the view direction and thus can span the whole set of direction. In the other, the moving direction is constrained to remain horizontal. Note : horizontal mode is not implemented yet!!
  Unlike most of the other manipulators, the user controls directly the speed of the camera and not its acceleration.
  As a result, the user can achieve fast moves and yet change quickly the direction of the movement.

  The DoomLike Manipulator allows the following movements with the listed
  Key combinations:
\param SpaceBar Reset the view to the home position.
\param Shift/SpaceBar   Reset the up vector to the vertical.
\param UpArrow  Run forward.
\param DownArrowRun backward.
\param LeftArrowStep to the left.
\param RightArrow   Step to the right.
\param Shift/UpArrowMove up.
\param Shift/DownArrow  Move down.
\param Shift/Enter  Switch between horizontal and free mode.
\param DragMouseRotate the moving and looking direction.
*/

namespace osgGA {

class OSGGA_EXPORT DoomLikeManipulator : public osgGA::MatrixManipulator
{

public:
/** Default constructor */
DoomLikeManipulator();

/** return className
  \return returns constant DoomLike
  */
virtual const char* className() const;

/** Set the current position with a matrix 
  \param matrix  A viewpoint matrix.
 */
virtual void setByMatrix( const osg::Matrixd matrix ) ;

/** Set the current position with the inverse matrix
  \param invmat The inverse of a viewpoint matrix
  */
virtual void setByInverseMatrix( const osg::Matrixd invmat);

/** Get the current viewmatrix */
virtual osg::Matrixd getMatrix() const;

/** Get the current inverse view matrix */
virtual osg::Matrixd getInverseMatrix() const ;

/** Set the  subgraph this manipulator is driving the eye through.
\param node root of subgraph
 */
virtual void setNode(osg::Node* node);

/** Get the root node of the subgraph this manipulator is driving the eye through (const)*/
virtual const osg::Node* getNode() const;

/** Get the root node of the subgraph this manipulator is driving the eye through */
virtual osg::Node* getNode();

/** Computes the home position based on the extents and scale of the 
scene graph rooted at node */
virtual void computeHomePosition();

/** Sets the viewpoint matrix to the home position */
virtual void home(const osgGA::GUIEventAdapter, osgGA::GUIActionAdapter) ;
void home(double);

virtual void init(const GUIEventAdapter ,GUIActionAdapter);

/** Handles incoming osgGA events */
bool handle(const osgGA::GUIEventAdapter ea,osgGA::GUIActionAdapter aa);

/** Reports 

Re: [osg-users] creating widget for Qt

2009-03-19 Thread Iván Cuevas
Hi Sajjad,
The warnigs are because I'm rendering in a QWidget out of the paint event. 
These warnings doesn't appear if you render in a QGLWidget, but the 
CompositeViewer framework with multiple OSG views in different widgets and 
multi-threaded does no render properly (at least for me [Crying or Very sad] )

Recently I moved to Qt 4.5.0 and I had a new problem with undesired repaint 
event when the OSG widget lost the focus. For example when a modal dialog is 
shown, my QWidget embbeding the osg::View is repainted with the background 
color and the content are removed until the osg widget recovers the focus and 
is repainted again.
I solved this problem using QWidget::setUpdatesEnabled(false) but still I have 
the problem of the warnings.

I think is not the same situation than yours because you are extending from 
AdapterWidget, but tell if you discover something ;)

Regards,
Iván

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





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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread David Spilling
Hi,

FYI, there was a posting of a (presumably similar) WASD type manipulater by
Viggo Løvli back in August 08 - seach the archives for How to write a
camera manipulator...

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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Sukender
Hi Simon,

I coded a kind of human-view code which is typically what you want, but in a 
form that may not fit exactly what you need. It is a matrix getter, that is 
to say a class that only update the view matrix (inputs are grabbed from 
another class). Think about it as a delegate manipulator if you wish. Code is 
short, so you may take and adapt it. That should be very easy. Also feel free 
to send improvements and/or create a pure OSG manipulator based on all or 
part of it.

Doc: http://pvle.sourceforge.net/Doc/Html/classHumanMatrixGetter.html
Header: http://pvle.sourceforge.net/Doc/Html/HumanMatrixGetter_8h-source.html
CPP: http://pvle.sourceforge.net/Doc/Html/HumanMatrixGetter_8cpp-source.html

Hope it helps.

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


Le Thu, 19 Mar 2009 12:07:27 +0100, Simon Loic simon1l...@gmail.com a écrit:

 Hi guys,
 I was looking for an osg manipulator fitted for walkthrough in architectural
 environments. I found that the best ones were UFO, Drive and Flight. Though,
 I was not really convinced by any of them as there is no direct control on
 the speed but only on the acceleration. Thus, it is hard to change quickly
 the direction of the movement.

 Based on the UFO maipulator, I've implemented a manipulator closer to the
 ones used in 3rd person games. I think it's documented enough and coded in a
 simple way and so easy to review. So if some of you find it  promising and
 useful, we could improve it and eventually submit it, so as to integrate it
 in the osg Core.

 Waiting for your suggestions.

 Note: you may need to edit DoomLikeManipulator.cpp:16 #include
 ../inc/DoomLikeManipulator.h to get it compile.

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


[osg-users] Fwd: OpenGL EXTENSION support

2009-03-19 Thread ami guru
Hello Robert,


Thanks for the hint.

But i did not understand the idea of Current OpenGL context

And the class that you specified requires a context id to instantiate
GL2Extensions object.

Any more reference into that matter would be of great help



Regards
Sajjad

-- Forwarded message --
From: Robert Osfield robert.osfi...@gmail.com
Date: 2009/3/19
Subject: Re: [osg-users] OpenGL EXTENSION support
To: OpenSceneGraph Users osg-users@lists.openscenegraph.org


HI Sajjad,

2009/3/18 ami guru dosto.wa...@gmail.com

 Is there any class or interface in OSG that can query and print out the
 supported extensions within the OpenGL driver ?


There isn't a single method that returns a list of all supported extensions,
but there are various methods for getting OpenGL function pointers and
checking whether a specific extension is supported.  See
include/osg/GLExtensions.

Please note you'll need to have a valid graphics context, and for the
extensions to be initialised before the functions will work as you can only
do OpenGL calls from a thread with a valid graphics context.

If you have happy do debug work on your app, then enable the verbose debug
messages and this will output the lists of supported extensions for you.
set the env var OSG_NOTIFY_LEVEL to DEBUG.

Robert.



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


[osg-users] [forum] 3rd party Qt forum

2009-03-19 Thread Iván Cuevas
Hi all,
Qt is becoming more and more popular and looks like some people are working 
integrating OSG in this GUI framework.
What about to have a specific forum for Qt in the 3rd party section? 

Best regards,
Iván.

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





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


Re: [osg-users] FFmpeg plugin

2009-03-19 Thread Robert Osfield
HI Carlos,

You'll need to install the headers for ffmpeg and the device library.

Robet.

2009/3/19 Carlos Sanches ces...@gmail.com

 Hi Adrian !
 ok, I have the ffmpeg installed . I use it to convert my movies.
 Now I m seeing in ccmake configure list . but have some options that I dont
 know what I have to put there.
 the options are :

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVCODEC_LIBRARIES
 /usr/lib/libavcodec.so

  FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

  FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

  FFMPEG_LIBAVFORMAT_INCLUDE_DIR
 /usr/include

  FFMPEG_LIBAVFORMAT_LIBRARIES
 /usr/lib/libavformat.so

  FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVUTIL_LIBRARIES
 /usr/lib/libavutil.so

  FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBSWSCALE_LIBRARIES
 /usr/lib/libswscale.so

  FFMPEG_ROOT


 The options that I believe that must be wrong are:
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR
  FFMPEG_LIBAVDEVICE_LIBRARIES
  FFMPEG_ROOT

 What I have to do in these options ?
 tks








 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Carlos
 You have to donwload ffmpeg and build the plugin by setting up the right
 parameters in cmake. then osg will build the ffmpeg plugin as well as the
 other 3rd party plugins will be build.

 adrian

 2009/3/18 Carlos Sanches ces...@gmail.com

 Hi Robert.
 I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have
 the plugin for ffmpeg .
 this is correct ?
 I put this in my code ...
 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but how I know if it is using ffmpeg ?

 tks




 2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the option 
 -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 Robert.

 2009/3/16 Carlos Sanches ces...@gmail.com


 Hi all !
 I downloaded osg 2.9.1 . I m using  pImageStream =
 dynamic_castosg::ImageStream*(hudImage);
 to open a movie.
 What have I to do to use ffmpeg to read my movies ?

 tks




 ___
 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




 --
 
 Adrian Egli

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




 --
Carlos Sanches
 Programação Gráfica;

 Tel:  55 11 3816 2888
 Cel: 55 11 9650 7137

   Somar Meteorologia
 www.somarmeteorologia.com.br


 ___
 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] FFmpeg plugin

2009-03-19 Thread Adrian Egli OpenSceneGraph (3D)
I am working with windows, no problem there, but here my settings.
Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
Description: Path to a file.
Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
Description: Path to a library.
Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
Description: Path to a file.
Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
Description: Path to a library.
Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
Description: Path to a file.
Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
Description: Path to a library.
Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
Description: Path to a file.
Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
Description: Path to a library.
Current Value: F:/dev/ffmpeg/SDK/lib/avutil-49.lib
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBSWSCALE_INCLUDE_DIRS
Description: Path to a file.
Current Value: F:/dev/ffmpeg/SDK/include/libswscale
New Value (Enter to keep current value):

Variable Name: FFMPEG_LIBSWSCALE_LIBRARIES
Description: Path to a library.
Current Value: F:/dev/ffmpeg/SDK/lib/swscale-0.lib
New Value (Enter to keep current value):

Variable Name: FFMPEG_ROOT
Description: Location of FFMPEG
Current Value: F:/dev/ffmpeg/SDK/include
New Value (Enter to keep current value):


2009/3/19 Carlos Sanches ces...@gmail.com

 Hi Adrian !
 ok, I have the ffmpeg installed . I use it to convert my movies.
 Now I m seeing in ccmake configure list . but have some options that I dont
 know what I have to put there.
 the options are :

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVCODEC_LIBRARIES
 /usr/lib/libavcodec.so

  FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

  FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

  FFMPEG_LIBAVFORMAT_INCLUDE_DIR
 /usr/include

  FFMPEG_LIBAVFORMAT_LIBRARIES
 /usr/lib/libavformat.so

  FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVUTIL_LIBRARIES
 /usr/lib/libavutil.so

  FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBSWSCALE_LIBRARIES
 /usr/lib/libswscale.so

  FFMPEG_ROOT


 The options that I believe that must be wrong are:
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR
  FFMPEG_LIBAVDEVICE_LIBRARIES
  FFMPEG_ROOT

 What I have to do in these options ?
 tks








 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Carlos
 You have to donwload ffmpeg and build the plugin by setting up the right
 parameters in cmake. then osg will build the ffmpeg plugin as well as the
 other 3rd party plugins will be build.

 adrian

 2009/3/18 Carlos Sanches ces...@gmail.com

 Hi Robert.
 I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have
 the plugin for ffmpeg .
 this is correct ?
 I put this in my code ...
 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but how I know if it is using ffmpeg ?

 tks




 2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the option 
 -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 Robert.

 2009/3/16 Carlos Sanches ces...@gmail.com


 Hi all !
 I downloaded osg 2.9.1 . I m using  pImageStream =
 dynamic_castosg::ImageStream*(hudImage);
 to open a movie.
 What have I to do to use ffmpeg to read my movies ?

 tks




 ___
 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] FFmpeg plugin

2009-03-19 Thread Carlos Sanches
Hi Adrian !
ok, I have the ffmpeg installed . I use it to convert my movies.
Now I m seeing in ccmake configure list . but have some options that I dont
know what I have to put there.
the options are :

FFMPEG_LIBAVCODEC_INCLUDE_DIRS
/usr/include

 FFMPEG_LIBAVCODEC_LIBRARIES
/usr/lib/libavcodec.so

 FFMPEG_LIBAVDEVICE_INCLUDE_DIR
FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

 FFMPEG_LIBAVDEVICE_LIBRARIES
FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

 FFMPEG_LIBAVFORMAT_INCLUDE_DIR
/usr/include

 FFMPEG_LIBAVFORMAT_LIBRARIES
/usr/lib/libavformat.so

 FFMPEG_LIBAVUTIL_INCLUDE_DIRS
/usr/include

 FFMPEG_LIBAVUTIL_LIBRARIES
/usr/lib/libavutil.so

 FFMPEG_LIBSWSCALE_INCLUDE_DIRS
/usr/include

 FFMPEG_LIBSWSCALE_LIBRARIES
/usr/lib/libswscale.so

 FFMPEG_ROOT


The options that I believe that must be wrong are:
FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_ROOT

What I have to do in these options ?
tks








2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Carlos
 You have to donwload ffmpeg and build the plugin by setting up the right
 parameters in cmake. then osg will build the ffmpeg plugin as well as the
 other 3rd party plugins will be build.

 adrian

 2009/3/18 Carlos Sanches ces...@gmail.com

 Hi Robert.
 I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have
 the plugin for ffmpeg .
 this is correct ?
 I put this in my code ...
 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but how I know if it is using ffmpeg ?

 tks




 2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the option -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 Robert.

 2009/3/16 Carlos Sanches ces...@gmail.com


 Hi all !
 I downloaded osg 2.9.1 . I m using  pImageStream =
 dynamic_castosg::ImageStream*(hudImage);
 to open a movie.
 What have I to do to use ffmpeg to read my movies ?

 tks




 ___
 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




 --
 
 Adrian Egli

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




-- 
   Carlos Sanches
Programação Gráfica;

Tel:  55 11 3816 2888
Cel: 55 11 9650 7137

  Somar Meteorologia
www.somarmeteorologia.com.br
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] getDistanceToViewPoint not implemented in osgUtil::IntersectionVisitor

2009-03-19 Thread Jason Beverage
Hi Robert,

I was looking through CullVisitor and trying to get my head around the
difference between the eye point and the viewpoint.  Is the viewpoint stack
is used to deal with internal camera nodes then?  Then the eye point is
the main camera's position while the view point would be used for
currently executing camera node.  If you don't have any internal camera
nodes, then would the eye point and the viewpoint be equivalent?

Do you think it would make sense to just copy the implemention from
CullVisitor for the viewpoint/eyepoint stack into IntersectionVisitor?

Thanks!

Jason

2009/3/19 Robert Osfield robert.osfi...@gmail.com

 Hi Jason,

 This change would be appropriate.  Although we might want to review the eye
 point management, and perhaps eye + view points as potentially they aren't
 the same.  An stack for eye/viewpoint point might be need as well to cope
 with internal camera nodes.

 Robert.

 2009/3/18 Jason Beverage jasonbever...@gmail.com

 Hi Robert,

 I'm using LOD's in one of my apps to control the distance at which models
 first begin to appear and noticed that the IntersectionVisitor will still
 hit these nodes even if they are not visible.

 I tried setting the LODSelectionMode to
 USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION but it still selected invisible
 nodes.  After looking through the code I noticed that the
 getDistanceToViewPoint function is used by the LOD class but is not
 implemented by the IntersectionVisitor, so will always have the value of 0.

 I made a small class deriving from IntersectionVisitor that just returned
 getDistanceToEyePoint (which is overriden by IntersectionVisitor) and things
 seemed to behave more appropriately.

 class MyIntersectionVisitor : public osgUtil::IntersectionVisitor
 {
 public:
 MyIntersectionVisitor(osgUtil::Intersector* intersector=0,
 osgUtil::IntersectionVisitor::ReadCallback* readCallback=0)
 :IntersectionVisitor(intersector, readCallback)
 {
 }

 virtual float getDistanceToViewPoint(const osg::Vec3 pos, bool
 useLODScale) const
 {
return getDistanceToEyePoint(pos, useLODScale);
 }
 };

 Would this change, or something similar, be appropriate for inclusions in
 OSG?

 Thanks!

 Jason


 ___
 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] Setting alpha channel in Frag Shader does not work.

2009-03-19 Thread Steven Powers
Guy, Good Catch. Unfortunately that is just a typo in the post. My actual 
shader only writes out 4 values.

I do need to pass values along the alpha channel outside of 0-1. But even if I 
restrict myself to values from 0-1 I still get the incorrect data passed down 
to the image.

Any other ideas?

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





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


Re: [osg-users] getDistanceToViewPoint not implemented in osgUtil::IntersectionVisitor

2009-03-19 Thread Robert Osfield
Hi Jason,

2009/3/19 Jason Beverage jasonbever...@gmail.com

 Hi Robert,

 I was looking through CullVisitor and trying to get my head around the
 difference between the eye point and the viewpoint.  Is the viewpoint stack
 is used to deal with internal camera nodes then?  Then the eye point is
 the main camera's position while the view point would be used for
 currently executing camera node.  If you don't have any internal camera
 nodes, then would the eye point and the viewpoint be equivalent?


It's actually the other way around.  The eye point is the local cameras eye
point, while the viewpoint is the viewer's master camera's eye point,
normally they coincide, but in the case of RTT effects like shadows you will
generate the shadow from the light source center/direction while you'll
still want LOD calculation done against the viewer's eye point.

In the case of intersection testing you sometime want to use a dummy eye
point, such as by setting the eye point to the end of
LineSegmentIntersector, this can be done to make sure that LOD setting are
selected appropriate for your needs, same goes to billboard rotations.

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


Re: [osg-users] [osgPhysics] How to compile the pal project??l

2009-03-19 Thread kangsite
Thanks   Sukender
I will try agagin.

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





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


Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-19 Thread Steven Powers
I noticed something else that is interesting... 

When I use the following shader code:

gl_FragColor = vec4(vVertPos.xyz , 1);
(where vVertPos.xyz is the calculated 3D position) 

I get an accurate point cloud of the 3D points that matches up with the 
geometry of the scene perfectly.

When I use this shader code:

float depth = gl_FragCoord.z / gl_FragCoord.w;
gl_FragColor = vec4(vVertPos.xyz , depth);

I get what looks like the same point cloud but it is scaled up in every 
direction. Does this ring any bells for anyone?

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





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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Simon Loic
Thanks guys,
indeed the wasd manipulator does pretty much the same things as  mine.
Although I'm not interested in changing my manipulator. I was just pointing
out that this kind of manipulators are missing in the osg core. Basically if
the wasd manipulator had been integrated in osgGA, I wouldn't have coded an
equivalent from scratch.
So I was expecting some motivated comments on the manipulator I propose,
before to go through osg-submissions. Anyway if for any reason you think
that this is pointless, I'll just forget about it.



2009/3/19 David Spilling david.spill...@gmail.com

 Hi,

 FYI, there was a posting of a (presumably similar) WASD type manipulater by
 Viggo Løvli back in August 08 - seach the archives for How to write a
 camera manipulator...

 David


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




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


[osg-users] Units in an IVE File

2009-03-19 Thread Geoff
I am having a little bit of an issue with some of my files. I have a
database that is in FLT format. I can load it into my program, and it
takes a while, but when I query the height at a given x,y location, I
get the proper values.

Now, i have taken this file and converted it using the osgconv.exe
into an IVE file for better performance. This works well when loading
it into my viewer, but when I try and query the height at a given x,y,
the values I get back are erratic and not remotely close to what i am
looking for.

is there some way that the units in the ive could be getting messed up
(or does it even have a notion of units) and if not, what do I need to
do to make sure the number that I get returned is in Feet?

Thanks.

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


Re: [osg-users] Units in an IVE File

2009-03-19 Thread Paul Melis

Geoff wrote:

I am having a little bit of an issue with some of my files. I have a
database that is in FLT format. I can load it into my program, and it
takes a while, but when I query the height at a given x,y location, I
get the proper values.

Now, i have taken this file and converted it using the osgconv.exe
into an IVE file for better performance. This works well when loading
it into my viewer, but when I try and query the height at a given x,y,
the values I get back are erratic and not remotely close to what i am
looking for.

is there some way that the units in the ive could be getting messed up
(or does it even have a notion of units) and if not, what do I need to
do to make sure the number that I get returned is in Feet?
  
The openflight plugin seems to support a number of options related to 
units and conversion (see below).

Perhaps osgconv -O noUnitsConversion file.flt file.ive is what you want...

Paul

osgconv --formats

[...]

Plugin /home/paul/osg2.6/lib/osgPlugins-2.6.1/osgdb_openflight.so
{
   ReaderWriter : FLT Reader/Writer
   {
   extensions : .fltOpenFlight 
format

   options: billboardCenter Import option
   options: clampToEdge Import option
   options: convertToFeet   Import option
   options: convertToInches Import option
   options: convertToKilometers Import option
   options: convertToMeters Import option
   options: convertToNauticalMiles  Import option
   options: dofAnimationImport option
   options: keepExternalReferences  Import option
   options: lighting=ON|OFF   Export 
option: Specifies a default enable/disable state for lighting, for Nodes 
in the exported scene graph that don't set it explicitly. By default, 
the exporter assumes lighting is enabled (GL_LIGHTING ON). Set this to 
either ON or OFF. Example: lighting=OFF.

   options: noTextureAlphaForTransparancyBinningImport option
   options: noUnitsConversion   Import option
   options: preserveFaceImport option
   options: preserveObject  Import option
   options: readObjectRecordDataImport option
   options: stripTextureFilePathExport 
option: If present in the Options string, the exporter strips the path 
from texture file names, and writes only the texture file name to the 
FLT Texture Palette. By default, the exporter doesn't strip the path, 
and the name written to the Texture Palette is taken directly from the 
osg::Image object referenced by the osg::Texture2D StateAttribute.
   options: tempDir=dir   Export 
option: Specifies the directory to use for creation of temporary files. 
If not specified, the directory is taken from the file name. If the file 
doesn't contain a path, the current working directory is used. 
Applications should set this to the name of their app-specific temp 
directory. If the path contains spaces, use double quotes to ensure 
correct parsing. Examples: tempDir=/tmp, tempDir=C:\My Temp Dir.
   options: units=units   Export 
option: Specifies the contents of the Units field of the OpenFliht 
header record. Valid values include INCHES, FEET, METERS, KILOMETERS, 
and NATICAL_MILES. Default is METERS. Example: units=METERS.
   options: validateExport 
option: If present in the Options string, the plugin does not write an 
OpenFlight file. Instead, it returns an indication of the scene graph's 
suitability for OpenFlight export.
   options: version=ver   Export 
option: Specifies the version of the output OpenFlight file. Supported 
values include 15.7, 15.8, and 16.1. Default is 16.1. Example: 
version=15.8.

   }
   ReaderWriter : ATTR Image Attribute Reader/Writer
   {
   extensions : .attr   OpenFlight texture attribute format
   }
}


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


Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-19 Thread Daniel Holz
I suppose you are writing the data in a texture with gl_FragColor = vec4(..., 
depth).
What exactly are you doing with the data that you write afterwards, or how do 
you actually obtain your point cloud?

If for example you take the position vec4(..., depth) (which is a world space 
position?) and you would project it on the image plane by doing 
PROJECTIONMATRIX * MODELVIEWMATRIX * vec4(..., depth) then, if depth is not 
equals 1.0 you get a completely different projection on the screen after doing 
the perspective division.

Remember: your world space positions are specified in the homogenous coordinate 
system, meaning that a world space position (x,y,z) is represented by 
(x,y,z,1). If you want to project a world space position on the image plane it 
needs to have the w component (the 4th one) set to 1, since that's where the 
effect of perspective foreshortening is kind of stored after multiplication 
with the projection matrix.
The perspective division (dividing the x,y,z component by the resulting w 
component) then actually performs the projection.

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





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


Re: [osg-users] Multithreading crash due toosgDb::Registry::instance()

2009-03-19 Thread Paul Speed
Just a note for those of us who have been bitten by double check locking 
issues in Java, this technique is highly dependent on the threading and 
data architecture in use.  There are subtle issues between when a thread 
commits its local state and the possibility for the compiler to reorder 
statements.  This was less of an issue on single-core boxes but comes up 
in multi-core where the local thread state may not be committed.  I 
can't be sure but there may have also been some subtle statement 
reordering issues with respect to the compiler not knowing that your 
guard release _must_ be run after the instance_ = new Singleton has 
_fully_ executed.


I don't know if these problems crop up in C++ but it certainly seems 
like they could depending on the threading implementation and compiler 
optimization strategy.


Worst case for a singleton pattern is that you might get a race 
condition where two instances are created.  There are other 
double-checked locking situations that are much more insidious.


-Paul

Paul Melis wrote:

Robert Osfield wrote:
2009/3/17 Schmidt, Richard richard.schm...@eads.com 
mailto:richard.schm...@eads.com


http://www.cs.wustl.edu/~schmidt/PDF/DC-Locking.pdf
http://www.cs.wustl.edu/%7Eschmidt/PDF/DC-Locking.pdf


Could you explain what the above document is all about...
I just read it an it describes a pattern where you use a mutex to guard 
access to the singleton's _instance value, but in such a way that the 
mutex is only needed when _instance == NULL, i.e.


class Singleton
{
public:
   static Singleton *instance (void)
   {
// First check
if (instance_ == 0)
   {
  // Ensure serialization (guard constructor acquires lock_).
 GuardMutex guard (lock_);
 // Double check.
 if (instance_ == 0)
  instance_ = new Singleton;
   }
return instance_;
// guard destructor releases lock_.
   }
private:
   static Mutex lock_;
   static Singleton *instance_;
};

This should give you thread-safe access to Singleton-instance() at all 
times combined with correct initialization.


Quite neat actually,
Paul
___
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] Setting alpha channel in Frag Shader does not work.

2009-03-19 Thread Steven Powers
So far the alpha channel is completely ignored beyond the shader. I set each 
vertex of the point cloud based off the r,g,b channels of the image buffer.

Before I add the vertex to the point cloud the r,g,b channels of the image 
already seem to be scaled. I check this by logging the image values.

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





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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Robert Osfield
HI Loic,

The manipulator certainly isn't pointless - as the fact that others have
written something similar shows it's a common need, so getting something
like it checked into the core OSG makes sense.  I would suggest finding a
more generic name rather than DoomLikeManipulator.  Perhaps
FirstPersonManipulator?  I'm open to suggestions.

Robert.

2009/3/19 Simon Loic simon1l...@gmail.com

 Thanks guys,
 indeed the wasd manipulator does pretty much the same things as  mine.
 Although I'm not interested in changing my manipulator. I was just pointing
 out that this kind of manipulators are missing in the osg core. Basically if
 the wasd manipulator had been integrated in osgGA, I wouldn't have coded an
 equivalent from scratch.
 So I was expecting some motivated comments on the manipulator I propose,
 before to go through osg-submissions. Anyway if for any reason you think
 that this is pointless, I'll just forget about it.



 2009/3/19 David Spilling david.spill...@gmail.com

 Hi,

 FYI, there was a posting of a (presumably similar) WASD type manipulater
 by Viggo Løvli back in August 08 - seach the archives for How to write a
 camera manipulator...

 David


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




 --
 Loïc Simon

 ___
 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] How to know when an geode is visible bye the camera?

2009-03-19 Thread Adrien Mazaud
Hi everybody,

I have to develop an OSG application with timer trigger. Each object (ie. 
Geode) into my scene have to launch a timer when there are displayed (ie. in 
front of the camera, visible, showed or whatever you call it). When the timer 
is done, object have to trigger a function. My problem is to know when an 
object is visible by the camera. Is there any way to do it with OSG? I'm a old 
beginner with OSG (ie. a beginner since 6 month now :P)

Thank you so much for your help



Adrien

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





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


Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-19 Thread Steven Powers
Here is my shader code in its entirety.

Code:

//Shaders
const char VertexShaderSrc[]  = 
varying vec4 vVertPos;
attribute vec4 gl_MultiTexCoord0;
uniform mat4 osg_ViewMatrixInverse;
uniform vec3 worldOffset; //offset from world origin
void main(void)
{
   gl_Position = ftransform();
   vec4 eyeVector = gl_ModelViewMatrix * gl_Vertex;
   vVertPos = osg_ViewMatrixInverse * eyeVector;
   vVertPos.xyz = vVertPos.xyz - worldOffset;  //apply offset so it is 
in ansRel coordinates
   gl_TexCoord[0] = gl_MultiTexCoord0;
};

const char  FragShaderSrc[] = 
varying vec4 vVertPos;
uniform float minimumDistance;
uniform float maximumDistance;
uniform bool sendDepth;
void main(void)
{
   float depth = gl_FragCoord.z / gl_FragCoord.w;
   gl_FragDepth  = depth / maximumDistance;
   if(abs(depth)  minimumDistance || abs(depth)  maximumDistance)
   {
   gl_FragColor = vec4(0,0,0, 1);
   }
   else
   {
   if(sendDepth)
   {
   gl_FragColor = vec4(depth, depth, depth, depth);
   }
   else
   {
   gl_FragColor = vec4(vVertPos.xyz , 1);
   }
   }
} ;




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





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


Re: [osg-users] How to know when an geode is visible bye the camera?

2009-03-19 Thread Thrall, Bryan
Adrien Mazaud wrote on Thursday, March 19, 2009 11:59 AM:
 I have to develop an OSG application with timer trigger. Each object
(ie.
 Geode) into my scene have to launch a timer when there are displayed
(ie. in
 front of the camera, visible, showed or whatever you call it). When
the timer
 is done, object have to trigger a function. My problem is to know when
an
 object is visible by the camera. Is there any way to do it with OSG?
I'm a
 old beginner with OSG (ie. a beginner since 6 month now :P) 
 
 Thank you so much for your help

You could attach a DrawCallback to the Geode's Drawables, which would be
called each time that Drawable is rendered. Make sure your callback
makes the call on the Drawable to actually render it, though!

Alternatively, you could add a CullCallback to the Geode, and launch the
timer when the Geode is not culled (you'd want to use the same culling
logic that would normally happen; see osgUtil::CullVisitor).

HTH,
-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-19 Thread Daniel Holz
For the alpha channel look here: 
http://forum.openscenegraph.org/viewtopic.php?t=1776

I posted the solution to my problem (similar to yours) at the end of the thread.

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





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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Sukender
Hi all,

IMHO, FirstPersonManipulator should suit any first person cameras ; and a 
doom-like one is only a subset of a FPS manipulator. Think about Descent 
game, where you could go in any direction in space (no gravity to say where is 
the up direction). Doom-like has a fixed up vector that may not suit any 
use of a FPS view. I personally chose Human* prefix for Doom-like view (Hence 
HumanManipulator or HumanViewManipulator).

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


Le Thu, 19 Mar 2009 17:37:25 +0100, Robert Osfield robert.osfi...@gmail.com a 
écrit:

 HI Loic,

 The manipulator certainly isn't pointless - as the fact that others have
 written something similar shows it's a common need, so getting something
 like it checked into the core OSG makes sense.  I would suggest finding a
 more generic name rather than DoomLikeManipulator.  Perhaps
 FirstPersonManipulator?  I'm open to suggestions.

 Robert.

 2009/3/19 Simon Loic simon1l...@gmail.com

 Thanks guys,
 indeed the wasd manipulator does pretty much the same things as  mine.
 Although I'm not interested in changing my manipulator. I was just pointing
 out that this kind of manipulators are missing in the osg core. Basically if
 the wasd manipulator had been integrated in osgGA, I wouldn't have coded an
 equivalent from scratch.
 So I was expecting some motivated comments on the manipulator I propose,
 before to go through osg-submissions. Anyway if for any reason you think
 that this is pointless, I'll just forget about it.



 2009/3/19 David Spilling david.spill...@gmail.com

 Hi,

 FYI, there was a posting of a (presumably similar) WASD type manipulater
 by Viggo Løvli back in August 08 - seach the archives for How to write a
 camera manipulator...

 David


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




 --
 Loïc Simon

 ___
 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] DoomLike manipulator

2009-03-19 Thread Michael Platings
AFAIK you play as a human in Descent ;)

Essentially it's to give the effect of walking/running, so how about 
WalkManipulator?

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sukender
Sent: 19 March 2009 17:57
To: OpenSceneGraph Users
Subject: Re: [osg-users] DoomLike manipulator

Hi all,

IMHO, FirstPersonManipulator should suit any first person cameras ; and a 
doom-like one is only a subset of a FPS manipulator. Think about Descent 
game, where you could go in any direction in space (no gravity to say where is 
the up direction). Doom-like has a fixed up vector that may not suit any 
use of a FPS view. I personally chose Human* prefix for Doom-like view (Hence 
HumanManipulator or HumanViewManipulator).

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


Le Thu, 19 Mar 2009 17:37:25 +0100, Robert Osfield robert.osfi...@gmail.com a 
écrit:

 HI Loic,

 The manipulator certainly isn't pointless - as the fact that others 
 have written something similar shows it's a common need, so getting 
 something like it checked into the core OSG makes sense.  I would 
 suggest finding a more generic name rather than DoomLikeManipulator.  
 Perhaps FirstPersonManipulator?  I'm open to suggestions.

 Robert.

 2009/3/19 Simon Loic simon1l...@gmail.com

 Thanks guys,
 indeed the wasd manipulator does pretty much the same things as  mine.
 Although I'm not interested in changing my manipulator. I was just 
 pointing out that this kind of manipulators are missing in the osg 
 core. Basically if the wasd manipulator had been integrated in osgGA, 
 I wouldn't have coded an equivalent from scratch.
 So I was expecting some motivated comments on the manipulator I 
 propose, before to go through osg-submissions. Anyway if for any 
 reason you think that this is pointless, I'll just forget about it.



 2009/3/19 David Spilling david.spill...@gmail.com

 Hi,

 FYI, there was a posting of a (presumably similar) WASD type 
 manipulater by Viggo Løvli back in August 08 - seach the archives 
 for How to write a camera manipulator...

 David


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




 --
 Loïc Simon

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


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

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] FFmpeg plugin

2009-03-19 Thread Carlos Sanches
Ok , I did it .
now I m trying to run de example:
 osgmovie -e ffmpeg

this error occours

Warning: dynamic library '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so'
exists, but an error occurred while trying to open it:
/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
inflateInit_
Usage: ./osgmovie [options] filename ...
Options:
...




2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 I am working with windows, no problem there, but here my settings.
 Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avutil-49.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/libswscale
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/swscale-0.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_ROOT
 Description: Location of FFMPEG
 Current Value: F:/dev/ffmpeg/SDK/include
 New Value (Enter to keep current value):


 2009/3/19 Carlos Sanches ces...@gmail.com

 Hi Adrian !
 ok, I have the ffmpeg installed . I use it to convert my movies.
 Now I m seeing in ccmake configure list . but have some options that I
 dont know what I have to put there.
 the options are :

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVCODEC_LIBRARIES
 /usr/lib/libavcodec.so

  FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

  FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

  FFMPEG_LIBAVFORMAT_INCLUDE_DIR
 /usr/include

  FFMPEG_LIBAVFORMAT_LIBRARIES
 /usr/lib/libavformat.so

  FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVUTIL_LIBRARIES
 /usr/lib/libavutil.so

  FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBSWSCALE_LIBRARIES
 /usr/lib/libswscale.so

  FFMPEG_ROOT


 The options that I believe that must be wrong are:
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR
  FFMPEG_LIBAVDEVICE_LIBRARIES
  FFMPEG_ROOT

 What I have to do in these options ?
 tks








 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Carlos
 You have to donwload ffmpeg and build the plugin by setting up the right
 parameters in cmake. then osg will build the ffmpeg plugin as well as the
 other 3rd party plugins will be build.

 adrian

 2009/3/18 Carlos Sanches ces...@gmail.com

 Hi Robert.
 I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have
 the plugin for ffmpeg .
 this is correct ?
 I put this in my code ...
 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but how I know if it is using ffmpeg ?

 tks




 2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the option 
 -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 Robert.

 2009/3/16 Carlos Sanches ces...@gmail.com


 Hi all !
 I downloaded osg 2.9.1 . I m using  pImageStream =
 dynamic_castosg::ImageStream*(hudImage);
 to open a movie.
 What have I to do to use ffmpeg to read my movies ?

 tks




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

 

Re: [osg-users] FFmpeg plugin

2009-03-19 Thread Carlos Sanches
my ffmpeg version



FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration:
  libavutil 49.15. 0 / 49.15. 0
  libavcodec52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  built on Mar 19 2009 12:47:35, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
ffmpeg: missing argument for option '-v'




On Thu, Mar 19, 2009 at 3:45 PM, Carlos Sanches ces...@gmail.com wrote:

 Ok , I did it .
 now I m trying to run de example:
  osgmovie -e ffmpeg

 this error occours

 Warning: dynamic library '/usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so'
 exists, but an error occurred while trying to open it:
 /usr/local/lib/osgPlugins-2.9.1/osgdb_ffmpeg.so: undefined symbol:
 inflateInit_
 Usage: ./osgmovie [options] filename ...
 Options:
 ...





 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 I am working with windows, no problem there, but here my settings.
 Variable Name: FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVCODEC
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVCODEC_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avcodec-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVDEVICE
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVDEVICE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avdevice-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVFORMAT
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVFORMAT_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avformat-52.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/LIBAVUTIL
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBAVUTIL_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/avutil-49.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 Description: Path to a file.
 Current Value: F:/dev/ffmpeg/SDK/include/libswscale
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_LIBSWSCALE_LIBRARIES
 Description: Path to a library.
 Current Value: F:/dev/ffmpeg/SDK/lib/swscale-0.lib
 New Value (Enter to keep current value):

 Variable Name: FFMPEG_ROOT
 Description: Location of FFMPEG
 Current Value: F:/dev/ffmpeg/SDK/include
 New Value (Enter to keep current value):


 2009/3/19 Carlos Sanches ces...@gmail.com

 Hi Adrian !
 ok, I have the ffmpeg installed . I use it to convert my movies.
 Now I m seeing in ccmake configure list . but have some options that I
 dont know what I have to put there.
 the options are :

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVCODEC_LIBRARIES
 /usr/lib/libavcodec.so

  FFMPEG_LIBAVDEVICE_INCLUDE_DIR
 FFMPEG_LIBAVDEVICE_INCLUDE_DIRS-NOTFOUND

  FFMPEG_LIBAVDEVICE_LIBRARIES
 FFMPEG_LIBAVDEVICE_LIBRARIES-NOTFOUND

  FFMPEG_LIBAVFORMAT_INCLUDE_DIR
 /usr/include

  FFMPEG_LIBAVFORMAT_LIBRARIES
 /usr/lib/libavformat.so

  FFMPEG_LIBAVUTIL_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBAVUTIL_LIBRARIES
 /usr/lib/libavutil.so

  FFMPEG_LIBSWSCALE_INCLUDE_DIRS
 /usr/include

  FFMPEG_LIBSWSCALE_LIBRARIES
 /usr/lib/libswscale.so

  FFMPEG_ROOT


 The options that I believe that must be wrong are:
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR
  FFMPEG_LIBAVDEVICE_LIBRARIES
  FFMPEG_ROOT

 What I have to do in these options ?
 tks








 2009/3/19 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Carlos
 You have to donwload ffmpeg and build the plugin by setting up the right
 parameters in cmake. then osg will build the ffmpeg plugin as well as the
 other 3rd party plugins will be build.

 adrian

 2009/3/18 Carlos Sanches ces...@gmail.com

 Hi Robert.
 I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have
 the plugin for ffmpeg .
 this is correct ?
 I put this in my code ...
 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 but how I know if it is using ffmpeg ?

 tks




 2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll 
 need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the 
 option -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 std::string libName =
 

Re: [osg-users] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-03-19 Thread Eric Sokolowsky
I  compiled svn with cmake 2.6.3 on OSX without difficulty, in a clean
directory, using all of the default settings, so I cannot confirm the
existence of this bug.

-Eric

On Mon, Mar 16, 2009 at 9:19 PM, john casu osgfo...@tevs.eu wrote:

 I'm trying to build the latest svn version of OSG 2.8.0 on OS/X, and I'm
 having a problem when building osgdb_freetype, specifically the header file
 ft2build.h cannot be located:
 Scanning dependencies of target osgdb_freetype
 [ 98%] Building CXX object
 src/osgPlugins/freetype/CMakeFiles/osgdb_freetype.dir/FreeTypeFont.cpp.o
 In file included from
 /Users/casuj/OpenSceneGraph/OpenSceneGraph-2.8.0-svn/src/osgPlugins/freetype/FreeTypeFont.cpp:14:
 /Users/casuj/OpenSceneGraph/OpenSceneGraph-2.8.0-svn/src/osgPlugins/freetype/FreeTypeFont.h:19:22:
 error: ft2build.h: No such file or directory
 /Users/casuj/OpenSceneGraph/OpenSceneGraph-2.8.0-svn/src/osgPlugins/freetype/FreeTypeFont.h:20:10:
 error: #include expects FILENAME or FILENAME

 However, CMakeCache.txt shows that this file has been located:
 enterprise:OpenSceneGraph-2.8.0-svn casuj$ fgrep FREETYPE CMakeCache.txt

 CMakeCache.txt:FREETYPE_INCLUDE_DIR_freetype2:PATH=/usr/local/include/freetype2
 CMakeCache.txt:FREETYPE_INCLUDE_DIR_ft2build:PATH=/usr/local/include
 CMakeCache.txt:FREETYPE_LIBRARY:FILEPATH=/usr/local/lib/libfreetype.dylib

 and the file itself does in fact exist:
 enterprise:OpenSceneGraph-2.8.0-svn casuj$ ls -l
 /usr/local/include/ft2build.h
 -rw-r--r--  1 root  admin  3890 Mar  5  2007 /usr/local/include/ft2build.h

 Can anyone shed light on how to workaround this ?

 Thanks,

 -john c.

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





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

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


Re: [osg-users] Image Resolution in VPB

2009-03-19 Thread Martins Innus

Robert,
	Thanks. Using -e with appropriate options did exactly what I wanted, 
except for a slight error on the edges of the created images.  If i 
overlay the created image tiles from the highest resolution level on top 
of the original source imagery, they are pixel to pixel exact except for 
a 1 pixel strip all the way around the image.
	It appears that the edge values are an average of what the pixel value 
actually should be and the pixel directly adjacent to it but what should 
be the next tile.
	If you layer the attached good and bad images on top of each other in 
an image viewer and toggle back and forth you can see the pixels changing.
	The good image is just the original source imagery zoomed in.  The bad 
image shows the vpb generated tile overlayed  on the left side.


	I saw the corner equalization bug posts, but this seems like a 
different issue.


This is under Redhat Enterpise Linux, x86_64, with OSG 2.8 and VPB svn 
of a couple days ago.


Martins


Robert Osfield wrote:

Hi Martins,

You could try to use the -e option.  It takes lat/longs as input.  I 
don't know if it'll pad though, as I suspect it won't unless the at 
least some of the input data covers the region.   If you want to force 
the resolution to be the same then just use the image and height res 
option.  I can't recall what they off the top of my head, run osgdem 
--help to list them all.


Robert.

On Mon, Mar 16, 2009 at 6:12 PM, Martins Innus min...@ccr.buffalo.edu 
mailto:min...@ccr.buffalo.edu wrote:


Hello,
   I'm using VPB to generate a terrain database with 2ft
resolution elevation data and 1 ft resolution imagery. What I'm
trying to do is make the imagery in the highest resolution tiles
have the exact same resolution as the source imagery and also still
be a power of 2 for the image tiles.
   I've verified that if I take a small input area where the
source imagery dimensions are a power of 2, I get what i want for
the final model.
   It seems that if I could tell VPB to pad out the extents of
my input data to a power of 2 that should work as well.  I don't
care if its black or garbage or whatever.

   Would the -e option do what I want if I specify extents
larger than the input data?  I'm about to give that a try but it
takes about three days for this job to run to completion, so I
figured I would ask if anyone has tried to do the same thing.

Thanks for any insight.

Martins
___
osg-users mailing list
osg-users@lists.openscenegraph.org
mailto: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
inline: good_tex.jpginline: bad_tex.jpg___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG 2.8.1

2009-03-19 Thread Andy Skinner
This seems to work, too.  I haven't done what I'd call a thorough 
qualification, but I'm happy.

thanks,
andy

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Wednesday, March 18, 2009 12:39 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OSG 2.8.1

Hi Andy,
2009/3/18 Andy Skinner 
andy.skin...@mathworks.commailto:andy.skin...@mathworks.com

You know, I was thinking that using SVN was going to get me the latest, but I 
bet I'm just getting SVN from when 2.8.0 was made.  I'm using the line (copied 
from downloads page):

svn co 
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.8.0 
OpenSceneGraph



Was that the wrong thing?

You're just picking up on the 2.8.0 tag, which is effectively set is stone now 
as it maps directly to what the 2.8.0 binaries etc. were built from.

The version of test against is the OSG-2.8 branch, this is what we used to 
source the 2.8.0 tag, and where all the patches for the ongoing 2.8.x series 
have been applied, and when it comes to making 2.8.1 it'll be sourced directly 
from the OSG-2.8.  To get the OSG-2.8 branch us:

svn co 
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8OpenSceneGraph-2.8http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8
 OpenSceneGraph

2.8 in theory should be like 2.8.0 except for a number of bug fixes that've 
been applied.

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


Re: [osg-users] [forum] 3rd party Qt forum

2009-03-19 Thread Art Tevs
Hi Ivan,

I've looked into the messages of the last week. There were only 5 Topics about 
Qt and only 3 of them were written by forum users, the rest was written by 
mailing list users. Hence, I am not sure if there is now enough interest to 
open a new subforum (mails from list users wouldn't be filtered correctly, 
because they do not use the subject prefixes). Having too much subforums will 
end up in an complex/unclear forum with too much cetegories.

The 3rdParty catgeory was created for the NodeKits which are created for the 
OSG. As far as I know, there is no such nodekit which handles the Qt 
integration. There is only couple of example doing this. Maybe we could create 
a category named  GUI, Widget, or something similar, so that it covers also 
Qt.

What do you think? Or what other are also think about this?

Cheers,
art

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





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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Simon Loic
Glad to see that this manipulator generates interest.
Concerning the name, the manipulator is designed as explained in the header
:


 The camera control is done via keyboard arrows concerning the position and
via mouse draging concerning the orientation.
There are two modes : the horizontal and the free. In the free one the
translation direction is exactly aligned with the view direction and thus
can span the whole set of direction. In the other, the moving direction is
constrained to remain horizontal. Note : horizontal mode is not implemented
yet!!

Taking into account what you said, Sukender, we should call it
FirstPesonManipulator and call the two modes GENERAL and DOOMLIKE.
What do you think about this?

On Thu, Mar 19, 2009 at 7:12 PM, Michael Platings
mplati...@pixelpower.comwrote:

 AFAIK you play as a human in Descent ;)

 Essentially it's to give the effect of walking/running, so how about
 WalkManipulator?

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sukender
 Sent: 19 March 2009 17:57
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] DoomLike manipulator

 Hi all,

 IMHO, FirstPersonManipulator should suit any first person cameras ; and
 a doom-like one is only a subset of a FPS manipulator. Think about
 Descent game, where you could go in any direction in space (no gravity to
 say where is the up direction). Doom-like has a fixed up vector that may
 not suit any use of a FPS view. I personally chose Human* prefix for
 Doom-like view (Hence HumanManipulator or HumanViewManipulator).

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


 Le Thu, 19 Mar 2009 17:37:25 +0100, Robert Osfield 
 robert.osfi...@gmail.com a écrit:

  HI Loic,
 
  The manipulator certainly isn't pointless - as the fact that others
  have written something similar shows it's a common need, so getting
  something like it checked into the core OSG makes sense.  I would
  suggest finding a more generic name rather than DoomLikeManipulator.
  Perhaps FirstPersonManipulator?  I'm open to suggestions.
 
  Robert.
 
  2009/3/19 Simon Loic simon1l...@gmail.com
 
  Thanks guys,
  indeed the wasd manipulator does pretty much the same things as  mine.
  Although I'm not interested in changing my manipulator. I was just
  pointing out that this kind of manipulators are missing in the osg
  core. Basically if the wasd manipulator had been integrated in osgGA,
  I wouldn't have coded an equivalent from scratch.
  So I was expecting some motivated comments on the manipulator I
  propose, before to go through osg-submissions. Anyway if for any
  reason you think that this is pointless, I'll just forget about it.
 
 
 
  2009/3/19 David Spilling david.spill...@gmail.com
 
  Hi,
 
  FYI, there was a posting of a (presumably similar) WASD type
  manipulater by Viggo Løvli back in August 08 - seach the archives
  for How to write a camera manipulator...
 
  David
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
  h.org
 
 
 
 
  --
  Loïc Simon
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph
  .org
 

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

 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit 
 http://www.messagelabs.com/email__

 __
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.

 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email
 __
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Sukender
Yes... But in a space ship! ;)

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


Le Thu, 19 Mar 2009 19:12:55 +0100, Michael Platings mplati...@pixelpower.com 
a écrit:

 AFAIK you play as a human in Descent ;)

 Essentially it's to give the effect of walking/running, so how about 
 WalkManipulator?

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sukender
 Sent: 19 March 2009 17:57
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] DoomLike manipulator

 Hi all,

 IMHO, FirstPersonManipulator should suit any first person cameras ; and a 
 doom-like one is only a subset of a FPS manipulator. Think about Descent 
 game, where you could go in any direction in space (no gravity to say where 
 is the up direction). Doom-like has a fixed up vector that may not suit 
 any use of a FPS view. I personally chose Human* prefix for Doom-like view 
 (Hence HumanManipulator or HumanViewManipulator).

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


 Le Thu, 19 Mar 2009 17:37:25 +0100, Robert Osfield robert.osfi...@gmail.com 
 a écrit:

 HI Loic,

 The manipulator certainly isn't pointless - as the fact that others
 have written something similar shows it's a common need, so getting
 something like it checked into the core OSG makes sense.  I would
 suggest finding a more generic name rather than DoomLikeManipulator.
 Perhaps FirstPersonManipulator?  I'm open to suggestions.

 Robert.

 2009/3/19 Simon Loic simon1l...@gmail.com

 Thanks guys,
 indeed the wasd manipulator does pretty much the same things as  mine.
 Although I'm not interested in changing my manipulator. I was just
 pointing out that this kind of manipulators are missing in the osg
 core. Basically if the wasd manipulator had been integrated in osgGA,
 I wouldn't have coded an equivalent from scratch.
 So I was expecting some motivated comments on the manipulator I
 propose, before to go through osg-submissions. Anyway if for any
 reason you think that this is pointless, I'll just forget about it.



 2009/3/19 David Spilling david.spill...@gmail.com

 Hi,

 FYI, there was a posting of a (presumably similar) WASD type
 manipulater by Viggo Løvli back in August 08 - seach the archives
 for How to write a camera manipulator...

 David


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




 --
 Loïc Simon

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


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

 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email 
 __

 __
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.

 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email
 __
 ___
 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] DoomLike manipulator

2009-03-19 Thread Sukender
Hi Michael,

Havig both modes sounds a good idea. In that case, FirstPersonManipulator 
seems fine for me. Just be sure to:
- allow the user to set which vector is considered to be up
- allow the user to set the minimum angle between dir and up (or else you 
got rounding errors that cause ugly artifacts). Based on experiments, I 
personnaly used 0.008 (radians; as you can see in the source code I told 
about), but it may depend on how your camera is set.

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


Le Thu, 19 Mar 2009 21:08:45 +0100, Simon Loic simon1l...@gmail.com a écrit:

 Glad to see that this manipulator generates interest.
 Concerning the name, the manipulator is designed as explained in the header
 :

 
  The camera control is done via keyboard arrows concerning the position and
 via mouse draging concerning the orientation.
 There are two modes : the horizontal and the free. In the free one the
 translation direction is exactly aligned with the view direction and thus
 can span the whole set of direction. In the other, the moving direction is
 constrained to remain horizontal. Note : horizontal mode is not implemented
 yet!!
 
 Taking into account what you said, Sukender, we should call it
 FirstPesonManipulator and call the two modes GENERAL and DOOMLIKE.
 What do you think about this?

 On Thu, Mar 19, 2009 at 7:12 PM, Michael Platings
 mplati...@pixelpower.comwrote:

 AFAIK you play as a human in Descent ;)

 Essentially it's to give the effect of walking/running, so how about
 WalkManipulator?

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sukender
 Sent: 19 March 2009 17:57
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] DoomLike manipulator

 Hi all,

 IMHO, FirstPersonManipulator should suit any first person cameras ; and
 a doom-like one is only a subset of a FPS manipulator. Think about
 Descent game, where you could go in any direction in space (no gravity to
 say where is the up direction). Doom-like has a fixed up vector that may
 not suit any use of a FPS view. I personally chose Human* prefix for
 Doom-like view (Hence HumanManipulator or HumanViewManipulator).

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


 Le Thu, 19 Mar 2009 17:37:25 +0100, Robert Osfield 
 robert.osfi...@gmail.com a écrit:

  HI Loic,
 
  The manipulator certainly isn't pointless - as the fact that others
  have written something similar shows it's a common need, so getting
  something like it checked into the core OSG makes sense.  I would
  suggest finding a more generic name rather than DoomLikeManipulator.
  Perhaps FirstPersonManipulator?  I'm open to suggestions.
 
  Robert.
 
  2009/3/19 Simon Loic simon1l...@gmail.com
 
  Thanks guys,
  indeed the wasd manipulator does pretty much the same things as  mine.
  Although I'm not interested in changing my manipulator. I was just
  pointing out that this kind of manipulators are missing in the osg
  core. Basically if the wasd manipulator had been integrated in osgGA,
  I wouldn't have coded an equivalent from scratch.
  So I was expecting some motivated comments on the manipulator I
  propose, before to go through osg-submissions. Anyway if for any
  reason you think that this is pointless, I'll just forget about it.
 
 
 
  2009/3/19 David Spilling david.spill...@gmail.com
 
  Hi,
 
  FYI, there was a posting of a (presumably similar) WASD type
  manipulater by Viggo Løvli back in August 08 - seach the archives
  for How to write a camera manipulator...
 
  David
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
  h.org
 
 
 
 
  --
  Loïc Simon
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph
  .org
 

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

 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit 
 http://www.messagelabs.com/email__

 __
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.

 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email
 

Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Jason Daly

Simon Loic wrote:

Glad to see that this manipulator generates interest.
Concerning the name, the manipulator is designed as explained in the 
header :



 The camera control is done via keyboard arrows concerning the 
position and via mouse draging concerning the orientation.
There are two modes : the horizontal and the free. In the free one the 
translation direction is exactly aligned with the view direction and 
thus can span the whole set of direction. In the other, the moving 
direction is constrained to remain horizontal. Note : horizontal mode 
is not implemented yet!!


Taking into account what you said, Sukender, we should call it 
FirstPesonManipulator and call the two modes GENERAL and DOOMLIKE.

What do you think about this?


I wouldn't call it DOOMLIKE for two reasons.  First, DOOM's mouse 
controls didn't work this way (the Y-axis on the mouse was used for 
forward/backward motion, since you couldn't look up/down in DOOM).  
Second, I don't think it should be named based on whatever game happened 
to use it in the first place.  If someone hasn't played that particular 
game, that name won't mean anything to them.


How about GENERAL and GROUNDED instead?

By the way, does this manipulator include collision and terrain 
following (specifically in what I'm suggesting calling the GROUNDED mode)?


--J

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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Sukender
And about the modes, I would prefer FREE and HORIZONTAL :)

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


Le Thu, 19 Mar 2009 21:38:16 +0100, Sukender suky0...@free.fr a écrit:

 Hi Michael,

 Havig both modes sounds a good idea. In that case, FirstPersonManipulator 
 seems fine for me. Just be sure to:
 - allow the user to set which vector is considered to be up
 - allow the user to set the minimum angle between dir and up (or else you 
 got rounding errors that cause ugly artifacts). Based on experiments, I 
 personnaly used 0.008 (radians; as you can see in the source code I told 
 about), but it may depend on how your camera is set.

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


 Le Thu, 19 Mar 2009 21:08:45 +0100, Simon Loic simon1l...@gmail.com a écrit:

 Glad to see that this manipulator generates interest.
 Concerning the name, the manipulator is designed as explained in the header
 :

 
  The camera control is done via keyboard arrows concerning the position and
 via mouse draging concerning the orientation.
 There are two modes : the horizontal and the free. In the free one the
 translation direction is exactly aligned with the view direction and thus
 can span the whole set of direction. In the other, the moving direction is
 constrained to remain horizontal. Note : horizontal mode is not implemented
 yet!!
 
 Taking into account what you said, Sukender, we should call it
 FirstPesonManipulator and call the two modes GENERAL and DOOMLIKE.
 What do you think about this?

 On Thu, Mar 19, 2009 at 7:12 PM, Michael Platings
 mplati...@pixelpower.comwrote:

 AFAIK you play as a human in Descent ;)

 Essentially it's to give the effect of walking/running, so how about
 WalkManipulator?

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sukender
 Sent: 19 March 2009 17:57
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] DoomLike manipulator

 Hi all,

 IMHO, FirstPersonManipulator should suit any first person cameras ; and
 a doom-like one is only a subset of a FPS manipulator. Think about
 Descent game, where you could go in any direction in space (no gravity to
 say where is the up direction). Doom-like has a fixed up vector that may
 not suit any use of a FPS view. I personally chose Human* prefix for
 Doom-like view (Hence HumanManipulator or HumanViewManipulator).

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


 Le Thu, 19 Mar 2009 17:37:25 +0100, Robert Osfield 
 robert.osfi...@gmail.com a écrit:

  HI Loic,
 
  The manipulator certainly isn't pointless - as the fact that others
  have written something similar shows it's a common need, so getting
  something like it checked into the core OSG makes sense.  I would
  suggest finding a more generic name rather than DoomLikeManipulator.
  Perhaps FirstPersonManipulator?  I'm open to suggestions.
 
  Robert.
 
  2009/3/19 Simon Loic simon1l...@gmail.com
 
  Thanks guys,
  indeed the wasd manipulator does pretty much the same things as  mine.
  Although I'm not interested in changing my manipulator. I was just
  pointing out that this kind of manipulators are missing in the osg
  core. Basically if the wasd manipulator had been integrated in osgGA,
  I wouldn't have coded an equivalent from scratch.
  So I was expecting some motivated comments on the manipulator I
  propose, before to go through osg-submissions. Anyway if for any
  reason you think that this is pointless, I'll just forget about it.
 
 
 
  2009/3/19 David Spilling david.spill...@gmail.com
 
  Hi,
 
  FYI, there was a posting of a (presumably similar) WASD type
  manipulater by Viggo Løvli back in August 08 - seach the archives
  for How to write a camera manipulator...
 
  David
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
  h.org
 
 
 
 
  --
  Loïc Simon
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph
  .org
 

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

 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit 
 http://www.messagelabs.com/email__

 __
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are 

Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Jason Daly

Sukender wrote:

And about the modes, I would prefer FREE and HORIZONTAL :)
  


My preference would be GROUNDED (as in, you stay on the ground) rather 
than HORIZONTAL.  To me HORIZONTAL kind of implies one-dimensional 
motion.


I'm indifferent on FREE vs. GENERAL.

--J

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


[osg-users] DrawElements* memory management

2009-03-19 Thread Paul Martz
Hi Robert -- I have a question about how the DrawElements* family of
PrimitiveSets handles the pointer to the indices.
 
In OpenGL, data is bound/copied at call time, so if I were writing a plain
ol' OpenGL app and calling glDrawElements, I'd pass in a pointer to my index
data, and when the call returns, I'd know the indices had been copied and I
could safely delete the array of indices.
 
In OSG it's a bit different. Even after I create the DrawElements
PrimitiveSet, I need to hang on to the index data memory, as the memory will
be accessed during subsequent rendering and/or write operations. Unlike
other OSG objects, the index array isn't reference counted internally.
Indeed, the interface looks a lot like the glDrawElements call in that the
index data parameter is a plain pointer, but it does not act like
glDrawElements as it doesn't immediately copy the index data. This forces my
app to keep the data around and ensure it isn't deleted.
 
This is cumbersome in modular programming situations. Imagine I have a
NodeVisitor that converts DrawArrays to DrawElements and therefore allocates
memory to hold the index data. The processed scene graph could have a life
that extends far beyond the scope of the NodeVisitor, so it doesn't make
sense to keep the addresses stored in the NodeVisitor (where the memory was
allocated). So who should keep track of the index data memory addresses? Who
should own deleting that memory?
 
This isn't the first time I've encountered this situation, and I thought
perhaps you had encountered it as well and maybe had a good solution that I
was not aware of. If so, please let me know. Thanks in advance.
 
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] DrawElements* memory management

2009-03-19 Thread Paul Martz
Ignore this post. The answer is: DrawElementsUInt is a VectorGLuint. Of
course, I had to post and show my ignorance first before I figured that out.
:-/
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com http://www.skew-matrix.com/ 
+1 303 859 9466
 

  _  

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz
Sent: Thursday, March 19, 2009 2:35 PM
To: 'OpenSceneGraph Users'
Subject: [osg-users] DrawElements* memory management


Hi Robert -- I have a question about how the DrawElements* family of
PrimitiveSets handles the pointer to the indices.
 
In OpenGL, data is bound/copied at call time, so if I were writing a plain
ol' OpenGL app and calling glDrawElements, I'd pass in a pointer to my index
data, and when the call returns, I'd know the indices had been copied and I
could safely delete the array of indices.
 
In OSG it's a bit different. Even after I create the DrawElements
PrimitiveSet, I need to hang on to the index data memory, as the memory will
be accessed during subsequent rendering and/or write operations. Unlike
other OSG objects, the index array isn't reference counted internally.
Indeed, the interface looks a lot like the glDrawElements call in that the
index data parameter is a plain pointer, but it does not act like
glDrawElements as it doesn't immediately copy the index data. This forces my
app to keep the data around and ensure it isn't deleted.
 
This is cumbersome in modular programming situations. Imagine I have a
NodeVisitor that converts DrawArrays to DrawElements and therefore allocates
memory to hold the index data. The processed scene graph could have a life
that extends far beyond the scope of the NodeVisitor, so it doesn't make
sense to keep the addresses stored in the NodeVisitor (where the memory was
allocated). So who should keep track of the index data memory addresses? Who
should own deleting that memory?
 
This isn't the first time I've encountered this situation, and I thought
perhaps you had encountered it as well and maybe had a good solution that I
was not aware of. If so, please let me know. Thanks in advance.
 
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] DrawElements* memory management

2009-03-19 Thread Jason Daly

Paul Martz wrote:
Ignore this post. The answer is: DrawElementsUInt is a VectorGLuint. 
Of course, I had to post and show my ignorance first before I figured 
that out. :-/


Good.  For a minute there, I thought I was missing something.  :-)

--J

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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Simon Loic
Maybe when I will have finished to implement the GROUNDED/HORIZONTAL mode
you can give it a try and decide which  name best fits. In my concern I
clearly incline towars grounded as the implementation I was about to propose
allows step over small obstacles like stairs.

If you have remarks on the implementation so far, go ahead...

to sukender :
I didn't exacly get your remarks while I'm sure they are founded. Anyway I
think that when I wil have finished to code both mode, things will become
clearer for me and for you.

Get you informed as soon as the manipulator is ready.


 Havig both modes sounds a good idea. In that case,
FirstPersonManipulator seems fine for me. Just be sure to:
 - allow the user to set which vector is considered to be up
 - allow the user to set the minimum angle between dir and up (or else
you got rounding errors that
 cause ugly artifacts). Based on experiments, I personnaly used 0.008
(radians; as you can see in the
 source code I told about), but it may depend on how your camera is set.

On Thu, Mar 19, 2009 at 9:42 PM, Jason Daly jd...@ist.ucf.edu wrote:

 Sukender wrote:

 And about the modes, I would prefer FREE and HORIZONTAL :)



 My preference would be GROUNDED (as in, you stay on the ground) rather
 than HORIZONTAL.  To me HORIZONTAL kind of implies one-dimensional
 motion.

 I'm indifferent on FREE vs. GENERAL.

 --J


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




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


Re: [osg-users] DoomLike manipulator

2009-03-19 Thread Sukender
Hi Simon,

I thought the manipulator could behave like a flying human (= Horizontal mode 
for movement, but nothing to keep on floor). Or is it a thrird mode?
1. FREE (= Descent, go any way, up vector changes).
2. FREE_UP_FIXED (= Flying human, up vector is fixed, but camera moves 
anywhere)
3. GROUNDED (up vector is fixed, and view stays on the floor, or whatever)

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


Le Thu, 19 Mar 2009 23:06:16 +0100, Simon Loic simon1l...@gmail.com a écrit:

 Maybe when I will have finished to implement the GROUNDED/HORIZONTAL mode
 you can give it a try and decide which  name best fits. In my concern I
 clearly incline towars grounded as the implementation I was about to propose
 allows step over small obstacles like stairs.

 If you have remarks on the implementation so far, go ahead...

 to sukender :
 I didn't exacly get your remarks while I'm sure they are founded. Anyway I
 think that when I wil have finished to code both mode, things will become
 clearer for me and for you.

 Get you informed as soon as the manipulator is ready.


 Havig both modes sounds a good idea. In that case,
 FirstPersonManipulator seems fine for me. Just be sure to:
 - allow the user to set which vector is considered to be up
 - allow the user to set the minimum angle between dir and up (or else
 you got rounding errors that
 cause ugly artifacts). Based on experiments, I personnaly used 0.008
 (radians; as you can see in the
 source code I told about), but it may depend on how your camera is set.

 On Thu, Mar 19, 2009 at 9:42 PM, Jason Daly jd...@ist.ucf.edu wrote:

 Sukender wrote:

 And about the modes, I would prefer FREE and HORIZONTAL :)



 My preference would be GROUNDED (as in, you stay on the ground) rather
 than HORIZONTAL.  To me HORIZONTAL kind of implies one-dimensional
 motion.

 I'm indifferent on FREE vs. GENERAL.

 --J


 ___
 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] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-03-19 Thread E. Wing
I don't know what the specific build issue is as I believe the local
FindFreeType.cmake module should be searched for first, but I thought I
would share some history.

Originally there was no FindFreeType.cmake module in CMake. I wrote the
original one for OpenSceneGraph and then submitted it to CMake. Quickly
after, the KDE people got mad at me because they had their own
FindFreetype.cmake module they were planning to submit which was not
completely compatible with ours. Mine was better because it didn't rely on
running freetype-config (bad for cross-compiling), and got the
capitalization of FreeType correct. But because KDE is bigger than
OpenSceneGraph, we lost.

There was a promise that they would take the better elements of mine (e.g.
no dependency on freetype-config) and duplicate variables to allow our stuff
to still work, but it could be that those variables have since been removed.
(I was told our variables would be considered deprecated.)


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


Re: [osg-users] Multithreadingcrash due toosgDb::Registry::instance()

2009-03-19 Thread I-Nixon, Anthony D
Thanks for the pointer Paul.  The points you raise do apply to C++ as
well, and it seems the consensus is that it is not possible to implement
the double-checked locking pattern in portable C++ safely.

See Scott Meyer's and Andrei Alexandrescu's paper here
http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf  

If Scott Meyer's says it can't be done, I tend to believe him :-)

From Scott's paper:

In many cases, initializing a singleton resource during single-threaded
program startup
(e.g., prior to executing main) is the simplest way to offer fast,
thread-safe
singleton access.

So the best thing to do is to advertise in large bold letters somewhere
in the doco (and FAQ) that if you are going to use multithreading, all
instances need to be accessed before threading starts.

Anthony

 -Original Message-
 From: Paul Speed [mailto:psp...@progeeks.com] 
 Sent: Friday, 20 March 2009 2:21 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Multithreadingcrash due 
 toosgDb::Registry::instance()
 
 Just a note for those of us who have been bitten by double 
 check locking issues in Java, this technique is highly 
 dependent on the threading and data architecture in use.  
 There are subtle issues between when a thread commits its 
 local state and the possibility for the compiler to reorder 
 statements.  This was less of an issue on single-core boxes 
 but comes up in multi-core where the local thread state may 
 not be committed.  I can't be sure but there may have also 
 been some subtle statement reordering issues with respect to 
 the compiler not knowing that your guard release _must_ be 
 run after the instance_ = new Singleton has _fully_ executed.
 
 I don't know if these problems crop up in C++ but it 
 certainly seems like they could depending on the threading 
 implementation and compiler optimization strategy.
 
 Worst case for a singleton pattern is that you might get a 
 race condition where two instances are created.  There are 
 other double-checked locking situations that are much more insidious.
 
 -Paul
 
 Paul Melis wrote:
  Robert Osfield wrote:
  2009/3/17 Schmidt, Richard richard.schm...@eads.com 
  mailto:richard.schm...@eads.com
 
  http://www.cs.wustl.edu/~schmidt/PDF/DC-Locking.pdf
  http://www.cs.wustl.edu/%7Eschmidt/PDF/DC-Locking.pdf
 
 
  Could you explain what the above document is all about...
  I just read it an it describes a pattern where you use a mutex to 
  guard access to the singleton's _instance value, but in such a way 
  that the mutex is only needed when _instance == NULL, i.e.
  
  class Singleton
  {
  public:
 static Singleton *instance (void)
 {
  // First check
  if (instance_ == 0)
 {
// Ensure serialization (guard constructor 
 acquires lock_).
   GuardMutex guard (lock_);
   // Double check.
   if (instance_ == 0)
instance_ = new Singleton;
 }
  return instance_;
  // guard destructor releases lock_.
 }
  private:
 static Mutex lock_;
 static Singleton *instance_;
  };
  
  This should give you thread-safe access to Singleton-instance() at 
  all times combined with correct initialization.
  
  Quite neat actually,
  Paul
  ___
  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-opensce
negraph.org
 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-03-19 Thread john casu
fyi.. the command I used to grab the svn release was:

svn checkout http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk 
OpenSceneGraph

I'm pretty certain it's the latest, as installing it creates a 
/usr/local/lib/osgPlugins-2.9.1 directory.

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





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


[osg-users] OpenCL: democracy for GPU computing?

2009-03-19 Thread hanne...@gmx.at

http://www.behardware.com/articles/744-1/opencl-democracy-for-gpu-computing.html

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


Re: [osg-users] [build] Unreckognized Commands

2009-03-19 Thread Adam Wise
So, I went back to cmake and I realized that I didn't have a dynamic or static 
library assigned. So I assigned the file libcollada15dom21.lib to the 
COLLADA_DYNAMIC_LIBRARY variable. Everything compiled fine. But when I went to 
use osgconv, it tells me that it couldn't find the file libcollada15dom21.dll. 
So obviously, I assigned the wrong file in cmake. 

Earlier on, I assigned a different file for the dynamic library: 
libcollada15dom21-d.dll But VS C++ 08 didn't even let it compile. So I think I 
only have one option left:

libcollada15dom21.dll. Finding that file, and assigning it to the 
COLLADA_DYNAMIC_LIBRARY.

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





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


Re: [osg-users] [build] Unreckognized Commands

2009-03-19 Thread Martin Beckett
You need to link the .lib in the cmake file but then the corresponding .dll 
needs to be on the path.
You normally set environment variables in windows in control 
panel-system-advanced-environment

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





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