Re: [osg-users] very simple ortho problem

2008-10-01 Thread thomas weidner
On Wed, 1 Oct 2008 18:21:29 -0600
"Paul Martz" <[EMAIL PROTECTED]> wrote:

Thanks for the quick answer. :-)

> Have you looked at the examples? I'm sure there's an ortho example
> somewhere. Try searching the code. It _does_ work (I used it in an RTT
> example recently), so this is almost certainly a bug in your code.

I never thought it is something else,than a bug in my code ;) I looked
at the osgpick example and got the triangle displayed. Though it seems
I have to use an extra osg::Camera node.

Sorry,but I have some new strange thing: It seems like all nodes with
entirely positive z coordinates are not displayed, though my viewing
volume still should be [-1.1] in z. I tried to play with setCullingMode
of both cameras, but it did not change a thing. I also tried
disabling the geode's depth test without success. This seems to be an
OSG thing, because when I have 2 triangles one with positive and one
with negative z coordinates,both get displayed.

here is the code:
#include 
#include 
#include 
#include 
#include 

int main(int argc,char** argv)
{
  osgViewer::Viewer the_viewer;
  osg::ref_ptr camera = new osg::Camera();
  camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
  camera->setViewMatrix(osg::Matrix::identity());
  camera->setProjectionMatrixAsOrtho(-1,1,-1,1,-1,1);
  camera->setClearMask(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);

  osg::ref_ptr the_geode = new osg::Geode();
  osg::ref_ptr the_geometry = new osg::Geometry();
  osg::ref_ptr the_array = new osg::Vec3Array();
  // change this to (0,0,.1) to make the triangle disappear
  the_array->push_back(osg::Vec3(0,0,0));
  the_array->push_back(osg::Vec3(1,0,.1));
  the_array->push_back(osg::Vec3(0,1,.1));
  the_geometry->setVertexArray(the_array.get());
  the_geometry->addPrimitiveSet(new
osg::DrawArrays(osg::PrimitiveSet::TRIANGLES,0,3));
the_geode->addDrawable(the_geometry.get());

  camera->addChild(the_geode.get());
  the_viewer.setSceneData(camera.get());

  while(!the_viewer.done())
the_viewer.frame();
}


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


Re: [osg-users] very simple ortho problem

2008-10-01 Thread Paul Martz
Have you looked at the examples? I'm sure there's an ortho example
somewhere. Try searching the code. It _does_ work (I used it in an RTT
example recently), so this is almost certainly a bug in your code.

Viewer::run() adds a camera manipulator under the hood, which is changing
your view matrix, so you aren't getting the view matrix you specify.
Instead, use Viewer::done() and Viewer::frame().

Take out the code that adds an identity MatrixTransform with ABSOLUTE
reference frame; it is not needed and is just making things more confusing
for those of us trying to debug your code for you.

With your view and projection matrices, you'll want to draw into the xy
plane.
   -Paul


> 
> Hi,
> 
> i'm quite new to OSG and try to write some simple tasks. In 
> the code below i tried ortho projection, but not matter if I 
> put the triangle in the XY or XZ plane,if i attach the_geode 
> or trans as scene data,nothing gets displayed. the 
> corresponding code in pure GL works without any problem. what 
> did i do wrong?
> 
> thanks in advance.
> 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> int main(int argc,char** argv)
> {
>   osgViewer::Viewer the_viewer;
>   the_viewer.getCamera()->setViewMatrix(osg::Matrix::identity());
>   the_viewer.getCamera()->setProjectionMatrixAsOrtho2D(-1,1,-1,1);
> 
>   osg::ref_ptr the_geode = new osg::Geode();
>   osg::ref_ptr the_geometry = new osg::Geometry();
>   osg::ref_ptr the_array = new osg::Vec3Array();
>   the_array->push_back(osg::Vec3(0,0,0));
>   // swapping the next two lines for different triangle 
> orientation doesn't work also
>   the_array->push_back(osg::Vec3(1,0,0));
>   the_array->push_back(osg::Vec3(0,0,1)); // (0,1,0) also 
> does not work here
>   the_geometry->setVertexArray(the_array.get());
>   the_geometry->addPrimitiveSet(new 
> osg::DrawArrays(osg::PrimitiveSet::TRIANGLES,0,3));
>   the_geode->addDrawable(the_geometry.get());
> 
>   osg::ref_ptr trans = new 
> osg::MatrixTransform();
>   trans->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
>   trans->addChild(the_geode.get());
>   trans->setMatrix(osg::Matrix::identity());
>   the_viewer.setSceneData(trans.get()); // the_geode.get() 
> doesn't work too
> 
>   the_viewer.run();
> }
> 
> 
> ___
> 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


[osg-users] osgPPU & osgShadow

2008-10-01 Thread Michael Guerrero
Hi guys, I've recently delved into osgPPU and am loving it.  I have a scene
beautifully rendering with HDR.  However, when I tried adding osgShadow
ShadowMap to the scene I had conflicts.  I don't yet know exactly what is going
just yet but I was wondering if anyone has had success combining these two and
if so, I would appreciate the help.

Thanks,
Michael

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


[osg-users] very simple ortho problem

2008-10-01 Thread thomas weidner
Hi,

i'm quite new to OSG and try to write some simple tasks. In the code
below i tried ortho projection, but not matter if I put the triangle in
the XY or XZ plane,if i attach the_geode or trans as scene data,nothing
gets displayed. the corresponding code in pure GL works without any
problem. what did i do wrong?

thanks in advance.

#include 
#include 
#include 
#include 
#include 

int main(int argc,char** argv)
{
  osgViewer::Viewer the_viewer;
  the_viewer.getCamera()->setViewMatrix(osg::Matrix::identity());
  the_viewer.getCamera()->setProjectionMatrixAsOrtho2D(-1,1,-1,1);

  osg::ref_ptr the_geode = new osg::Geode();
  osg::ref_ptr the_geometry = new osg::Geometry();
  osg::ref_ptr the_array = new osg::Vec3Array();
  the_array->push_back(osg::Vec3(0,0,0));
  // swapping the next two lines for different triangle orientation doesn't 
work also
  the_array->push_back(osg::Vec3(1,0,0));
  the_array->push_back(osg::Vec3(0,0,1)); // (0,1,0) also does not work here
  the_geometry->setVertexArray(the_array.get());
  the_geometry->addPrimitiveSet(new 
osg::DrawArrays(osg::PrimitiveSet::TRIANGLES,0,3));
  the_geode->addDrawable(the_geometry.get());

  osg::ref_ptr trans = new osg::MatrixTransform();
  trans->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
  trans->addChild(the_geode.get());
  trans->setMatrix(osg::Matrix::identity());
  the_viewer.setSceneData(trans.get()); // the_geode.get() doesn't work too

  the_viewer.run();
}


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


Re: [osg-users] Geometry merging problem

2008-10-01 Thread Paul Martz
A single Geometry can only have one StateSet and can't change OpenGL state
within a Geometry, so I'm not sure how you expected this to work. Other than
building a texture atlas, your best bet would be to leave them as two
separate Geometries.
   -Paul
 


> 
> Hi all,
> I am trying to merge two geometry objects that have two 
> different textures by using the merging function:
> bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry&
> lhs,osg::Geometry& rhs)
> After calling this function, one of these objects looses its 
> own texture. In fact it inherits the texture of the other 
> object. did anyone already try this function or know how to 
> merge two geometry objects correctly ?
> 
> thanks.
> 
> The following snippet code shows how I did the merging:
> osg::ref_ptr  mergeGeoms(osg::Geometry 
> *g1,osg::Geometry *g2) {
>   osgUtil::Optimizer::MergeGeometryVisitor::mergeGeometry(*g1,*g2);
>   return g1;
> }
> 
> ___
> 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] How do I Subclass a file loader?

2008-10-01 Thread Thrall, Bryan
brettwiesner wrote on Wednesday, October 01, 2008 3:27 PM:

> Hey Robert,
> 
> I'm confused about what you mean here. Many plugins have read/ write
> methods that take istreams/ ostreams (ReaderWriterIVE being one of
> them). However, since I can't subclass them I can't attach to the
> stream. For example, in ReaderWriterIVE::writeNode() a std::ofstream
is
> created but there's no way for me to attach it to a stream buffer.
> 
> It seems like the osga plugin would have the same problem. The
doread()/
> dowrite() methods call up to whatever ReaderWriter was passed in and I
> can't subclass those.

I think Robert was suggesting implementing your own istream/ostream that
does the encryption internally, then passing that to the read/write
methods that take streams.

> Robert Osfield wrote:
>> Hi Brett,
>> 
>> A number of the plugins support reading a writing from
istream/ostream
>> which means you can implement your std::streambuffer and attach to
the
>> stream and then pass this to the plugin.  This technique allows you
to
>> do items like compression/decompression/encription/decription.  Have
a
>> look at the osga and curl plugins as they provide examples of using
>> streams this way.
>> 
>> Robert.
>> 
>> On Wed, Oct 1, 2008 at 5:02 PM, brettwiesner <[EMAIL PROTECTED]>
wrote:
>> 
>>> Hi,
>>> 
>>> I've got a requirement to ship certain 3rd party model data only in
an
>>> encrypted format. So I wrote my own loader that does the encryption/
>>> decryption but uses the IVE loader for everything. This works except
for
>>> files that reference other files. The master file is encrypted, but
the
>>> referenced files are saved out as .ive's.
>>> 
>>> Ideally all I would have to do is subclass ReaderWriterIVE and
override the
>>> following stream methods: 
>>> 
>>>  virtual osgDB::ReaderWriter::ReadResult readObject(std::istream&
fin,
>>> const osgDB::ReaderWriter::Options* options) const;
>>> 
>>>  virtual osgDB::ReaderWriter::ReadResult readImage(std::istream&
fin,
>>> const osgDB::ReaderWriter::Options* options) const;
>>> 
>>>  virtual osgDB::ReaderWriter::ReadResult readNode(std::istream& fin,
>>> const osgDB::ReaderWriter::Options* options) const;
>>> 
>>>  virtual osgDB::ReaderWriter::WriteResult writeObject(const
osg::Object&
>>> object, std::ostream& fout, const osgDB::ReaderWriter::Options*
>>> options) const; 
>>> 
>>>  virtual osgDB::ReaderWriter::WriteResult writeImage(const
osg::Image&
>>> image, std::ostream& fout, const osgDB::ReaderWriter::Options*
options)
>>> const; 
>>> 
>>>  virtual osgDB::ReaderWriter::WriteResult writeNode(const osg::Node&
node,
>>> std::ostream& fout, const osgDB::ReaderWriter::Options* options)
const;
>>> 
>>> For writing I could get the raw data from the ive loader encrypt it
and
>>> write it out. For reading I could decrypt the data, then pass the
>>> unencrypted data up to the ive loader for use.
>>> 
>>> There is one fatal flaw... I can't subclass the ReaderWriterIVE
plugin. :(
>>> 
>>> 1) Has anyone besides me ever wanted to derive from a file loader?
Would it
>>> make sense to keep the logic in a lib with headers, then have
another
>>> library that is just the plugin?
>>> 
>>> 2) Is there some other mechanism in OSG that will let me do this?
-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How do I Subclass a file loader?

2008-10-01 Thread brettwiesner

Hey Robert,

I'm confused about what you mean here. Many plugins have read/ write 
methods that take istreams/ ostreams (ReaderWriterIVE being one of 
them). However, since I can't subclass them I can't attach to the 
stream. For example, in ReaderWriterIVE::writeNode() a std::ofstream is 
created but there's no way for me to attach it to a stream buffer.


It seems like the osga plugin would have the same problem. The doread()/ 
dowrite() methods call up to whatever ReaderWriter was passed in and I 
can't subclass those.


Thanks,
Brett

Robert Osfield wrote:

Hi Brett,

A number of the plugins support reading a writing from istream/ostream
which means you can implement your std::streambuffer and attach to the
stream and then pass this to the plugin.  This technique allows you to
do items like compression/decompression/encription/decription.  Have a
look at the osga and curl plugins as they provide examples of using
streams this way.

Robert.

On Wed, Oct 1, 2008 at 5:02 PM, brettwiesner <[EMAIL PROTECTED]> wrote:
  

Hi,

I've got a requirement to ship certain 3rd party model data only in an
encrypted format. So I wrote my own loader that does the encryption/
decryption but uses the IVE loader for everything. This works except for
files that reference other files. The master file is encrypted, but the
referenced files are saved out as .ive's.

Ideally all I would have to do is subclass ReaderWriterIVE and override the
following stream methods:

 virtual osgDB::ReaderWriter::ReadResult readObject(std::istream& fin,
const osgDB::ReaderWriter::Options* options) const;

 virtual osgDB::ReaderWriter::ReadResult readImage(std::istream& fin,
const osgDB::ReaderWriter::Options* options) const;

 virtual osgDB::ReaderWriter::ReadResult readNode(std::istream& fin,
const osgDB::ReaderWriter::Options* options) const;

 virtual osgDB::ReaderWriter::WriteResult writeObject(const osg::Object&
object,
std::ostream& fout, const osgDB::ReaderWriter::Options* options) const;

 virtual osgDB::ReaderWriter::WriteResult writeImage(const osg::Image&
image,
std::ostream& fout, const osgDB::ReaderWriter::Options* options) const;

 virtual osgDB::ReaderWriter::WriteResult writeNode(const osg::Node& node,
std::ostream& fout, const osgDB::ReaderWriter::Options* options) const;

For writing I could get the raw data from the ive loader encrypt it and
write it out. For reading I could decrypt the data, then pass the
unencrypted data up to the ive loader for use.

There is one fatal flaw... I can't subclass the ReaderWriterIVE plugin. :(

1) Has anyone besides me ever wanted to derive from a file loader? Would it
make sense to keep the logic in a lib with headers, then have another
library that is just the plugin?

2) Is there some other mechanism in OSG that will let me do this?

Thanks,
Brett
___
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] Geometry merging problem

2008-10-01 Thread Bilal Zeidan

Hi all,
I am trying to merge two geometry objects that have two different 
textures by using the merging function:
bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry& 
lhs,osg::Geometry& rhs)
After calling this function, one of these objects looses its own 
texture. In fact it inherits the texture of the other object. did anyone 
already try this function or know how to merge two geometry objects 
correctly ?


thanks.

The following snippet code shows how I did the merging:
osg::ref_ptr  mergeGeoms(osg::Geometry *g1,osg::Geometry *g2)
{
 osgUtil::Optimizer::MergeGeometryVisitor::mergeGeometry(*g1,*g2);
 return g1;
}

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


Re: [osg-users] connected shapes demo...

2008-10-01 Thread Tomlinson, Gordon
 
"It's such a fundamental aspect of a Scenegraph.  From all the example's
I've seen in osg, everything is put on the root level.  There's no
concept of a local coordinate system based on some (root) object."

That's an incorrect assumption, just because a couple of samples just
put the data at the root level, does not mean that's all you can do. YOU
the programmer in most cases are responsible for how you build your
scene graph, you can do flat , you can quad tree you can do an oct-tree
or what ever this is down to how you the user creates the scene for your
app ( if you search the mail archives this  has been discussed )
http://www.vis-sim.com/imgdp/dbpart1.jpg  and a couple of old Vega
slides to translate to OSG http://www.vis-sim.com/imgdp/vp_graph_ex1.jpg
http://www.vis-sim.com/imgdp/vp_graph_tank_01.jpg( the only things you
loose control at is how a file loader will create the tree for the model
your using.

The goal is to have a balanced tree for your usage which may not be the
same for another users usages

As to translate, rotation, scale of course these are supported, these
are handled differently by different scene graphs, in the OSG you have
the good of Dof node (Degree of Freedom) DOFTransform, the
MatrixTransform, the PositionAttitudeTransform that give you local
coordinate systems and the eventually spit out glModelview matrix in the
draw process

The beauty of the OSG is that it allows you the user a great amount of
flexibility but at some point you have to provide the intelligence it
needs
And don't forget OSG is a dag http://www.vis-sim.com/imgdp/dagb.jpg so a
node can hve more than on parent


Gordon

__
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com


__
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

"Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival" 
- Master Tambo Tetsura

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James
Moliere
Sent: Wednesday, October 01, 2008 12:26 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] connected shapes demo...

On Wed, 2008-10-01 at 10:57 -0400, Tomlinson, Gordon wrote:
> Why should there be an example of this ? 
> 

It's such a fundamental aspect of a scenegraph.  From all the example's
I've seen in osg, everything is put on the root level.  There's no
concept of a local coordinate system based on some (root) object.

Using opengl, I simply push the global coordinate system on the stack,
rotate and translate each item and then ultimately pop the stack to get
back to my global coordinate system.  I was simply interested in how osg
and OpenGL compared.

> You're the 1st person to this ask for particular exact usage, that I 
> have seen on this list.
> 
> As to examples of using just transforms there are many and they are 
> also covered in most of the tutorials online and into the Guide to OSG

> written by Paul Martz
> 
I shall hunt these down.

> You might want to Google around on scene graphs and 
> transformations/matrices and how they can be used, to provide local 
> coordinate systems, how you can chain for certain actions( there are 
> some things you cannot do by simply using child transforms you have to

> do the math in many cases) , there's a lot on the net, also look at 
> how vis-modeling packages like MultigenCreator, Carbon Grpahics Geo, 
> Remo3D etc provide tools to create the models and transformation 
> chains
> 
Thanks for these pointers.  I'm trying to see if osg can be used in my
project.

> 
> Gordon
> 
> __
> Gordon Tomlinson
> Product Manager 3D
> Email  : gtomlinson @ overwatch.textron.com 
> __
> 
> "Self defence is not a function of learning tricks but is a function 
> of how quickly and intensely one can arouse one's instinct for 
> survival"
> - Master Tambo Tetsura
> 
>  
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of James

> Moliere
> Sent: Wednesday, October 01, 2008 10:10 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] connected shapes demo...
> 
> J.P.
> Thanks for the advice.  I believe I see how to connect objects 
> together and will hand over a sample if I can get one going.  I'm 
> sorta in disbelief that an example like this doesn't seem to exist.
> 
> James
> 
> J.P. Delport wrote:
> > hello,
> >
> > you can connect transforms together in a parent child fashion, this 
> > is
> 
> > what a scene "graph" is for.
> >
> > Try make yourself an example with the following structure:
> >
> > root
> > |
> > transform1 -- shape1
> > |
> > transform2 -- shape2
> > |
> > transform3 -- shape3
> >
> > transform1 is child of root
> > shape1 and transform2 are children of

Re: [osg-users] openGL extensions

2008-10-01 Thread Jean-Sébastien Guay

Hi Ben,


GL_ARB_fragment_shader


In order to use the shadow fragment shader, you need this one too. If 
it's not supported by your card, osgShadow::ShadowMap (and most shadow 
techniques) can do a fixed function fallback. To see if this works for 
you, you can call shadowMap->clearShaderList() before the first frame 
(i.e. when you construct the shadowMap object).


If GL_EXT_framebuffer_object is supported, the fixed function fallback 
should be fast enough. The only time I've seen shadow maps be REALLY 
slow (i.e. 1.5 fps vs 60+ when disabled) both in fixed function and with 
the shader is when GL_EXT_framebuffer_object was not supported.


Sorry I didn't include this one in my list, I assumed that if a card 
supported GL_ARB_fragment_program, then it also supported 
GL_ARB_fragment_shader, but this seems not to be the case for you. Bare 
in mind that this is all though my experiences of what works in my 
projects, so there are shortcomings sometimes. :-)


Hope this helps,

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


Re: [osg-users] openGL extensions

2008-10-01 Thread Ben Axelrod
Hi Jean,

Thanks for the list of extensions that you test for in the ShadowMap.  However, 
I have a graphics card that meets those requirements yet still does not render 
ShadowMap shadows.  Can you tell me if any of these extensions look like the 
'smoking gun' as to why this card does not display shadows?

Here is a list of extensions that ARE NOT supported on this graphics card. This 
list was extracted from a diff between a working graphics card that does 
display shadows and the current 'broken' one.  I am sure there are more 
extensions that are not listed here that I am unaware of.
GL_ARB_draw_buffers
GL_ARB_fragment_shader
GL_ARB_multisample
GL_ARB_shader_objects
GL_ARB_shading_language_100
GL_ARB_transpose_matrix
GL_ARB_vertex_buffer_object
GL_ARB_vertex_shader
GL_ATI_draw_buffers
GL_EXT_blend_equation_separate
GL_EXT_compiled_vertex_array
GL_EXT_Cg_shader
GL_EXT_depth_bounds_test
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
GL_EXT_gpu_program_parameters
GL_EXT_point_parameters
GL_EXT_stencil_two_side
GL_NV_fence
GL_NV_fragment_program
GL_NV_framebuffer_multisample_coverage
GL_NV_half_float
GL_NV_occlusion_query
GL_NV_pixel_data_range
GL_NV_point_sprite
GL_NV_primitive_restart
GL_NV_register_combiners
GL_NV_register_combiners2
GL_NV_vertex_array_range
GL_NV_vertex_array_range2
GL_NV_vertex_program
GL_NV_vertex_program1_1
GL_NV_vertex_program2
GL_NVX_conditional_render


This is the list of extensions are ARE supported by this 'broken' card that 
does not display shadows:
GL_ARB_color_buffer_float
GL_ARB_depth_texture
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_half_float_pixel
GL_ARB_imaging
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_pixel_buffer_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_shadow
GL_ARB_texture_border_clamp
GL_ARB_texture_compression
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle
GL_ARB_vertex_program
GL_ARB_window_pos
GL_ATI_texture_float
GL_ATI_texture_mirror_once
GL_S3_s3tc
GL_EXT_texture_env_add
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_object
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_pixels
GL_EXT_pixel_buffer_object
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_wrap
GL_EXT_texture3D
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_lod
GL_EXT_texture_lod_bias
GL_EXT_texture_mirror_clamp
GL_EXT_texture_object
GL_EXT_texture_sRGB
GL_EXT_timer_query
GL_EXT_vertex_array
GL_IBM_rasterpos_clip
GL_IBM_texture_mirrored_repeat
GL_KTX_buffer_region
GL_NV_blend_square
GL_NV_copy_depth_to_color
GL_NV_depth_clamp
GL_NV_float_buffer
GL_NV_fog_distance
GL_NV_fragment_program_option
GL_NV_fragment_program2
GL_NV_light_max_exponent
GL_NV_multisample_filter_hint
GL_NV_packed_depth_stencil
GL_NV_texgen_reflection
GL_NV_texture_compression_vtc
GL_NV_texture_env_combine4
GL_NV_texture_expand_normal
GL_NV_texture_rectangle
GL_NV_texture_shader
GL_NV_texture_shader2
GL_NV_texture_shader3
GL_NV_vertex_program2_option
GL_NV_vertex_program3
GL_SGIS_generate_mipmap
GL_SGIS_texture_lod
GL_SGIX_depth_texture
GL_SGIX_shadow
GL_SUN_slice_accum


Thanks,
-Ben

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien 
Guay
Sent: Monday, September 22, 2008 8:12 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] openGL extensions

Hi Ben,

> I would like to detect if the user has the appropriate openGL extensions
> in order to do shadowing.  However, when I do:
>
> glGetString(GL_VERSION)
> glGetString(GL_EXTENSIONS)
>
> They return null.  How can I get a list of the available extensions?  Is
> there an easy way to get this info from OSG?

For the first part of your question, they return NULL if they were
called from a thread that does not have a graphics context. The safest
way to do this is to create a camera predraw/postdraw/finaldraw callback
or a node cull callback or a drawable draw callback. In each of these
points you will have a graphics context.

What I generally do is assume support is present and start the viewer
with a detection callback attached (camera predraw callback on the main
camera) which will check extensions and then remove itself from the
camera. Then after the first frame, if I see that some feature is not
supported, I disable the relevant options.

There are other valid strategies of course.

As for detecting actual extensions, instead of calling
glGetString(GL_EXTENSIONS) and parsing it yourself, you can use

#include 
#include 

osg::isGLExtensionSupported(contextID, extensionNam

Re: [osg-users] How do I Subclass a file loader?

2008-10-01 Thread Robert Osfield
Hi Brett,

A number of the plugins support reading a writing from istream/ostream
which means you can implement your std::streambuffer and attach to the
stream and then pass this to the plugin.  This technique allows you to
do items like compression/decompression/encription/decription.  Have a
look at the osga and curl plugins as they provide examples of using
streams this way.

Robert.

On Wed, Oct 1, 2008 at 5:02 PM, brettwiesner <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've got a requirement to ship certain 3rd party model data only in an
> encrypted format. So I wrote my own loader that does the encryption/
> decryption but uses the IVE loader for everything. This works except for
> files that reference other files. The master file is encrypted, but the
> referenced files are saved out as .ive's.
>
> Ideally all I would have to do is subclass ReaderWriterIVE and override the
> following stream methods:
>
>  virtual osgDB::ReaderWriter::ReadResult readObject(std::istream& fin,
> const osgDB::ReaderWriter::Options* options) const;
>
>  virtual osgDB::ReaderWriter::ReadResult readImage(std::istream& fin,
> const osgDB::ReaderWriter::Options* options) const;
>
>  virtual osgDB::ReaderWriter::ReadResult readNode(std::istream& fin,
> const osgDB::ReaderWriter::Options* options) const;
>
>  virtual osgDB::ReaderWriter::WriteResult writeObject(const osg::Object&
> object,
> std::ostream& fout, const osgDB::ReaderWriter::Options* options) const;
>
>  virtual osgDB::ReaderWriter::WriteResult writeImage(const osg::Image&
> image,
> std::ostream& fout, const osgDB::ReaderWriter::Options* options) const;
>
>  virtual osgDB::ReaderWriter::WriteResult writeNode(const osg::Node& node,
> std::ostream& fout, const osgDB::ReaderWriter::Options* options) const;
>
> For writing I could get the raw data from the ive loader encrypt it and
> write it out. For reading I could decrypt the data, then pass the
> unencrypted data up to the ive loader for use.
>
> There is one fatal flaw... I can't subclass the ReaderWriterIVE plugin. :(
>
> 1) Has anyone besides me ever wanted to derive from a file loader? Would it
> make sense to keep the logic in a lib with headers, then have another
> library that is just the plugin?
>
> 2) Is there some other mechanism in OSG that will let me do this?
>
> Thanks,
> Brett
> ___
> 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] About the DICOM loader

2008-10-01 Thread Robert Osfield
Hi Ivan,

Thanks for the update.

On the OSG side I've written a DCMTK based OSG dicom loader, it's
still not finished as I keep encountering dicom files that break the
assumptions made in the plugin about the nature of dicom files - it is
a bit of long haul trying to get my head around all the different
forms and how to fit them into a standard osg::Image.

A port to using GDCM 2.x probably won't be too difficult.

Robert.

On Wed, Oct 1, 2008 at 5:02 PM, Iván Macía <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> To update the info on the topic, it seems that ITK is starting to support
> GDCM 2.x. It is in the ITK CVS at a very preliminary stage yet (they say not
> to use it yet but for experimentation) but has not been merged yet as it
> does not compile with VS6. They are even thinking on dropping support for
> VS6 and VS7.0 compilers.
>
> ITK must be configured with ITK_USE_SYSTEM_GDCM -> ON and GDCM_DIR to
> whatever path of the GDCM 2.x.
>
> Best regards
>
> Ivan
>
> -Mensaje original-
> De: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] En nombre de Robert
> Osfield
> Enviado el: jueves, 28 de agosto de 2008 17:46
> Para: OpenSceneGraph Users
> Asunto: Re: [osg-users] About the DICOM loader
>
> Thanks for extra links and info Ivan.  I've download 2.0.8 and compile
> and check it out.
>
> On Thu, Aug 28, 2008 at 4:27 PM, Ivan Macia <[EMAIL PROTECTED]> wrote:
>> Hi Robert,
>>
>> There are two major versions of GDCM, 1.x (current version 1.3.1 or so)
> and
>> 2.x (currently 2.0.8). They are not compatible. GDCM 2.x seems to be much
>> faster parsing and also covers some parts of the protocol outside the
> scope
>> of the image representation. Both seem to be currently developed in
>> parallel. I ignore if there are future plans to abandon the 1.x branch.
>>
>> This is GDCM 1.x
>> http://www.creatis.insa-lyon.fr/Public/Gdcm/html.user/index.html
>>
>> More info on GDCM 2.0 here
>> http://gdcm.sourceforge.net/wiki/index.php/GDCM_Release_2.0
>> http://gdcm.sourceforge.net/2.0/html/classes.html
>>
>> The notes on GDCM homepage say that ITK currently uses GDCM 1.2.x. Also
> they
>> suggest to use GDCM 2.x for new developments
>> http://www.creatis.insa-lyon.fr/Public/Gdcm/
>>
>> I ignore the plans of ITK development team about this but probably the
> best
>> person to contact is Mathieu Malaterre as he developed the ITK GDCM
> classes.
>>
>> On the other hand, nothing prevents to make the DICOM plugin for OSG using
>> GDCM 2.x even if ITK is using GDCM 1.x. If OSG was to connect with an ITK
>> pipeline, then users will use ITK GDCM readers at the beginning of the ITK
>> pipeline. Otherwise, they could use an hypothetical OSG GDCM 2-based DICOM
>> plugin to read for example a volume and render it. Just an idea, but I
> think
>> more info about this is necessary.
>>
>> Best regards
>>
>> Ivan
>>
>>
>>
>> 2008/8/28 Robert Osfield <[EMAIL PROTECTED]>
>>>
>>> Hi Ivan,
>>>
>>> Many thanks for info about GDCM.  Just downloaded and built it - no
>>> problems.  Nice to see CMake in action in both ITK and GDCM.
>>>
>>> Do you have any ideas when GDCM 2.0 might be out?  Another question
>>> for the ITK community would be their own plans for moving for to later
>>> versions of GDCM.  It'd be good to keep in sync otherwise one might
>>> end up with multiple versions of GDCM needing to be installed.
>>>
>>> On the ITK integration front, I expect this should be relatively
>>> straight forward to implement - the key is just extract the imagery as
>>> an osg::Image, then all the standard OSG texturing would be able to
>>> used.  My initial dicom loader based ITK has code for doing this
>>> already, it's not general purpose enough yet, but at least a step in
>>> this direction.
>>>
>>> Robert.
>>>
>>> On Thu, Aug 28, 2008 at 11:36 AM, Iván Macía <[EMAIL PROTECTED]>
> wrote:
>>> > Dear Hesicong, Robert,
>>> >
>>> > I have some experience using ITK. ITK relies now on GDCM library to
> read
>>> > DICOM files.
>>> >
>>> > http://www.creatis.insa-lyon.fr/Public/Gdcm/
>>> >
>>> > GDCM focuses on the part of the DICOM protocol related to the image
>>> > format
>>> > and representation whereas DCMTK covers most of the standard which
>>> > includes
>>> > transmission, services such as query/retrieve, storage etc. In my
>>> > opinion
>>> > GDCM would be simpler and easier to use in this kind of application.
>>> >
>>> > The itk::ImageFileReader relies on pluggable factories. When the DICOM
>>> > format is detected by the reader the itk::GDCMImageIO object is used
>>> > which
>>> > actually uses GDCM code.
>>> >
>>> > DICOM series (consisting of several DICOM files) are read somehow a bit
>>> > differently by generating a series of file names
>>> > (itk::GDCMSeriesFileNames)
>>> > that are then passed to itk::ImageSeriesReader but in the end they also
>>> > use
>>> > GDCMImageIO.
>>> >
>>> > Note that ITK does not use GDCM 2.x which is a major rework from GDCM
>>> > 1.x
>>> > which is the one used by ITK.
>>> >
>>> > You may want to h

Re: [osg-users] How do I Subclass a file loader?

2008-10-01 Thread Thrall, Bryan
brettwiesner wrote on Wednesday, October 01, 2008 11:54 AM:

> Bryan,
> 
> Thanks for the reply. See inline...
>> You could implement your own loader with a different file extension
>> (say, ".enc") that does the en/decryption and then calls the IVE
loader
>> to load the resulting data. The curl loader does something like this.
>> 
> 
> This is what I did originally. There was a problem with referenced
> files; those wouldn't get encrypted/ decrypted. The IVE loader would
> just process them as .ive's.
> 
>> Or you could use a osgDB::Registry::Read/WriteFileCallback to
de/encrypt
>> the data before it gets read/sent from/to disk.
>> 
>> 
> 
> That is interesting. I didn't know about those before. I think they
will
> have the same problem though. If I write a callback that does
something
> special when it's suppose to write out an encrypted file, and it uses
> the IVE loader to get the data to encrypt, that process will still
cause
> the IVE loader to write out referenced files as .ive's.
> 
> This would be pretty easy if I could derive from ReaderWriterIVE.

It sounds like the problem is the referenced filenames; perhaps a
visitor to change them to have the ".enc" extension so they get written
through your loader rather than the IVE one directly?

For example, a ProxyNode or PagedLOD that refers to "foo.osg" would have
to be changed to refer to "foo.osg.enc" before you do the actual write.

-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How do I Subclass a file loader?

2008-10-01 Thread brettwiesner

Bryan,

Thanks for the reply. See inline...

You could implement your own loader with a different file extension
(say, ".enc") that does the en/decryption and then calls the IVE loader
to load the resulting data. The curl loader does something like this.
  


This is what I did originally. There was a problem with referenced 
files; those wouldn't get encrypted/ decrypted. The IVE loader would 
just process them as .ive's.



Or you could use a osgDB::Registry::Read/WriteFileCallback to de/encrypt
the data before it gets read/sent from/to disk.

  


That is interesting. I didn't know about those before. I think they will 
have the same problem though. If I write a callback that does something 
special when it's suppose to write out an encrypted file, and it uses 
the IVE loader to get the data to encrypt, that process will still cause 
the IVE loader to write out referenced files as .ive's.


This would be pretty easy if I could derive from ReaderWriterIVE.

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


Re: [osg-users] connected shapes demo...

2008-10-01 Thread Jean-Sébastien Guay

Hello James,


It's such a fundamental aspect of a scenegraph.  From all the example's
I've seen in osg, everything is put on the root level.  There's no
concept of a local coordinate system based on some (root) object.


Of course there is.

MatrixTransform:
http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01482.html

PositionAttitudeTransform:
http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01587.html

DOFTransform:
http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01288.html

All of which derive from osg::Transform, and change the local coordinate 
system as you expect, and which under the covers work as you described 
would be done in straight OpenGL. You just don't have to worry about it, 
you use them and they take care of the rest.


I'm sure if you search all the examples for osg::MatrixTransform you'll 
come up with a few results (being sarcastic here :-) ).


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


Re: [osg-users] connected shapes demo...

2008-10-01 Thread James Moliere
On Wed, 2008-10-01 at 10:57 -0400, Tomlinson, Gordon wrote:
> Why should there be an example of this ? 
> 

It's such a fundamental aspect of a scenegraph.  From all the example's
I've seen in osg, everything is put on the root level.  There's no
concept of a local coordinate system based on some (root) object.

Using opengl, I simply push the global coordinate system on the stack,
rotate and translate each item and then ultimately pop the stack to get
back to my global coordinate system.  I was simply interested in how osg
and OpenGL compared.

> You're the 1st person to this ask for particular exact usage, that I
> have seen on this list.
> 
> As to examples of using just transforms there are many and they are also
> covered in most of the tutorials online and into the Guide to OSG
> written by Paul Martz
> 
I shall hunt these down.

> You might want to Google around on scene graphs and
> transformations/matrices and how they can be used, to provide local
> coordinate systems, how you can chain for certain actions( there are
> some things you cannot do by simply using child transforms you have to
> do the math in many cases) , there's a lot on the net, also look at how
> vis-modeling packages like MultigenCreator, Carbon Grpahics Geo, Remo3D
> etc provide tools to create the models and transformation chains
> 
Thanks for these pointers.  I'm trying to see if osg can be used in my
project.

> 
> Gordon
> 
> __
> Gordon Tomlinson
> Product Manager 3D
> Email  : gtomlinson @ overwatch.textron.com
> __
> 
> "Self defence is not a function of learning tricks 
> but is a function of how quickly and intensely one 
> can arouse one's instinct for survival" 
> - Master Tambo Tetsura
> 
>  
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of James
> Moliere
> Sent: Wednesday, October 01, 2008 10:10 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] connected shapes demo...
> 
> J.P.
> Thanks for the advice.  I believe I see how to connect objects together
> and will hand over a sample if I can get one going.  I'm sorta in
> disbelief that an example like this doesn't seem to exist.
> 
> James
> 
> J.P. Delport wrote:
> > hello,
> >
> > you can connect transforms together in a parent child fashion, this is
> 
> > what a scene "graph" is for.
> >
> > Try make yourself an example with the following structure:
> >
> > root
> > |
> > transform1 -- shape1
> > |
> > transform2 -- shape2
> > |
> > transform3 -- shape3
> >
> > transform1 is child of root
> > shape1 and transform2 are children of transform1 ...
> >
> > jp
> >
> >
> > James Moliere wrote:
> >> Gordon,
> >> Thanks for letting me know this.
> >>
> >> Is there a concept of parent/child relationships in OSG with respect 
> >> to primitive objects?  ...To make the cylinder example work?  Are all
> 
> >> objects that are placed into the scene work off of global
> coordinates?
> >> James
> >>
> >> Gordon Tomlinson wrote:
> >>> Nope there's no example that shows this, but many things are 
> >>> possible with by writing code
> >>>
> >>> __
> >>> Gordon Tomlinson
> >>> [EMAIL PROTECTED]
> >>> IM: [EMAIL PROTECTED]
> >>> www.vis-sim.com www.gordontomlinson.com 
> >>> __
> >>>
> >>> -Original Message-
> >>> From: [EMAIL PROTECTED]
> >>> [mailto:[EMAIL PROTECTED] On Behalf Of 
> >>> James Moliere
> >>> Sent: Tuesday, September 30, 2008 10:36 PM
> >>> To: osg-users@lists.openscenegraph.org
> >>> Subject: [osg-users] connected shapes demo...
> >>>
> >>> Hello,
> >>> Is there a connect shapes example?  For instance, I'd like to have 3
> 
> >>> cylinders where 2 of the cylinders connected sequentially at the end
> 
> >>> of the previous cylinder.  When I rotate cylinder 1, I'd like the 
> >>> others to rotate about cylinder 1 as though they are connected 
> >>> without doing any extra calculations.  The same goes for cylinder 2 
> >>> but this time cylinder 1 stays stationary and cylinder 3 moves.  Is 
> >>> this possible?  Is there an example that shows this?
> >>>
> >>> Thanks!
> >>>
> >>> ___
> >>> osg-users mailing list
> >>> osg-users@lists.openscenegraph.org
> >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
> >>> h.org
> >>>
> >>>
> >>> ___
> >>> osg-users mailing list
> >>> osg-users@lists.openscenegraph.org
> >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
> >>> h.org
> >>>
> >>>
> >>>   
> >>
> >> ___
> >> osg-users mailing list
> >> osg-users@lists.openscenegraph.org
> >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph
> >> .org
> >>
> >>
> >
> 
> __

Re: [osg-users] How do I Subclass a file loader?

2008-10-01 Thread Thrall, Bryan
brettwiesner wrote on Wednesday, October 01, 2008 11:02 AM:
> I've got a requirement to ship certain 3rd party model data only in an
> encrypted format. So I wrote my own loader that does the encryption/
> decryption but uses the IVE loader for everything. This works except
for
> files that reference other files. The master file is encrypted, but
the
> referenced files are saved out as .ive's.

> 2) Is there some other mechanism in OSG that will let me do this?

You could implement your own loader with a different file extension
(say, ".enc") that does the en/decryption and then calls the IVE loader
to load the resulting data. The curl loader does something like this.

Or you could use a osgDB::Registry::Read/WriteFileCallback to de/encrypt
the data before it gets read/sent from/to disk.

-- 
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How do I Subclass a file loader?

2008-10-01 Thread brettwiesner

Hi,

I've got a requirement to ship certain 3rd party model data only in an 
encrypted format. So I wrote my own loader that does the encryption/ 
decryption but uses the IVE loader for everything. This works except for 
files that reference other files. The master file is encrypted, but the 
referenced files are saved out as .ive's.


Ideally all I would have to do is subclass ReaderWriterIVE and override 
the following stream methods:


 virtual osgDB::ReaderWriter::ReadResult readObject(std::istream& fin,
 const osgDB::ReaderWriter::Options* options) const;

  virtual osgDB::ReaderWriter::ReadResult readImage(std::istream& fin,
 const osgDB::ReaderWriter::Options* options) const;

  virtual osgDB::ReaderWriter::ReadResult readNode(std::istream& fin,
 const osgDB::ReaderWriter::Options* options) const;

  virtual osgDB::ReaderWriter::WriteResult writeObject(const 
osg::Object& object,
 std::ostream& fout, const osgDB::ReaderWriter::Options* options) 
const;


  virtual osgDB::ReaderWriter::WriteResult writeImage(const osg::Image& 
image,
 std::ostream& fout, const osgDB::ReaderWriter::Options* options) 
const;


  virtual osgDB::ReaderWriter::WriteResult writeNode(const osg::Node& node,
 std::ostream& fout, const osgDB::ReaderWriter::Options* options) 
const;


For writing I could get the raw data from the ive loader encrypt it and 
write it out. For reading I could decrypt the data, then pass the 
unencrypted data up to the ive loader for use.


There is one fatal flaw... I can't subclass the ReaderWriterIVE plugin. :(

1) Has anyone besides me ever wanted to derive from a file loader? Would 
it make sense to keep the logic in a lib with headers, then have another 
library that is just the plugin?


2) Is there some other mechanism in OSG that will let me do this?

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


Re: [osg-users] About the DICOM loader

2008-10-01 Thread Iván Macía
Hi Robert,

To update the info on the topic, it seems that ITK is starting to support
GDCM 2.x. It is in the ITK CVS at a very preliminary stage yet (they say not
to use it yet but for experimentation) but has not been merged yet as it
does not compile with VS6. They are even thinking on dropping support for
VS6 and VS7.0 compilers.

ITK must be configured with ITK_USE_SYSTEM_GDCM -> ON and GDCM_DIR to
whatever path of the GDCM 2.x.

Best regards

Ivan

-Mensaje original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Robert
Osfield
Enviado el: jueves, 28 de agosto de 2008 17:46
Para: OpenSceneGraph Users
Asunto: Re: [osg-users] About the DICOM loader

Thanks for extra links and info Ivan.  I've download 2.0.8 and compile
and check it out.

On Thu, Aug 28, 2008 at 4:27 PM, Ivan Macia <[EMAIL PROTECTED]> wrote:
> Hi Robert,
>
> There are two major versions of GDCM, 1.x (current version 1.3.1 or so)
and
> 2.x (currently 2.0.8). They are not compatible. GDCM 2.x seems to be much
> faster parsing and also covers some parts of the protocol outside the
scope
> of the image representation. Both seem to be currently developed in
> parallel. I ignore if there are future plans to abandon the 1.x branch.
>
> This is GDCM 1.x
> http://www.creatis.insa-lyon.fr/Public/Gdcm/html.user/index.html
>
> More info on GDCM 2.0 here
> http://gdcm.sourceforge.net/wiki/index.php/GDCM_Release_2.0
> http://gdcm.sourceforge.net/2.0/html/classes.html
>
> The notes on GDCM homepage say that ITK currently uses GDCM 1.2.x. Also
they
> suggest to use GDCM 2.x for new developments
> http://www.creatis.insa-lyon.fr/Public/Gdcm/
>
> I ignore the plans of ITK development team about this but probably the
best
> person to contact is Mathieu Malaterre as he developed the ITK GDCM
classes.
>
> On the other hand, nothing prevents to make the DICOM plugin for OSG using
> GDCM 2.x even if ITK is using GDCM 1.x. If OSG was to connect with an ITK
> pipeline, then users will use ITK GDCM readers at the beginning of the ITK
> pipeline. Otherwise, they could use an hypothetical OSG GDCM 2-based DICOM
> plugin to read for example a volume and render it. Just an idea, but I
think
> more info about this is necessary.
>
> Best regards
>
> Ivan
>
>
>
> 2008/8/28 Robert Osfield <[EMAIL PROTECTED]>
>>
>> Hi Ivan,
>>
>> Many thanks for info about GDCM.  Just downloaded and built it - no
>> problems.  Nice to see CMake in action in both ITK and GDCM.
>>
>> Do you have any ideas when GDCM 2.0 might be out?  Another question
>> for the ITK community would be their own plans for moving for to later
>> versions of GDCM.  It'd be good to keep in sync otherwise one might
>> end up with multiple versions of GDCM needing to be installed.
>>
>> On the ITK integration front, I expect this should be relatively
>> straight forward to implement - the key is just extract the imagery as
>> an osg::Image, then all the standard OSG texturing would be able to
>> used.  My initial dicom loader based ITK has code for doing this
>> already, it's not general purpose enough yet, but at least a step in
>> this direction.
>>
>> Robert.
>>
>> On Thu, Aug 28, 2008 at 11:36 AM, Iván Macía <[EMAIL PROTECTED]>
wrote:
>> > Dear Hesicong, Robert,
>> >
>> > I have some experience using ITK. ITK relies now on GDCM library to
read
>> > DICOM files.
>> >
>> > http://www.creatis.insa-lyon.fr/Public/Gdcm/
>> >
>> > GDCM focuses on the part of the DICOM protocol related to the image
>> > format
>> > and representation whereas DCMTK covers most of the standard which
>> > includes
>> > transmission, services such as query/retrieve, storage etc. In my
>> > opinion
>> > GDCM would be simpler and easier to use in this kind of application.
>> >
>> > The itk::ImageFileReader relies on pluggable factories. When the DICOM
>> > format is detected by the reader the itk::GDCMImageIO object is used
>> > which
>> > actually uses GDCM code.
>> >
>> > DICOM series (consisting of several DICOM files) are read somehow a bit
>> > differently by generating a series of file names
>> > (itk::GDCMSeriesFileNames)
>> > that are then passed to itk::ImageSeriesReader but in the end they also
>> > use
>> > GDCMImageIO.
>> >
>> > Note that ITK does not use GDCM 2.x which is a major rework from GDCM
>> > 1.x
>> > which is the one used by ITK.
>> >
>> > You may want to have a look at this before deciding which DICOM library
>> > to
>> > use.
>> >
>> > It would be really nice to be able to use the ITK pipeline together
with
>> > an
>> > OSG based volume visualization.
>> >
>> > HTH
>> >
>> > Ivan
>> >
>> >
>> > -Mensaje original-
>> > De: [EMAIL PROTECTED]
>> > [mailto:[EMAIL PROTECTED] En nombre de sicong
>> > he
>> > Enviado el: jueves, 28 de agosto de 2008 6:22
>> > Para: OpenSceneGraph Users
>> > Asunto: Re: [osg-users] About the DICOM loader
>> >
>> > Hi, Robert,
>> > Thanks for reply. I'm going on with the loader and if I create one,
>> > I'll contribute it!
>> >
>> > 2008/8/27, Robert Osfield <[

Re: [osg-users] Reminder: OSG training in Austin, TX

2008-10-01 Thread Paul Martz
> Hi Paul,
>How often do you guys do these training sessions?  I doubt 
> my company will want to send me this time, but it might be 
> worth sending a few of us in the future if these sessions 
> will continue to be offered.
> 
>For that matter, how often do you do the OpenGL training?  
> I have a reasonable grasp on it, but I have considered 
> picking up a course at UAH just to get some instruction and 
> directed hands-on training.  A short course from experts in 
> the field would probably be better than a college course with 
> a professor that just read the textbook and can create fly-by 
> 3D scenes.

(Background info: Bob Kuehne and I, along with Alan Millman, have formed a
new company -- Tech Soup, Inc. -- to offer developer training and
educational materials. The OSG courses in Austin will be the last OSG course
we offer before moving OSG training under the Tech Soup umbrella. In the
future, we'll offer the same OSG training as in the past, just under a new
name: Tech Soup.)

We haven't laid out a schedule beyond October; we prefer to let demand drive
course frequency. But I'd think you can expect to see a public course from
Tech Soup every 2 to 3 months, and the course topic will be either OSG,
OpenGL 3.0, or OpenGL ES.

Another option for you to consider would be to have us come onsite to do
private training. This is cost-effective if you have, say, 6 or more staff
that would attend. If you have a smaller staff, you could reduce costs by
hosting a public course at your facility, and bring us in to do the
training.

Email me off-list (or call) if you'd like additional information on private
training or hosted public training.

Paul Martz
Skew Matrix Software LLC
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] connected shapes demo...

2008-10-01 Thread Tomlinson, Gordon
Why should there be an example of this ? 

You're the 1st person to this ask for particular exact usage, that I
have seen on this list.

As to examples of using just transforms there are many and they are also
covered in most of the tutorials online and into the Guide to OSG
written by Paul Martz

You might want to Google around on scene graphs and
transformations/matrices and how they can be used, to provide local
coordinate systems, how you can chain for certain actions( there are
some things you cannot do by simply using child transforms you have to
do the math in many cases) , there's a lot on the net, also look at how
vis-modeling packages like MultigenCreator, Carbon Grpahics Geo, Remo3D
etc provide tools to create the models and transformation chains


Gordon

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

"Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival" 
- Master Tambo Tetsura

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James
Moliere
Sent: Wednesday, October 01, 2008 10:10 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] connected shapes demo...

J.P.
Thanks for the advice.  I believe I see how to connect objects together
and will hand over a sample if I can get one going.  I'm sorta in
disbelief that an example like this doesn't seem to exist.

James

J.P. Delport wrote:
> hello,
>
> you can connect transforms together in a parent child fashion, this is

> what a scene "graph" is for.
>
> Try make yourself an example with the following structure:
>
> root
> |
> transform1 -- shape1
> |
> transform2 -- shape2
> |
> transform3 -- shape3
>
> transform1 is child of root
> shape1 and transform2 are children of transform1 ...
>
> jp
>
>
> James Moliere wrote:
>> Gordon,
>> Thanks for letting me know this.
>>
>> Is there a concept of parent/child relationships in OSG with respect 
>> to primitive objects?  ...To make the cylinder example work?  Are all

>> objects that are placed into the scene work off of global
coordinates?
>> James
>>
>> Gordon Tomlinson wrote:
>>> Nope there's no example that shows this, but many things are 
>>> possible with by writing code
>>>
>>> __
>>> Gordon Tomlinson
>>> [EMAIL PROTECTED]
>>> IM: [EMAIL PROTECTED]
>>> www.vis-sim.com www.gordontomlinson.com 
>>> __
>>>
>>> -Original Message-
>>> From: [EMAIL PROTECTED]
>>> [mailto:[EMAIL PROTECTED] On Behalf Of 
>>> James Moliere
>>> Sent: Tuesday, September 30, 2008 10:36 PM
>>> To: osg-users@lists.openscenegraph.org
>>> Subject: [osg-users] connected shapes demo...
>>>
>>> Hello,
>>> Is there a connect shapes example?  For instance, I'd like to have 3

>>> cylinders where 2 of the cylinders connected sequentially at the end

>>> of the previous cylinder.  When I rotate cylinder 1, I'd like the 
>>> others to rotate about cylinder 1 as though they are connected 
>>> without doing any extra calculations.  The same goes for cylinder 2 
>>> but this time cylinder 1 stays stationary and cylinder 3 moves.  Is 
>>> this possible?  Is there an example that shows this?
>>>
>>> Thanks!
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
>>> h.org
>>>
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
>>> h.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.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to add UserData to .osg and .ive files

2008-10-01 Thread Robert Osfield
On Wed, Oct 1, 2008 at 3:34 PM, Brian R Hill <[EMAIL PROTECTED]> wrote:
> I'm looking into this. I'm guessing there might be issues with embedded
> quotes and possibly brackets "{}" (at least with the .osg files).

The .osg serialization should handle this without problem, including embedded ".

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


Re: [osg-users] Reminder: OSG training in Austin, TX

2008-10-01 Thread Cliff Taylor
Hi Paul,
   How often do you guys do these training sessions?  I doubt my
company will want to send me this time, but it might be worth sending
a few of us in the future if these sessions will continue to be
offered.

   For that matter, how often do you do the OpenGL training?  I have a
reasonable grasp on it, but I have considered picking up a course at
UAH just to get some instruction and directed hands-on training.  A
short course from experts in the field would probably be better than a
college course with a professor that just read the textbook and can
create fly-by 3D scenes.

Thanks,
Cliff

On Tue, Sep 30, 2008 at 7:17 PM, Paul Martz <[EMAIL PROTECTED]> wrote:
> Hi everyone -- This is just a reminder that Bob Kuehne and I will be leading
> four days of OSG training in Austin, Texas, at the end of October. Please
> register soon if you plan to attend.
>
> For details on the courses, and to register online:
> http://www.skew-matrix.com/training.asp
>
> Thanks,
>
> Paul Martz
> Skew Matrix Software LLC
> 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
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to add UserData to .osg and .ive files

2008-10-01 Thread Paul Melis
Just out of curiousity, is arbitrary data handled correctly for these 
fields? I.e. could you abuse it to store binary data?
If not, you can always do something like base64-encoding first, of 
course ;-)


Paul

Serge Lages wrote:

Hi,

If you only need to set text, use the descriptions fields or the name 
instead of the UserData, it will be written to the IVE or OSG file 
without problem.


Cheers,

On Wed, Oct 1, 2008 at 3:41 PM, Brian R Hill <[EMAIL PROTECTED] 
> wrote:



I'm trying to add user data (text) to nodes and write them out
as .osg/.ive.

Any suggestions on how I can do this?

Brian

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

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




--
Serge Lages
http://www.tharsis-software.com


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


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


Re: [osg-users] How to add UserData to .osg and .ive files

2008-10-01 Thread Brian R Hill
I'm looking into this. I'm guessing there might be issues with embedded
quotes and possibly brackets "{}" (at least with the .osg files).

Brian

[EMAIL PROTECTED] wrote: -

To: OpenSceneGraph Users 
From: Paul Melis <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
Date: 10/01/2008 10:08AM
Subject: Re: [osg-users] How to add UserData to .osg and .ive files

Just out of curiousity, is arbitrary data handled correctly for these
fields? I.e. could you abuse it to store binary data?
If not, you can always do something like base64-encoding first, of
course ;-)

Paul

Serge Lages wrote:
> Hi,
>
> If you only need to set text, use the descriptions fields or the name
> instead of the UserData, it will be written to the IVE or OSG file
> without problem.
>
> Cheers,
>
> On Wed, Oct 1, 2008 at 3:41 PM, Brian R Hill <[EMAIL PROTECTED]
> > wrote:
>
>
> I'm trying to add user data (text) to nodes and write them out
> as .osg/.ive.
>
> Any suggestions on how I can do this?
>
> Brian
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> 
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
>
> --
> Serge Lages
> http://www.tharsis-software.com
> 
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

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


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


Re: [osg-users] segfault: osgDB::DatabasePager::FindCompileableGLObjectsVisitor::apply

2008-10-01 Thread Robert Osfield
On Wed, Oct 1, 2008 at 2:07 PM, Melchior FRANZ <[EMAIL PROTECTED]> wrote:
> * Melchior FRANZ -- Saturday 27 September 2008:
>> yes. Meanwhile I switched back to OSG revision 8779 and
>> the problem is gone.
>
> No, just got it again with that revision. So the bug is very
> likely in FlightGear, as I don't think I had problems with
> revisions around that time.

Or perhaps the scene graph usage model in FlightGear just happens to
reveal a bug on the OSG side... One won't really know until more about
of what's causing this bug is indentified.  Alas this type of
intermittent bug are often very hard to pin down ;-|

Is there are particular combination of usage that reveals the bug?  Is
it possible to alter the threading model that FlightGear uses?

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


Re: [osg-users] connected shapes demo...

2008-10-01 Thread James Moliere

J.P.
Thanks for the advice.  I believe I see how to connect objects together 
and will hand over a sample if I can get one going.  I'm sorta in 
disbelief that an example like this doesn't seem to exist.


James

J.P. Delport wrote:

hello,

you can connect transforms together in a parent child fashion, this is 
what a scene "graph" is for.


Try make yourself an example with the following structure:

root
|
transform1 -- shape1
|
transform2 -- shape2
|
transform3 -- shape3

transform1 is child of root
shape1 and transform2 are children of transform1
...

jp


James Moliere wrote:

Gordon,
Thanks for letting me know this.

Is there a concept of parent/child relationships in OSG with respect 
to primitive objects?  ...To make the cylinder example work?  Are all 
objects that are placed into the scene work off of global coordinates?

James

Gordon Tomlinson wrote:
Nope there's no example that shows this, but many things are 
possible with

by writing code

__
Gordon Tomlinson
[EMAIL PROTECTED]
IM: [EMAIL PROTECTED]
www.vis-sim.com www.gordontomlinson.com 
__


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James
Moliere
Sent: Tuesday, September 30, 2008 10:36 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] connected shapes demo...

Hello,
Is there a connect shapes example?  For instance, I'd like to have 3 
cylinders where 2 of the cylinders connected sequentially at the end 
of the previous cylinder.  When I rotate cylinder 1, I'd like the 
others to rotate about cylinder 1 as though they are connected 
without doing any extra calculations.  The same goes for cylinder 2 
but this time cylinder 1 stays stationary and cylinder 3 moves.  Is 
this possible?  Is there an example that shows this?


Thanks!

___
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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to add UserData to .osg and .ive files

2008-10-01 Thread Brian R Hill
Serge,

Thanks, I was just looking into using the description when I got your
message.

Brian

[EMAIL PROTECTED] wrote: -

To: "OpenSceneGraph Users" 
From: "Serge Lages" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
Date: 10/01/2008 09:55AM
Subject: Re: [osg-users] How to add UserData to .osg and .ive files

Hi,

If you only need to set text, use the descriptions fields or the name
instead of the UserData, it will be written to the IVE or OSG file without
problem.

Cheers,


On Wed, Oct 1, 2008 at 3:41 PM, Brian R Hill
<
[EMAIL PROTECTED]
>
 wrote:


I'm trying to add user data (text) to nodes and write them out

as .osg/.ive.


Any suggestions on how I can do this?


Brian


___

osg-users mailing list

osg-users@lists.openscenegraph.org


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





--
Serge Lages
http://www.tharsis-software.com



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


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


Re: [osg-users] How to add UserData to .osg and .ive files

2008-10-01 Thread Serge Lages
Hi,

If you only need to set text, use the descriptions fields or the name
instead of the UserData, it will be written to the IVE or OSG file without
problem.

Cheers,

On Wed, Oct 1, 2008 at 3:41 PM, Brian R Hill <[EMAIL PROTECTED]> wrote:

>
> I'm trying to add user data (text) to nodes and write them out
> as .osg/.ive.
>
> Any suggestions on how I can do this?
>
> Brian
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to add UserData to .osg and .ive files

2008-10-01 Thread Brian R Hill

I'm trying to add user data (text) to nodes and write them out
as .osg/.ive.

Any suggestions on how I can do this?

Brian

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


Re: [osg-users] segfault: osgDB::DatabasePager::FindCompileableGLObjectsVisitor::apply

2008-10-01 Thread Melchior FRANZ
* Melchior FRANZ -- Saturday 27 September 2008:
> yes. Meanwhile I switched back to OSG revision 8779 and
> the problem is gone.

No, just got it again with that revision. So the bug is very
likely in FlightGear, as I don't think I had problems with
revisions around that time.

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


Re: [osg-users] vpb: Spherical terrains?

2008-10-01 Thread Jean-Sébastien Guay

Hi Robert, Alejandro,


I haven't personally worked with non earth data yet, but it
should be possible to add better accounting of non earth data,
although I can't say without reviewing the data more closely how
transparently we can archive this.   Perhaps a --geoecentric-moon etc
could be done as a fallback if it can't be detected for automatically,
or as you've done just point users to manually specifying the
radius-polar and radius-equator.


Sorry for hijacking this thread, but I was wondering about this 
lately... Eventually, I would like to make a small game in my spare time 
where I would like to use VPB to generate some (fictional) planets for 
me, and I was wondering if that was possible. It seems it is...


I assume radius-polar is the radius from the center of the planet to one 
of the poles, so perpendicular to radius-equator, is that right? So the 
only possible shape is an ellipsoid (with a sphere being the case where 
both radii are equal).


Another question I had was what tools I would use to generate the height 
maps. They would need to be in some projection similar to Earth maps I 
would guess (Mercator?) and then, VPB would map that with the radii that 
I specified automatically? Does anyone have suggestions of tools that 
would allow me to handle such large and potentially detailed height maps 
while having "artistic control" over shape of the land?


Anyways, I was just toying with the idea, not actually doing anything 
yet, but the possibilities seem interesting.


Thanks,

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


Re: [osg-users] [osg-submissions] View Dependent Shadow maps(LispSM)

2008-10-01 Thread Jean-Sébastien Guay

Hello Wojtek, Adrian,

Lets imagine following case: suppose that such the 
same light will get used by lighting and shadow computation. It may 
bring some discrepancies if happens to be preceded by some 
trransformation. When used with lighting it will be premultiplied by 
inverse model view but when used by shadowing it will be not 
premultiplied. So the lighting direction and shadow casting direction 
may get out of sync. Using this properly would require some knowledge 
and discipline from user. But it may be still worth adding. I would be 
grateful If Robert or others could join this discussion and say what 
they think.


Personally, I think the lighting computations for shadowing should be 
the same as for any other OpenGL application. A light source is 
positional state, you can't just assume it will always be at the top of 
your graph with no transforms above it.


Even if it might be a valid assumption in one case, it's not in general 
because as Wojtek says, if you ever have the case where there is a 
transform above the light source (which is also perfectly valid from an 
OpenGL standpoint) then the scene lighting and shadows won't match.


I think PSSM should be fixed to handle this correctly. At a minimum, any 
such assumptions should be well documented instead of having to read the 
code to find out...


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


Re: [osg-users] Problems integrating MFC example with existing application

2008-10-01 Thread Simon Hammett
2008/9/30 Simon <[EMAIL PROTECTED]>

> Yup, the mfc example is broken.


Doh, ignore me. Just problems with loading plugins, it fails silently...
Mind you the MFC version keeps flashing the screen black when resizing
whilst
the one I wrote which uses setUpViewerAsEmbeddedInWindow doesn't.


>
> If you don't mind it being single threaded, have a look at the osgViewerGtk
> one.
> I adapted that to work with OwlNext2 in about half an hour.
>
> you want something like this:
>
> osgViewer::GraphicsWindow*m_pWindow =
> m_pViewer->setUpViewerAsEmbeddedInWindow(0, 0, rect.right, rect.bottom);
> osgViewer::Viewer*
>  m_pViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
>
> then forward window events on using
>
>  void TGlWindow::EvMouseMove(uint /*modKeys*/, TPoint& point)
>  {
> m_pWindow->getEventQueue()->mouseMotion(point.x, point.y);
>  }
>
> Repeat for other windows messages.
>
> Not sure what's wrong with the MFC one at the mo, I was going to start
> poking around
> but then it was the end of the working day! :)
>
> Jesper D. Thomsen wrote:
>
>> Hi again all,
>>  I have an existing MFC application with a window based on Cview, which
>> have been used as an OpenGL rendering canvas. I have now disabled the OpenGL
>> rendering of the window and instead replicated the osgviewermfc example in
>> my application in exactly the same way as in the example.
>>  The problem is that I can't get my model to render, even though the
>> backgroundcolor is defined and rendered by the osg viewer.
>>  When debugging the application I noticed that the
>> viewer-view-_slaves-[0]-_projectionOffset-_mat-[0]...[3]-[0] values change
>> from their initialisation from "addslave" to "-1.#IND000" right
>> after i dispatch the rendering thread. This off course causes further
>> problems in frame() with other values going bad.
>>  My question is whether OSG could be doing this, or if it must be the
>> original application writing somewhere it shouldn't? Or does OSG use som
>> standard OpenGL variables which might be overwritten by the existing
>> application?
>>  Regards, and I know this problem is rightly irritating, but I hope
>> somebody can give me some hints.
>>
>> Jesper D. Thomsen
>>
>> 
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
>


-- 
The truth is out there. Usually in header files.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] DatabasePager - A little confused

2008-10-01 Thread Chris Denham

Hello,
I'm not sure I completely understand the question here, so I hope this 
answer is not too far off the point.. However, while this is fresh in my 
head, I just spent some time puzzling over PagedLOD and ProxyNode because I 
couldn't find any good examples. I think my initial confusion was do with 
trying to use ProxyNode for a purpose that it was not intended. The purpose 
being, to allow asynchronous loading of models while interacting with the 
scene. ProxyNode kind of does that, but it only really seems to be intended 
to 'proxy' the bounding box calculation, and does not provide a 'stand-in' 
visual object to display during the asychronous load. Enter the PagedLOD 
it seemed to me that everything I expected ProxyNode to do was actually 
implemented in PagedLOD!


Here's my test example that loads 10 cows asynchronously and shows stand-in 
cuboids for each cow until each cow model is loaded. (Note, I have specified 
the stand-in object as a LOD in the very far distance which means that 
hopefully it will only ever be seen until the 'real' model is loaded)


Chris.

static osg::Node* createCowLOD()
{
   osg::Shape* shape = new osg::Box(osg::Vec3(0, 0, 0), 9, 3, 5);
   osg::ShapeDrawable* shapeDrawable = new osg::ShapeDrawable(shape);
   osg::Geode* geode = new osg::Geode();
   geode->addDrawable(shapeDrawable);
   return geode;
}

int main( int argc, char **argv )
{

   osgViewer::Viewer viewer;

   osg::Group* root = new osg::Group();
   for (int y = 0; y < 5; y++)
   for (int x = 0; x < 2; x++)
   {
   osg::MatrixTransform* transform = new 
osg::MatrixTransform(osg::Matrix::translate(x * 10, y * 4, 0));

   osg::PagedLOD* pagedLOD = new osg::PagedLOD();
   pagedLOD->addChild(createCowLOD(), 1e29, 1e30);
   pagedLOD->setFileName(1, "cow.osg");
   pagedLOD->setRange(1, 0, 1e29);
   transform->addChild(pagedLOD);
   root->addChild(transform);
   }

   viewer.setSceneData(root);

   viewer.realize();

   viewer.run();

   return 0;
}



Date: Wed, 1 Oct 2008 12:22:14 +0800 (CST)
From: Simba <[EMAIL PROTECTED]>
Subject: Re: [osg-users] DatabasePager - A little confused
To: "OpenSceneGraph Users" 
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="gbk"


Hi,
  I'm not sure whether I have understood your problem. But I think that if 
you
want to use databasepager, you just have to make sure you have "pagedLOD" 
node in your models. If you do, then just use 
viewer.setScenedata(model.get()), so the osgViewer::Viewer will 
automatically do the rest.

  Hope this infomation may help~~~ :)

 Simbaforrest





?2008-10-01 07:06:58?"Alan Ott" <[EMAIL PROTECTED]> ???

Hello,

After much trying and failing, I think I have a fundamental
misunderstanding reagarding the DatabasePager. I have looked for
examples or code snippets and it seems that there are none. So here's
what I have.

I have a DatabasePager object that I use for terrain. When I need a new
chunk of terrain, I call requestNodeFile() with the name of the tile of
terrain that I want, and give it a group node to attach it to. Every
frame, I check my group nodes to see if they have a piece of terrain
attached to them (ie: see if the pager paged in the terrain and attached
it to my group). If a new piece of terrain has been loaded, I then
perform my initialization on it (lookup switch nodes, etc), and attach
it to my main scene. This gets the job done.

The problem now, is that every time a new tile is attached to the main
scene, the next frame takes a long time, and I have a missed frame. This
has to do with the new tile getting compiled (texture sent to OpenGL,
etc) when it's drawn the first time. To overcome this, I want
DatabasePager to do this for me, which it seems to be able to support,
but everything I try doesn't work in one way or another. I have
something like the following (roughly):

// Set up the pager
pager = osgDB::DatabasePager::create();
pager->setCompileGLObjectsForContextID (0, true);
pager->setDoPreCompile(true);
...

// My composite viewer
osgViewer::CompositeViewer *viewer = new osgViewer::CompositeViewer;


// Then for each View I have something like this.
view = new osgViewer::View;
view->setSceneData(root.get());
view->getScene()->setDatabasePager(pager);

So in this case, only what gets requested the first frame (before the
first draw) gets paged in. Anything requested after that never gets
loaded. If I take out the call to setCompileGLObjectsForContextID(), of
course, no precompiling happens. Other things happen if I take out the
getScene()->setDatabasePager().

From some of the code regarding PagedLOD's, I get the feeling I might
be going about this the wrong way entirely, and possibly using
DatabasePager in a way in which it was not designed.

So I guess my question is, does anyone have anything they can tell me
about how to use this class? Maybe some code snippets? Anything at all
would help. I've spent a lot of time searching onlin

Re: [osg-users] vpb: Spherical terrains?

2008-10-01 Thread Robert Osfield
Hi Alejandro,

VPB developed focused on earth data, so --geocentric automatically
sets up the earth sizes, so I guess this is probably where things go
adrift.  I haven't personally worked with non earth data yet, but it
should be possible to add better accounting of non earth data,
although I can't say without reviewing the data more closely how
transparently we can archive this.   Perhaps a --geoecentric-moon etc
could be done as a fallback if it can't be detected for automatically,
or as you've done just point users to manually specifying the
radius-polar and radius-equator.

Robert.

On Wed, Oct 1, 2008 at 7:37 AM, Alejandro Aguilar Sierra
<[EMAIL PROTECTED]> wrote:
> Hi Glenn,
>
> Yes, thanks. Using more accurate moon metrics
>
> osgdem --geocentric --whole-globe -t moontex.tif  -d moon_tiled.tif \
>-l 10 \
>--radius-equator 1737100 --radius-polar 1735970 \
>-v 0.257 \
>-o lunasph.ive
>
> I got the attached images.
>
> Regards,
>
> --A.
>
>
> On Tue, Sep 30, 2008 at 11:23 AM, Glenn Waldron <[EMAIL PROTECTED]> wrote:
>> Alejandro,
>>
>> Try adding --radius-polar in addition to --radius-equator.
>>
>> Glenn
>>
>
> ___
> 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] DatabasePager - A little confused

2008-10-01 Thread Robert Osfield
Hi Alan,

For the most part you should never need to touch the DatabasePager
even when you are using paged database, the osgViewer will create and
manage the DatabasePager for you when you have paged databases, all
automatically without any need for intervention.  There are no OSG
examples demonstrating it, because there isn't any for the developer
to do extra, you just create your scene graph and attach it the viewer
and it'll do the rest.

The way to access the OSG's paging mechanism is to use the PagedLOD
node, this is a node you place in the scene graph, and can be
serialized out like any other node to a .ive file, and using it you
build a whole quad tree hierachy that can scales in to terrabyte
database without problems, and without any intervention from yourself.
  This means paging is principally an issue of database generation -
this is what the VirtualPlanetBuilder exists for.

The TXP plugin also uses PagedLOD, but with based on the TerraPage
archives which obviously don't know anything about PagedLOD, but the
plugin is able to decorate subgraphs loaded from TerraPage with
PagedLOD to enable it to leverage the DatabasePager.  This could serve
as an example to you if this is type of thing you are trying to
tackle.

Robert.

On Wed, Oct 1, 2008 at 12:06 AM, Alan Ott <[EMAIL PROTECTED]> wrote:
> Hello,
>
> After much trying and failing, I think I have a fundamental misunderstanding
> reagarding the DatabasePager. I have looked for examples or code snippets
> and it seems that there are none. So here's what I have.
>
> I have a DatabasePager object that I use for terrain. When I need a new
> chunk of terrain, I call requestNodeFile() with the name of the tile of
> terrain that I want, and give it a group node to attach it to. Every frame,
> I check my group nodes to see if they have a piece of terrain attached to
> them (ie: see if the pager paged in the terrain and attached it to my
> group). If a new piece of terrain has been loaded, I then perform my
> initialization on it (lookup switch nodes, etc), and attach it to my main
> scene. This gets the job done.
>
> The problem now, is that every time a new tile is attached to the main
> scene, the next frame takes a long time, and I have a missed frame. This has
> to do with the new tile getting compiled (texture sent to OpenGL, etc) when
> it's drawn the first time. To overcome this, I want DatabasePager to do this
> for me, which it seems to be able to support, but everything I try doesn't
> work in one way or another. I have something like the following (roughly):
>
> // Set up the pager
> pager = osgDB::DatabasePager::create();
> pager->setCompileGLObjectsForContextID (0, true);
> pager->setDoPreCompile(true);
> ...
>
> // My composite viewer
> osgViewer::CompositeViewer *viewer = new osgViewer::CompositeViewer;
> 
>
> // Then for each View I have something like this.
> view = new osgViewer::View;
> view->setSceneData(root.get());
> view->getScene()->setDatabasePager(pager);
>
> So in this case, only what gets requested the first frame (before the first
> draw) gets paged in. Anything requested after that never gets loaded. If I
> take out the call to setCompileGLObjectsForContextID(), of course, no
> precompiling happens. Other things happen if I take out the
> getScene()->setDatabasePager().
>
> From some of the code regarding PagedLOD's, I get the feeling I might be
> going about this the wrong way entirely, and possibly using DatabasePager in
> a way in which it was not designed.
>
> So I guess my question is, does anyone have anything they can tell me about
> how to use this class? Maybe some code snippets? Anything at all would help.
> I've spent a lot of time searching online and digging through the code, so
> if I've missed something obvious, please go easy :)
>
> Alan.
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osg-submissions] View Dependent Shadow maps(LispSM)

2008-10-01 Thread Wojciech Lewandowski
Hi Adrian,

I suppose that pluging the LightNode as parent or earlier sibling of 
ShadowedScene should work. OSG handles LightNodes, ClipNodes and TexGenNodes in 
such a way that last such node encounterd in traversal will be used for whole 
render stage during rendering traversal. So there is a chance that your light 
may be processed (culled) after shadowed scene but will still be used for 
lighting computation. However, if light was not processed before ShadowMap  & 
StandardShadowMap by cull traversal - these techniques will not find such light 
among render stage positional state attributes. In such case they may use other 
light for shadow computation.

I suppose your user light concept may be an approach that will work always but 
it changes standard OSG policy of handling positional state attributes. Lets 
imagine following case: suppose that such the same light will get used by 
lighting and shadow computation. It may bring some discrepancies if happens to 
be preceded by some trransformation. When used with lighting it will be 
premultiplied by inverse model view but when used by shadowing it will be not 
premultiplied. So the lighting direction and shadow casting direction may get 
out of sync. Using this properly would require some knowledge and discipline 
from user. But it may be still worth adding. I would be grateful If Robert or 
others could join this discussion and say what they think.

Cheers,
Wojtek



- Original Message - 
  From: Adrian Egli OpenSceneGraph (3D) 
  To: OpenSceneGraph Users 
  Sent: Tuesday, September 30, 2008 10:17 PM
  Subject: Re: [osg-users] [osg-submissions] View Dependent Shadow maps(LispSM)


  Hi Wojtek, 

  i didn't get the time slot to test the lighting and the other maps again. but 
if we assume, that we will have a sun light, for what pssm is good (or other 
shadow tech.), we can easy assume that the light doesn't move with a matrix 
transformation, so we set the sun light at a position and a direction, and this 
would be the (global) world pos, so the question can be answered with yes. 

  may the pssm sun light concept (user light) is not a good idea. i don't know. 
how can i force the algorithme to cull the light? 



  2008/9/30 Wojciech Lewandowski <[EMAIL PROTECTED]>

Adrian,

Does osgShadow::ShadowMap works in the same case ?  I tried to mimic 
osgShadow::ShadowMap functionality. Both osgShadow::StandardShadowMap  & 
osgShadow::ShadowMap try to lcate the light and compute its proper modelview 
matrix by scanning render stage state attributes. If the light was not culled 
yet it will be not found. In this case algorithm will stick to some other light 
(probably the default one).

I briefly looked at PSSM user light usage. I noticed that PSSM sort of 
treats userLight as ABSOLUTE_RF. It simply takes its location and direction as 
is and  assumes that model view matrix is identity. It also does not check if 
this light was processed by cull traversal, so there is chance we would use one 
light for shadow casting and other light for lighting computations. Is this the 
intention ? If yes, we may add similar functionality.

Cheers,
Wojtek



- Original Message - 
  From: Wojciech Lewandowski 
  To: OpenSceneGraph Users 
  Sent: Monday, September 29, 2008 10:32 PM
  Subject: Re: [osg-users] [osg-submissions] View Dependent Shadow 
maps(LispSM)


  Hi Adrian,

  I will check it. Hopefully tomorrow (tuesday) Maybe I will be able to 
find what is wrong.

  Cheers,
  Wojtek


  [Wojciech Lewandowski]  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Adrian Egli 
OpenSceneGraph (3D)
  Sent: Saturday, September 27, 2008 6:52 PM
  To: OpenSceneGraph Users
  Subject: Re: [osg-users] [osg-submissions] View Dependent Shadow 
maps(LispSM)


I don't have any shadow, 

my scene look similar to the osgshadow one. but i have a strange 
behaviour. 

pseudo code:
osg::Group g
osg::Lightsource s;

shadowed->addchild(s)
shadowed->addchild(g)

viewer.setData(shadowed) 

i don't have light on, need state set to switch on light ()


s->getOrCreateStateSet()->setAttributeAndModes(m_lightSource_Sun->getLight(),osg::StateAttribute::ON);

and pssm does work, but lispsm not (event with setlight(s->getLight())


adrian 


2008/9/24 Wojciech Lewandowski <[EMAIL PROTECTED]>

  Hi,

  What is wrong ? It does not work ? Method accepts Light ptr. If you 
have LightNode simply use getLight() to pass right argument.

  Wojtek
- Original Message - 
From: Adrian Egli OpenSceneGraph (3D) 
To: [EMAIL PROTECTED] ; OpenSceneGraph Users 
Sent: Wednesday, September 24, 2008 10:17 AM
Subject: Re: [osg-users] [osg-submissions] View Dependent Shadow 
maps (LispSM)


  

Re: [osg-users] useCursor

2008-10-01 Thread Robert Osfield
Hi Paul,

It does sound a like race condition.  osgViewer::GraphicsWindowX11
does maintain two Display handles to the X server to enable the
graphics thread and the main thread to both safely make X11 calls,
perhaps this isn't being managed correctly in your case.

BTW, you can switch off the cursor on creation of the GraphicsWindow
by setting the GraphicsContext::Traits::useCursor variable to false.

Robert.

On Tue, Sep 30, 2008 at 6:53 PM,  <[EMAIL PROTECTED]> wrote:
> Is this a race condition??? Sometimes I get this X11ErrorHandling problem and 
> other times I don't.
>
> Just before turning off the cursor, I have a _viewer->realize(); I assume 
> this is where the graphics context is created.  If I put a sleep between the 
> realize and the useCursor loop, it seems to work more reliably.  Can somebody 
> describe to me how the "realize" relates to the useCursor command so I can 
> better understand what is going on here.  I assume it's not a problem turning 
> off the cursor on a mouse-less machine.
>
> Paul P.
>
> - Original Message 
> From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> To: osg-users@lists.openscenegraph.org
> Sent: Monday, September 29, 2008 8:15:35 AM
> Subject: useCursor
>
> I'm attempting to turn off the cursor using
> osgViewer::Viewer::Windows windows;
>_viewer->getWindows(windows);
>for (osgViewer::Viewer::Windows::iterator itr = windows.begin();
> itr != 
> windows.end();
>++itr)
> (*itr)->useCursor(false);
>
> and I seem to be getting this:
>
> Got an X11ErrorHandling call disGpot laany =X11Err0oxr8H270a9n2d8lin g 
> ceavlentl=0 dxispbl7a1y3=00200x8270
> 928 event=0xbfffcc60
> Xlib: sequence lost (0x10034 > 0x35) in reply type 0x0!
> Xlib: charsets ISO8859-1:GL and ISO8859-1:GL have the same CT sequence
> Xlib: charsets ISO8859-10:GR and ISO8859-10:GR have the same CT sequence
> Xlib: charsets ISO8859-15:GR and ISO8859-15:GR have the same CT sequence
> Xlib: charsets GB2312.1980-0:GL and GB2312.1980-0:GL have the same CT sequence
> Xlib: charsets JISX0212.1990-0:GL and JISX0212.1990-0:GL have the same CT 
> sequence
> Xlib: charsets KSC5601.1987-0:GR and KSC5601.1987-0:GR have the same CT 
> sequence
> Xlib: charsets CNS11643.1986-2:GL and CNS11643.1986-2:GL have the same CT 
> sequence
> Xlib: charsets CNS11643.1992-3:GR and CNS11643.1992-3:GR have the same CT 
> sequence
> Xlib: charsets CNS11643.1992-5:GL and CNS11643.1992-5:GL have the same CT 
> sequence
> Xlib: charsets CNS11643.1992-7:GL and CNS11643.1992-7:GL have the same CT 
> sequence
> Xlib: charsets BIG5-0:GLGR and BIG5-0:GLGR have the same CT sequence
> Xlib: charsets BIG5-E1:GL and BIG5-E1:GL have the same CT sequence
> Segmentation fault
>
> I don't seem to have any problems with osgcatch which seems to do the same 
> thing, but I am "newing" an osgViewer.  Any ideas what might be causing this? 
>  I'm using OSG 2.6.  I do play with processor affinity/shielding, but turning 
> this off doesn't seem to help.
>
> Paul P.
>
>
>
> ___
> 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] Problems integrating MFC example with existing application

2008-10-01 Thread Robert Osfield
Hi Jesper,

I'm not a windows developer so can't help with MFC specific issues,
but I'll try to comment on the OSG specific questions:

On Tue, Sep 30, 2008 at 3:32 PM, Jesper D. Thomsen <[EMAIL PROTECTED]> wrote:
> When debugging the application I noticed that the
> viewer-view-_slaves-[0]-_projectionOffset-_mat-[0]...[3]-[0] values change
> from their initialisation from "addslave" to "-1.#IND000" right
> after i dispatch the rendering thread. This off course causes further
> problems in frame() with other values going bad.

I couldn't really understand what you meant by
"viewer-view-_slaves-[0]-_projectionOffset-_mat-[0]...[3]-[0] values",
if I'm confused then no doubt others will be confused too.

> My question is whether OSG could be doing this, or if it must be the
> original application writing somewhere it shouldn't? Or does OSG use som
> standard OpenGL variables which might be overwritten by the existing
> application?

OpenGL doesn't really have variables in the sense that a conventioanl
API would have, it's a state machine, where you pass data and tokens
into queue, and then very occasionally get data back, but this get
operation typically requires a round trip to the graphics card.

Given this context we aren't talking about variable, but OpenGL state,
which leads us on the to question are you setting any OpenGL state in
your application on the context that you are letting the OSG create
within your MFC window?  If you don't then the OSG will have complete
control over state and shouldn't have any issues, if you do change
OpenGL state on the context prior to the viewer frame() being called
then you could screw up rendering as the OSG's lazy state updating
mechanism won't know to correct state changes that you've made unless
you tell it.

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


Re: [osg-users] [resolved] frame control and callback

2008-10-01 Thread Robert Osfield
Hi Matthieu,

SingleThreaded is not necessarily more "safe" than multi-threaded,
both are perfectly safe if you don't abuse the constraints relating to
threading model you are using.  SingleThreaded has the fewest
constraints so you can often get away with usage models that really
aren't good practice.  There has been a lot written on threading on
the osg-users mailing list so please go search the archives.

Robert.

On Tue, Sep 30, 2008 at 4:17 PM, Matthieu DIRRENBERGER
<[EMAIL PROTECTED]> wrote:
> Hi Wojtek,
>
>
>
> Thanks a lot, it's work ;-)
>
> It was that, one thread more safe, than multi-thread to takes shots frame
> per frame…
>
> That little point should be explain in the user documentation, but it is a
> known problem in graphic programming.
>
> I just forgot that…
>
>
>
> Cheers,
>
>
>
> Matthieu
>
>
>
>
>
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] De la part de Wojciech
> Lewandowski
> Envoyé : mardi 30 septembre 2008 16:27
> À : OpenSceneGraph Users
> Objet : Re: [osg-users] frame control and callback
>
>
>
> Hi Matthieu,
>
>
>
> Try using --SingleThreded mode with your viewer. I once tried to do similar
> thing. Although in my case I was dumping color buffer.But very often I was
> reading wrong portion of the whole range. It turned out that default
> multithreading of OSG was runnig two frames concurently and one snapshot was
> overrriding the other.
>
>
>
> Attached you will find an code excerpt from my app. It was used to dump
> pseudo aerial photographs for some airport objects. We used these images
> later for paged terrain.
>
>
>
> Code may not compile because I removed few specific parts. But main
> rendering loops are untouched you may use them as template for your code.
>
>
>
> Cheers,
>
> Wojtek
>
>
>
> .
>
> - Original Message -
>
> From: Matthieu DIRRENBERGER
>
> To: osg-users@lists.openscenegraph.org
>
> Sent: Tuesday, September 30, 2008 3:57 PM
>
> Subject: [osg-users] frame control and callback
>
>
>
> Hello OSG users,
>
>
>
> I am a new on OSG and I have some difficulties to finish an application.
>
> I am trying to do an application which computes pre-calculated height-maps
> from a scene.
>
> Simply, I make a "draughtboard" from the scene; and a camera takes shots
> from Z-buffer for each square looking downward.
>
> I have done a callback function to get z-buffer and convert it to my
> convenience, but I can't control the execution of that callback function…
>
>
>
> struct MyCameraPostDrawCallback : public osg::Camera::DrawCallback
>
> {
>
>   MyCameraPostDrawCallback(osg::Image* image, osg::Image* cimage,
> osg::Texture2D* t): _image(image), _cimage(cimage), _cTex(t)
>
> {
>
> }
>
> virtual void operator () (const osg::Camera& /*camera*/) const
>
> {
>
> …code…
>
>
>
> I use this function to init the callback in the camera settings:
> camera->setPostDrawCallback(new MyCameraPostDrawCallback(test.get(),
> zImage.get(), tex.get()));
>
>
>
> After that, I use loops to modify camera positions and take my shots (I make
> a code based on the example from OSG user guide using viewer->frame().
>
>
>
> for(x=0;x
>   {
>
> yd=-TEXT_SIZE/2;
>
> yf = yd+TEXT_SIZE;
>
>
>
> for(y=0;y
> {
>
>
> camera->setClearColor(osg::Vec4(0.1f,0.3f,0.3f,1.0f));//init buffer de
> couleur
>
>   camera->setClearMask(GL_COLOR_BUFFER_BIT |
> GL_DEPTH_BUFFER_BIT);//init Z-buffer
>
>
> camera->setProjectionMatrixAsOrtho(xd,xf,yd,yf,0.1,TEXT_SIZE);
>
>
>
>   viewer->frame();
>
>
>
>   if(y
>   {
>
> yd=yf;
>
> yf=yf+TEXT_SIZE;
>
>   }
>
> }
>
> if(x
> {
>
>   xd=xf;
>
>   xf=xf+TEXT_SIZE;
>
> }
>
>   }
>
>
>
> The problem is to takes a shot using the callback function for each frame
> with the new camera position.
>
> I thought that draw a frame should calls the Camera::DrawCallBack function,
> but it doesn't…
>
> I always get the last square from the loops in my images buffer (at each
> position).
>
> In fact the callback function is called after the loops in spite of
> viewer->frame().
>
>
>
> Can you help me? I am not sure to use the right method…
>
>
>
> Thanks
>
>
>
> Matthieu DIRRENBERGER
>
> 
>
> ___
> 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