[osg-users] Segmentation fault -- resizeGLObjectBuffers

2012-07-04 Thread Martin Großer
Hello,

I want to render a Group in a pre render step and my camera is a child of this 
group. So I created a loop (maybe it is a little bit dirty).

Group -- Camera (pre-render) --
  ^|
  ||


When I want to run my application, I got this error:


[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib64/libthread_db.so.1.

Program received signal SIGSEGV, Segmentation fault.
0x0030215bcdd3 in osg::Node::resizeGLObjectBuffers(unsigned int) () from 
/usr/lib64/libosg.so.80



Is the loop the problem? Was that to be expected? Or is this maybe a untested 
situation?

Thanks

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


Re: [osg-users] Tree Rendering system based on OpenSceneGraph

2012-07-04 Thread Vincent Bourdier
Hi,

I'm interested in procedural generation, more precisely in L-Systems (base 
system of fractals).
I'd be interested to work on something like tree generation.

I also have some LOD / pagedLOD experiences.

Does this project is a personal one ? something industrial ?

Regards,
Vincent

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





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


[osg-users] [3rdparty] How to creat a simple rugby ball model in osg

2012-07-04 Thread simon
Hi,

I am the beginer of open scene graph, beacause I only want to simulate the 
parabolic traject of a rugby ball, I do not want to spend many time to learn 
this complex library. Can some one tell me the most simple way to creat a model 
of ellipsoid to represent the rugby ball. Thank you very much. 


Thank you!

Cheers,
simon

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





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


Re: [osg-users] [vpb] model placing using osgdem

2012-07-04 Thread Sevket Caba
Hi,

Earth file is like as follow:

Code:

map name=osgearth_vpb type=geocentric version=2
image name=elevation driver=vpb
urlelevation.osgb/url  
profileglobal-geocentric/profile
primary_split_level5/primary_split_level
secondary_split_level11/secondary_split_level
/image
image name=map driver=vpb
urlmap.osgb/url  
profileglobal-geocentric/profile
primary_split_level5/primary_split_level
secondary_split_level11/secondary_split_level
/image
/map





you can add this into your osg application as:


Code:

osg::ref_ptrosg::Node _map = osgDB::readNodeFile( earthFile.toStdString() );
osg::ref_ptrosgEarth::MapNode _mapNode = osgEarth::MapNode::findMapNode( 
_map );
_root-addChild(_mapNode);




But you will have some trouble with vpbmaster, just use osgdem and forget about 
the split levels about :)

And about to add some model in the virtual world, you can use 
osgEarthUtil/ObjectPlacer, an easy way of place sthg in the earth model.

if you want to know more about the .earth file just visit http:// www. osgearth 
.org/wiki/MapElement

Good Luck!

Sevket

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





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


Re: [osg-users] [vpb] osgdem crashes because of large memory usage

2012-07-04 Thread Sevket Caba
Hi,

I've a problem with osgdem.exe, which was built with OSG 3.0.0 with visual 
studio 2008 32 bit.

here are the arguments i use :
osgdem --TERRAIN --geocentric -e -180 -90 360 180 -o layout.osgb -t c:\maps

c:\maps folder includes app. 13.000 .tif files and every single .tif file is 
2048x1024 px RGB GeoTIFF.

first when i tried to use osgdem.exe, it crashed before even creating the 
layout_root_l0_x0_y0 folder, then i realized that it uses more than 2.00 GB of 
ram and crashes. So i made a trick and used editbin tool and changed the 
header of the osgdem.exe file with /LARGEADDRESSAWARE flag.

Glad that now my osgdem.exe file can use up to 4.00 GB of RAM, but, 
unfortunately that's not enough as well, so it crashes again, but this time it 
could create some of layout_L13_Xx_Yx_subtile.osgb files.

So, what do you suggest? Is it OK that osgdem.exe should use that much RAM? Do 
i have to build it in x64 platform to let it exploit all 8.00 GB of my RAM?




Thank you!

Cheers,
sevketcaba

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





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


Re: [osg-users] Tree Rendering system based on OpenSceneGraph

2012-07-04 Thread Umid Shahmaliyev
Hi Vincent,

I looked and analysed some articles about generation procedural trees. I 
prefer this article. This is easy to implement and gives more realistic results.

About project this is personal and will be open source. For everyone who uses 
OSG in their projects. 

If you have some ideas or work together on it please contact me.
... 

Thank you!

Best Regards,
Umid

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





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


Re: [osg-users] RenderBin implementation not found

2012-07-04 Thread Matthias Schütze
Hi there,

 A customer is having trouble running our OSG-based application on his 
 computer. I sent him osgviewer.exe and when he runs osgviewer.exe cow.osg 
 it works, but this message is printed on the console: Warning: RenderBin 
 RenderBin implementation not found, using default RenderBin as a fallback.

 It's just a warning and he does see the cow, but I'm wondering if this 
 message is a symptom of some other problem? FWIW, his workstation-class 
 laptop has a FirePro m8900 video card with up to date drivers.

Some month ago, this post appeared on the forum and was not yet
finally solved. I found that forum thread because I experienced very
similar problems:
- sporadical Warning: RenderBin RenderBin implementation not found,
using default RenderBin as a fallback
- even more sporadical Warning: RenderBin DepthSortedBin
implementation not found, using default RenderBin as a fallback
- the problem occurs, when setting up some scene data for several
views on program start
- most likely, the problem occurs only with multi-threaded threading
models (furthermore, I could observe concurrent initialization of
static RenderBinPrototypeList while debugging)

Roberts suggestion was:

 This suggests a race condition on the static initialization inside the static 
 RenderBinPrototypeList* renderBinPrototypeList() method. On technique we 
 could employ is to use a local static initializer object that forces the 
 static initialization:

 struct ForceRenderBinProtypeListInitializer
 {
 ForceRenderBinProtypeListInitializer()
 {
 OSG_NOTICEForcing initializationstd::endl;
 renderBinPrototypeList();
 }
 };

 static ForceRenderBinProtypeListInitializer
 s_ForceRenderBinProtypeListInitializer;

 This is a bit hacky, but it might work. The alternative would be to add a 
 static mutex and use this with the renderBinPrototypeList() but this would 
 have it's usage slower just because of initialization which isn't a good 
 solution. I've attached a modified version of RenderBin.cpp from svn/trunk, 
 could you try this out on your system to see if cures the warning?

After recompiling my OSG 3.0.1 with this change, I tried it out on a
couple of Win 7 x64 machines where the problem occurred from time to
time. Well, the warnings did not show up in about 500 runs per system.
As I stated in the web repository of svn trunk, this change was not
committed yet. Maybe, one could submit it, now?

Cheers,
Matthias Schütze, Germany
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Issue adding transparency to a simple model

2012-07-04 Thread Sergey Polischuk
Hi,

If you can get by with rendering only first layer of transparency, or rendering 
all layers without respect to ordering (f.e. when all layers have low alpha 
values and/or close color values):
for 1st case - you can draw your model first only to depth buffer, then 2nd 
time only to color buffer with depth test set to EQUAL
for 2nd - you draw you model first only to color buffer, then only to depth 
buffer

Cheers,
Sergey.

04.07.2012, 00:06, Preet prismatic.proj...@gmail.com:
 Hi.

 I have a simple model I wanted to apply transparency to. I load the
 model data into a geometry node, and set my scene up. To get a
 transparent effect, I apply an alpha value to gl_FragColor in my
 fragment shader.

 The shaders are trivial:
 Vertex:
 void main()
 {
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
 }

 Fragment:
 void main()
 {
    gl_FragColor = vec4(1,0,0,0.5);
 }

 I get a strange output that sort of works, but renders a different
 result based on the camera position. It's hard to describe so I
 attached a short youtube clip. It seems like certain triangles are
 only rendered at certain camera angles.

 http://youtu.be/fQUFSff-uuU

 I played around with some of the settings I thought might be relevant
 but I still get the effect that the video shows.

 osg::StateSet *ss = geodeMesh-getOrCreateStateSet();
 ss-setAttributeAndModes(shProgram,osg::StateAttribute::ON);
 ss-setMode(GL_BLEND,osg::StateAttribute::ON);

   // options i tried changing around
 //    ss-setMode(GL_DEPTH_TEST,osg::StateAttribute::ON);
 //    ss-setMode(GL_DEPTH_WRITEMASK,osg::StateAttribute::OFF);
 //    ss-setMode(GL_CULL_FACE,osg::StateAttribute::OFF);
 //    ss-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

 Any advice would be appreciated.
 ___
 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] Render depth into texture with 32 bits

2012-07-04 Thread Martin Großer
Hello,

how many bits are used by the GL_DEPTH_COMPONENT? I want to render the depth 
buffer value into a texture and use the internal texture format 
GL_DEPTH_COMPONENT. I would like use 24 or 32 bits for this value so I try 
GL_DEPTH_COMPONENT24 and GL_DEPTH_COMPONENT32 as internal format, but the 
rendering doesn't work. Only the GL_DEPTH_COMPONENT works, but I don't know how 
many bits are used. Is the number of bits depending on the Z-Buffer? My 
Z-Buffer use 24 bits.

Following the error message of GL_DEPTH_COMPONENT24:
-
Using host libthread_db library /lib64/libthread_db.so.1.
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
Warning: FrameBufferObject: could not create the FBO
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
Warning: FrameBufferObject: could not create the FBO
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
FRAGMENT glCompileShader  FAILED
FRAGMENT glCompileShader  FAILED
glLinkProgram  FAILED

Cheers

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


Re: [osg-users] Render depth into texture with 32 bits

2012-07-04 Thread Sergey Polischuk
Hi, Martin

try this:

texture2D-setSourceFormat(GL_DEPTH_COMPONENT);
texture2D-setInternalFormat(GL_DEPTH_COMPONENT32);
texture2D-setSourceType(GL_UNSIGNED_INT);

Cheers,
Sergey.

04.07.2012, 14:06, Martin Groer grosser.mar...@gmx.de:
 Hello,

 how many bits are used by the GL_DEPTH_COMPONENT? I want to render the depth 
 buffer value into a texture and use the internal texture format 
 GL_DEPTH_COMPONENT. I would like use 24 or 32 bits for this value so I try 
 GL_DEPTH_COMPONENT24 and GL_DEPTH_COMPONENT32 as internal format, but the 
 rendering doesn't work. Only the GL_DEPTH_COMPONENT works, but I don't know 
 how many bits are used. Is the number of bits depending on the Z-Buffer? My 
 Z-Buffer use 24 bits.

 Following the error message of GL_DEPTH_COMPONENT24:
 -
 Using host libthread_db library /lib64/libthread_db.so.1.
 RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
 Warning: FrameBufferObject: could not create the FBO
 RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
 Warning: FrameBufferObject: could not create the FBO
 RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
 FRAGMENT glCompileShader  FAILED
 FRAGMENT glCompileShader  FAILED
 glLinkProgram  FAILED

 Cheers

 Martin
 ___
 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] Render depth into texture with 32 bits

2012-07-04 Thread Martin Großer
Hello Sergey,

thanks, it works! :-)

Should I change the number of depth buffer bits? GL_DEPTH_BITS is 24, so I 
think it doesn't make sense to save this into 32 bit. Or is this independent if 
the GL_DEPTH_BITS?

Cheers

Martin


 Original-Nachricht 
 Datum: Wed, 04 Jul 2012 14:13:11 +0400
 Von: Sergey Polischuk pol...@yandex.ru
 An: OpenSceneGraph Users osg-users@lists.openscenegraph.org
 Betreff: Re: [osg-users] Render depth into texture with 32 bits

 Hi, Martin
 
 try this:
 
 texture2D-setSourceFormat(GL_DEPTH_COMPONENT);
 texture2D-setInternalFormat(GL_DEPTH_COMPONENT32);
 texture2D-setSourceType(GL_UNSIGNED_INT);
 
 Cheers,
 Sergey.
 
 04.07.2012, 14:06, Martin Groer grosser.mar...@gmx.de:
  Hello,
 
  how many bits are used by the GL_DEPTH_COMPONENT? I want to render the
 depth buffer value into a texture and use the internal texture format
 GL_DEPTH_COMPONENT. I would like use 24 or 32 bits for this value so I try
 GL_DEPTH_COMPONENT24 and GL_DEPTH_COMPONENT32 as internal format, but the
 rendering doesn't work. Only the GL_DEPTH_COMPONENT works, but I don't know 
 how
 many bits are used. Is the number of bits depending on the Z-Buffer? My
 Z-Buffer use 24 bits.
 
  Following the error message of GL_DEPTH_COMPONENT24:
  -
  Using host libthread_db library /lib64/libthread_db.so.1.
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
  Warning: FrameBufferObject: could not create the FBO
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
  Warning: FrameBufferObject: could not create the FBO
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
  FRAGMENT glCompileShader  FAILED
  FRAGMENT glCompileShader  FAILED
  glLinkProgram  FAILED
 
  Cheers
 
  Martin
  ___
  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] Render depth into texture with 32 bits

2012-07-04 Thread Sergey Polischuk
Hi

I think if you render to fbo bit depth depends of internal texture format, in 
case of rendering to framebuffer idk.

Cheers.

04.07.2012, 14:30, Martin Groer grosser.mar...@gmx.de:
 Hello Sergey,

 thanks, it works! :-)

 Should I change the number of depth buffer bits? GL_DEPTH_BITS is 24, so I 
 think it doesn't make sense to save this into 32 bit. Or is this independent 
 if the GL_DEPTH_BITS?

 Cheers

 Martin

  Original-Nachricht 

  Datum: Wed, 04 Jul 2012 14:13:11 +0400
  Von: Sergey Polischuk pol...@yandex.ru
  An: OpenSceneGraph Users osg-users@lists.openscenegraph.org
  Betreff: Re: [osg-users] Render depth into texture with 32 bits
  Hi, Martin

  try this:

  texture2D-setSourceFormat(GL_DEPTH_COMPONENT);
  texture2D-setInternalFormat(GL_DEPTH_COMPONENT32);
  texture2D-setSourceType(GL_UNSIGNED_INT);

  Cheers,
  Sergey.

  04.07.2012, 14:06, Martin Groer grosser.mar...@gmx.de:
  Hello,

  how many bits are used by the GL_DEPTH_COMPONENT? I want to render the
  depth buffer value into a texture and use the internal texture format
  GL_DEPTH_COMPONENT. I would like use 24 or 32 bits for this value so I try
  GL_DEPTH_COMPONENT24 and GL_DEPTH_COMPONENT32 as internal format, but the
  rendering doesn't work. Only the GL_DEPTH_COMPONENT works, but I don't know 
 how
  many bits are used. Is the number of bits depending on the Z-Buffer? My
  Z-Buffer use 24 bits.
  Following the error message of GL_DEPTH_COMPONENT24:
  -
  Using host libthread_db library /lib64/libthread_db.so.1.
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
  Warning: FrameBufferObject: could not create the FBO
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
  Warning: FrameBufferObject: could not create the FBO
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
  FRAGMENT glCompileShader  FAILED
  FRAGMENT glCompileShader  FAILED
  glLinkProgram  FAILED

  Cheers

  Martin
  ___
  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] Render depth into texture with 32 bits

2012-07-04 Thread Frederic Bouvier
Hi,

sourceFormat and sourceType are used if you read back the texture in CPU 
memory. To ease my debug in gDebugger, I use sourceType=GL_FLOAT
It doesn't change how the fbo works, but I can read floats between 0 and 1 in 
the debugger.

Regards,
-Fred


- Mail original -
De: Sergey Polischuk pol...@yandex.ru
À: OpenSceneGraph Users osg-users@lists.openscenegraph.org
Envoyé: Mercredi 4 Juillet 2012 12:57:14
Objet: Re: [osg-users] Render depth into texture with 32 bits

Hi

I think if you render to fbo bit depth depends of internal texture format, in 
case of rendering to framebuffer idk.

Cheers.

04.07.2012, 14:30, Martin Groer grosser.mar...@gmx.de:
 Hello Sergey,

 thanks, it works! :-)

 Should I change the number of depth buffer bits? GL_DEPTH_BITS is 24, so I 
 think it doesn't make sense to save this into 32 bit. Or is this independent 
 if the GL_DEPTH_BITS?

 Cheers

 Martin

  Original-Nachricht 

  Datum: Wed, 04 Jul 2012 14:13:11 +0400
  Von: Sergey Polischuk pol...@yandex.ru
  An: OpenSceneGraph Users osg-users@lists.openscenegraph.org
  Betreff: Re: [osg-users] Render depth into texture with 32 bits
  Hi, Martin

  try this:

  texture2D-setSourceFormat(GL_DEPTH_COMPONENT);
  texture2D-setInternalFormat(GL_DEPTH_COMPONENT32);
  texture2D-setSourceType(GL_UNSIGNED_INT);

  Cheers,
  Sergey.

  04.07.2012, 14:06, Martin Groer grosser.mar...@gmx.de:
  Hello,

  how many bits are used by the GL_DEPTH_COMPONENT? I want to render the
  depth buffer value into a texture and use the internal texture format
  GL_DEPTH_COMPONENT. I would like use 24 or 32 bits for this value so I try
  GL_DEPTH_COMPONENT24 and GL_DEPTH_COMPONENT32 as internal format, but the
  rendering doesn't work. Only the GL_DEPTH_COMPONENT works, but I don't know 
 how
  many bits are used. Is the number of bits depending on the Z-Buffer? My
  Z-Buffer use 24 bits.
  Following the error message of GL_DEPTH_COMPONENT24:
  -
  Using host libthread_db library /lib64/libthread_db.so.1.
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
  Warning: FrameBufferObject: could not create the FBO
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
  Warning: FrameBufferObject: could not create the FBO
  RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
  FRAGMENT glCompileShader  FAILED
  FRAGMENT glCompileShader  FAILED
  glLinkProgram  FAILED

  Cheers

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


Re: [osg-users] [3rdparty] How to creat a simple rugby ball model in osg

2012-07-04 Thread Jan Ciger
Hello Simon,

On Tue, Jul 3, 2012 at 2:39 PM, simon simonchen198...@yahoo.fr wrote:

 Hi,

 I am the beginer of open scene graph, beacause I only want to simulate the
 parabolic traject of a rugby ball, I do not want to spend many time to
 learn this complex library. Can some one tell me the most simple way to
 creat a model of ellipsoid to represent the rugby ball. Thank you very much.


Perhaps OSG is not the best tool for the job, then. OSG is a scene graph
library, not a modelling tool or a full 3D environment to simulate stuff
in.

You do not create a ball in OSG, It doesn't have anything like draw me
an ellipsoid/box/sphere ... However, it can draw arbitrary meshes.
Typically you would make a ball model in something like Blender, 3DS Max or
Maya and export the mesh in some format that OSG can read, either the
native .osg or some other (.obj, COLLADA, .3ds, etc.).

I suggest that you have a look at some of the tutorials if you want to use
OSG for your task - they show how to load models and interact with them.

Regards,

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


Re: [osg-users] [3rdparty] How to creat a simple rugby ball model in osg

2012-07-04 Thread Sergey Kurdakov
Hi Simon.

Can some one tell me the most simple way to creat a model of ellipsoid to
represent the rugby ball.

you might want to find something like a ready 3D model,
say searching in google rugby ball  model blender would produce something
like http://www.blendswap.com/blends/misc-objects/rugby-ball/ and some more

then, when you grab both blender and a model, you might export this from
blender either using osg export plugin  or as 3ds or obj file

then the only thing would be to load the model as a Node.

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


Re: [osg-users] constant size overlay

2012-07-04 Thread Michael Schanne
Thanks!

My other mistake was using DECAL instead of REPLACE in my TexEnv.  I didn't 
realize DECAL was keeping the point's original alpha, which made the entire 
point sprite transparent, not just the X.

I still don't quite have the visual effect I want yet.  When the X's are close 
enough to overlap, the topmost ones appear to be cutting a gap or casting a 
shadow on the X's beneath, even though alpha is 0 for every black texel (see 
attachment ps.jpg).  I'd like to just have the white overlap (as in attachment 
at.jpg, from my AutoTransform implementation).  Is there anything I can do to 
fix it?  

... 

Thank you!

Cheers,
Michael

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




Attachments: 
http://forum.openscenegraph.org//files/at_303.jpg
http://forum.openscenegraph.org//files/ps_140.jpg


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


Re: [osg-users] constant size overlay

2012-07-04 Thread Martin Scheffler
maybe you can use alpha to coverage? It's another state attribute you can set, 
maybe you can google that
It only works if you have antialiasing enabled. 

Cheers,
Martin

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





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


Re: [osg-users] [forum] How to acquire the current location information of a drawable object? And how to calculate the distance between an object and the viewpoint?

2012-07-04 Thread WangWentao


在 2012-7-2,22:48,Fan ZHANG oceane...@gmail.com 写道:

 Hi all,
 
 I'm quite new to OSG and have no OPENGL background.
 
 I want to know how to acquire the current location information of a drawable 
 object?
 Actually the initial position of the geometry is set by me. But when I move 
 the objects with mouse, the spatial information changes, right? So I want to 
 acquire such information.
 
the world coordinate of a drawable is determined by scene graph. So it's world 
coordinate never change before you change the scene graph, logically.

What you see after mouse action is probably controlled by view matrix and 
projection matrix. The pipeline looks like: object coordinate -- world 
coordinate -- eye coordinate -- device coordinate -- window coordinate. View 
matrix affects the eye coordinate and projection matrix affects the device 
coordinate. Mouse action will change the two matrixes.
 
osg::Camera maintains these matrixes.

 For the second question, how to calculate the distance between an object and 
 the viewpoint? Because I want to differentiate the 'stateset' when objects 
 are far away from the viewpoint and when they are close to the camera. And I 
 don't even know where the camera viewpoint is!
 
viewpoint can be accessed in CullVisitor, so you should get it in cull 
traversal, by defining a cull callback and adding it to a Node.

 Regards and thank you!
 
 Cheers,
 Fan
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=48628#48628
 
 
 
 
 
 ___
 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] Ho to change slave cameras offset matrix later on?

2012-07-04 Thread WangWentao
osg::View::getSlave(index)
Get slave and do everything you want, Viewer will update their matrixs each 
frame.



在 2012-7-1,22:03,Torben Dannhauer tor...@dannhauer.info 写道:

 Hi,
 I would like to change a slave cameras viewOffset and projectionOffset matrix 
 _after_ I added the camera via viewer-addSlavecamera(camera, 
 viewoffset,projOffset).
 
 Is there a interface to set the offsets later on? I haven't found anything.
 
 What would you recommend to achieve the desired functionality?
 Maybe I should add some functions to allow later changes and submit it to 
 Robert.
 
 Thank you!
 
 Cheers,
 Torben
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=48621#48621
 
 
 
 
 
 ___
 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] Clipping planes for slave camera

2012-07-04 Thread WangWentao
Slave camera relies on main camera matrix and matrix offset, so it's 
meaningless to set their matrix. By contrast, view camera is independent of 
other view.



在 2011-9-27,23:05,He, Yefei yefei...@uiowa.edu 写道:

 Thanks, Robert, I'll take a look at the examples. Another question: in a 
 composite viewer, if I set the view and projection matrices directly on the 
 slave camera, what are the internal differences between doing this and simply 
 creating another view and setting the view and projection matrices of its 
 camera? I'm trying to set up a composite viewer with multiple views of the 
 same scenegraph. I noticed that the main view (the first view added to the 
 composite viewer) and its slave cameras all render properly, but in the 
 contents of the other views, the depth sorting is incorrect, most noticeably 
 the skydome obscures a lot of faces that should be in front of the skydome.
 
 Yefei 
 
 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert 
 Osfield
 Sent: Tuesday, September 27, 2011 3:16 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Clipping planes for slave camera
 
 Hi Yefei,
 
 On Mon, Sep 26, 2011 at 9:20 PM, He, Yefei yefei...@uiowa.edu wrote:
 Is it possible for a slave camera to have different near and far 
 clipping planes from the master camera? Are there examples for it? I 
 figure it will be more complicated than changing the angle of view or 
 adding a shear to the view frustum.
 
 You have assign different projection matrices to the slave camera either by 
 setting the projection offset matrix for the slave and keeping the slave 
 Camera's ReferenceFrame set to RELATIVE_RF (relative the master Camera) or by 
 setting the view and projection matrices directly on the slave Camera and 
 setting the ReferenceFrame to ABSOLUTE_RF.
 
 There isn't a specific example that illustrates what you want but the osghud 
 and osgdistortion examples should give you an idea of the different things 
 you can.
 
 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgText not working with programmable pipeline?

2012-07-04 Thread Preet
I compiled OSG against OpenGL 3 and disabled all the fixed function
stuff, and I can do basic things like build up geometry, apply shaders
and so on. Trying to draw text using osgText doesn't work out so well
though. I'm not sure what's going on... but basically the output looks
like font character quads, just not textured correctly (wild guess).
Here's a screenshot from the results of running osgtext in the example
folder: http://i.imgur.com/NX6dv.png?1

Do I need to specify my own shader for the text geode I create? If so,
are there any examples on how to do this?

Also here's the debug output for a minimal osg text example (just
create some text, attach it to a geode, and render the scene):
http://pastie.org/4200461

I see ShaderComposer is called but I don't know if it's doing
anything. Also this line doesn't seem right: Glyph::subload():
texture sub-image width and/or height of 0, ignoring operation. I'd
appreciate any advice.


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


Re: [osg-users] osgText not working with programmable pipeline?

2012-07-04 Thread Preet
After some trial and error, osgText renders fine when explicitly
setting up shaders. Here's a bare minimum working example in case
anyone else runs into this.

Scene Graph:

// text geometry
std::string textStr(Hello World);
osg::ref_ptrosgText::Text myText = new osgText::Text;
myText-setFont(DroidSans-Bold.ttf);
myText-setCharacterSize(20.0f);
myText-setText(textStr);

// text node
osg::ref_ptrosg::Geode textGeode = new osg::Geode;
textGeode-addDrawable(myText);

// text shaders
osg::ref_ptrosg::Program shProgram = new osg::Program;
shProgram-setName(TextShader);

std::string vShader = std::string(#version 120\n) +
readFileAsString(vertexshader.glsl);
shProgram-addShader(new osg::Shader(osg::Shader::VERTEX,vShader));

std::string fShader = std::string(#version 120\n) +
readFileAsString(fragmentshader.glsl);
shProgram-addShader(new osg::Shader(osg::Shader::FRAGMENT,fShader));

osg::ref_ptrosg::Uniform textColor = new
osg::Uniform(MaterialColor,osg::Vec4(0,1,1,1));
osg::ref_ptrosg::Uniform textTexture = new osg::Uniform(GlyphTexture,0);

osg::StateSet *ss = textGeode-getOrCreateStateSet();
ss-addUniform(textColor);
ss-addUniform(textTexture);
ss-setAttributeAndModes(shProgram,osg::StateAttribute::ON);

osg::ref_ptrosg::Group nodeRoot = new osg::Group;
nodeRoot-addChild(textGeode);


Vertex Shader:
#version 120

varying mediump vec4 VertexColor;
varying mediump vec2 TexCoord0;

uniform vec4 MaterialColor;

void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
VertexColor = MaterialColor;
TexCoord0 = gl_MultiTexCoord0.xy;
}


Fragment Shader:

varying vec4 VertexColor;
varying vec2 TexCoord0;

// set to zero by default
uniform sampler2D GlyphTexture;

void main()
{
gl_FragColor = VertexColor * texture2D(GlyphTexture,TexCoord0).;
}


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


Re: [osg-users] Issue adding transparency to a simple model

2012-07-04 Thread Preet
Thanks Paul and Sergey

I'll try both methods.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Using osgText with GraphicsWindowEmbedded and Qt causes problems

2012-07-04 Thread Preet
Hi.

I have a scene consisting of just an osgText object and its shaders.
The scene works fine in a default application where OpenSceneGraph is
the only library being used, but won't render correctly when I try to
draw to a QGLFrameBufferObject. Drawing to the FBO works fine if I
don't use osgText (other than text, I've just tried simple models so
far).

Using osgText 'messes' the Qt UI up, by changing the order of what (Qt
items) are painted or changing their size or stretching them...
nothing from OSG seems to be painted at all.

I'm guessing there's a conflict with OpenGL calls between Qt and OSG.
OSG is set up using GraphicsWindowEmbedded, and in Qt, I bind my
framebuffer before calling osgViewer's frame(), and release it after.
I'm lost as to why using osgText of all things would cause this issue.
Just the inclusion of osgText in my scene tree causes the problem.
Does anyone have any suggestions as to how I can force Qt and OSG to
play nice?


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


Re: [osg-users] Ho to change slave cameras offset matrix later on?

2012-07-04 Thread Torben Dannhauer
Hi,

If the slave is set to RELATIVE_RF (default), then the slaves view matrix and 
projectionmatrix is overwritten each frame by multiplying the min camera matrix 
with the slaves offset matrix.

Therefor I do not want to change to slaves matrix but the slaves offset matrix.

It seems I have to write and submit a setter funcion which allows later changes 
of the offset matrices..

Thanks,
Torben

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





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