[osg-users] Synchronize animations between different computers

2014-06-17 Thread Harald Müller
Hi,
Currently I am playing around with distributed rendering, for that I need to 
synchronize Animations between 2 or more computers. 
So the easiest way to achieve that is to synchronize animations with a server 
time. E.g. if the servers says it is time X, I set the animation on each 
computer to time X. 
My first thought was to use the addUpdateCallback and set in the 
operator()(osg::Node* node, osg::NodeVisitor* nv) method the animation time, 
but there is no setAnimationTime(…)
After that I was trying with setTimeOffset(…) but this didn’t work too. 
Now I am out of guesses 
Thank you for any help! 

Cheers,
Harald

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





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


[osg-users] Texture unit management

2014-06-17 Thread Harald Scheirich
(Don't know how this originally got into 'Submissions' sorry) 

Hi, 
my name is Harald Scheirich and I am one of the enigneers on the open source 
OpenSurgSim project (Can't post the link due to Forum restrictions 
www-opensurgsim-org). We are currently using OSG as a rendering layer. 

I am currently in the process to try and extend our shading system with better 
shaders, but I have run into a snag with textures used in renderpasses (e.g 
light depth map for shadowing) conflicting with 'local' textures e.g. diffuse 
color texture assigned to objects. We currently don't manage texture units for 
the passes and I was wondering what methods people use to prevent the assigned 
units from clashing ? 

I can see just 'manually' assigning ranges of available units to geometry and 
not encroaching on those when running a render pass. Another one would be to 
use materials that are separate from the geometry so the geometry can be 
rendered without textures ? Am I missing anything ? 

Is there a way to prevent the binding of textures in lower levels of the tree ? 
I did try to just setting the texturing mode to OFF, but that does not seem to 
prevent texture binding from happening which is what is causing the problem in 
the first place. Is there a way to do this just by a correct combination of 
TextureMode, TextureAtttributeAndModes ? 

I'd be happy to provide more information if needed 
... 


Thank you! 

Cheers, 
Harald

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





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


[osg-users] Synchronize animations between different computers

2014-06-17 Thread Harald Müller
Hi,
Currently I am playing around with distributed rendering, for that I need to 
synchronize Animations between 2 or more computers. 

So the easiest way to achieve that is to synchronize animations with a server 
time. E.g. if the servers says it is time X, I set the animation on each 
computer to time X. 
My first thought was to use the addUpdateCallback and set in the 
operator()(osg::Node* node, osg::NodeVisitor* nv) method the animation time, 
but there is no setAnimationTime(…)
After that I was trying with setTimeOffset(…) but this didn’t work. 
Now I am out of guesses :( 

Thank you for any help! 

Cheers,
Harald

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





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


[osg-users] [osgPlugins] A problem in rendering the exported file?

2014-06-17 Thread Jaeha Kim
Hi,

I'm a newbie in OpenSceneGraph, I'm glad to meet you :D

I made some mechanical parts by using SolidWorks and exported the parts with 
*.STL format, and then, I converted them to *.OSG (or *.OBJ, *.DXF whatever) by 
using osgConv command.

When trying to display the exported and converted files by using osgViewer, I 
have a problem in rendering them; although they are successfully rendered in 
other programs such as Blender and MeshLab, the displayed result looks somewhat 
strange in osgViewer.

(I attached three screen captures)

Could you explain why this happens and how to solve this problem, please?

Thank you!

Cheers,
Jaeha

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




Attachments: 
http://forum.openscenegraph.org//files/screencapture_blender_467.png
http://forum.openscenegraph.org//files/screencapture_meshlab_375.png
http://forum.openscenegraph.org//files/screencapture_osgviewer_884.png


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


Re: [osg-users] Shader Problems, AMD is Fine, NVIDIA is not

2014-06-17 Thread Sebastian Messerschmidt

Hi Fitz,



Hi,
seems like it was part of the problem, but not all of it.
Intel HD4400 and my AMD Cards still work fine, but the Quadro 600 is missing 
all light it seems, it s much darker then it shoud be, it seems like not all 
lights are used.
Furthermore, trying to get the shader work on the GTX 660 TI or 670 or 
something from NVIDIA is still not working, or it's messed up. (No Bingo, but 
still false light or all white).
In my experience the NVIDIA drivers are far better than the Intel or AMD 
OpenGL drivers. But I agree, sometimes they seem to silently get strict, 
which can cause some hefty amount of wall banging your head.
Once I cased a bug, having an uninitialized vec3 outside a loop in a 
blur shader, causing similiar artifacts.
The only suggestion I can give you here: try different driver versions, 
check OpenGL errors, step back to a minimal example and debug what is 
causing the error.

Furthermore, the CommandLine is giving constantly:
warning: detected opengl eror 'invalid enumerant' at after 
RenderBin:.draw(...)
Could you attach gDebugger or a similar tool to check what is causing 
the error?



It should maybe maintain, that the working AMDs are running on Windows, while 
the Quadro 600 runs on Linux. But the non-working GTX ones are runnning 
windows, too.
Does anyone have an idea or an suggestion? Or would at least be so kind to 
answer me and tell me, that he has no idea? It is kind of depressing, posting 
questions and never get any answers. Seems not very noob friendly here to me...
Your question is extremely and seems to be rather shader/driver related 
than being an OSG question. People simply don't have that much time to 
dive into a rather open ended topic like this.
Next time it might help to provide a complete compiling example which 
shows the problem, so people might test on different platforms (which 
you didn't mention as far as I see).


Cheers
Sebastian


Thank you!

Cheers,
Fitz

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





___
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] [osgPlugins] A problem in rendering the exported file?

2014-06-17 Thread Alberto Luaces
Jaeha Kim writes:

 Hi,

 I'm a newbie in OpenSceneGraph, I'm glad to meet you :D

 I made some mechanical parts by using SolidWorks and exported the
 parts with *.STL format, and then, I converted them to *.OSG (or
 *.OBJ, *.DXF whatever) by using osgConv command.

 When trying to display the exported and converted files by using
 osgViewer, I have a problem in rendering them; although they are
 successfully rendered in other programs such as Blender and MeshLab,
 the displayed result looks somewhat strange in osgViewer.

 (I attached three screen captures)

 Could you explain why this happens and how to solve this problem,
 please?

Hi Jaeha,

I'd say that the normals are wrong.  You can fix that easily in Blender.

-- 
Alberto

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


Re: [osg-users] Synchronize animations between different computers

2014-06-17 Thread Harald Müller
I also tried to set a FramStamp: 

Code:
void MyCallback::operator()(osg::Node* node, osg::NodeVisitor* nv)
{
...
osg::FrameStamp* fsMod = new osg::FrameStamp();
fsMod-setFrameNumber(10);
fsMod-setReferenceTime(10);
fsMod-setSimulationTime(10);

nv-setFrameStamp(fsMod);
...
}



but this doesn't work, the animation is stuck at the first frame ... 
only if I use a varible instead of the constant 10 something happens: 

Code:
void MyCallback::operator()(osg::Node* node, osg::NodeVisitor* nv)
{
...
osg::FrameStamp* fsMod = new osg::FrameStamp();
fsMod-setFrameNumber(i);
fsMod-setReferenceTime(i);
fsMod-setSimulationTime(i);
i++;
nv-setFrameStamp(fsMod);
...
}


this doesn't make sence to me, why does a special SimulationTime not refer a 
spezial frame at the animation? 

Thanks!

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





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


Re: [osg-users] BUG: osgGA::GUIEventAdapter returns wrong mouse ranges on android

2014-06-17 Thread Robert Osfield
Hi Paul,

The osgGA::GUIEventAdapter has an MouseYOrientation value that
provides information on which way up the Y axis is.  OpenGL has Y
going up, while most UI toolkits have Y going down, to handle this
discrepency osgGA::GUIEventAdapter provides the MouseYOrigentation and
other utilities adapt it to make sure it's in the correct default OSG
orientation which is Y up - consistent with OpenGL.

Robert.

On 17 June 2014 01:48, Paul aquawic...@hotmail.com wrote:
 I can confirm this issue.

 For android I use setUpViewerAsEmbeddedInWindow(0, 0, width, height)
 and then setMouseInputRange(0, 0, width, height). I then send the input via 
 getEventQueue()-mouseButtonPress(x, y, button); The input coordinates from 
 android seem to be correct at this point, although it's flipped on the y 
 axis. Now, when I catch and use the events to use in OSG, the coordinates are 
 off.  Is there an easy fix?

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





 ___
 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] Synchronize animations between different computers

2014-06-17 Thread Robert Osfield
Hi Harald,

The OSG uses an osg::FrameStamp object to provide control over timing
related features, this object has a SimulationTime and ReferenceTime
parameters.  The SimulationTime is the time used by animation codes,
while the ReferenceTime is actual time since the start of viewer's
time stamp was initialized - basically when you started rendering.

By default the osgViewer::Viewer/CompositeViewer will set the
FrameStamp on each new frame and the SimulationTIme and ReferenceTime
will be consistent, but you can provide the viewer.frame() call with
your own time to use for the SimulationTime by unrolling the viewer
main loop to something like:

while(!viewer.done())
{
double mySimulationTime = myGetSimulationTimeFunction();
viewer.frame(mySimulationTime);
}

Robert.

On 15 June 2014 17:59, Harald Müller lacky19102...@yahoo.de wrote:
 Hi,
 Currently I am playing around with distributed rendering, for that I need to 
 synchronize Animations between 2 or more computers.
 So the easiest way to achieve that is to synchronize animations with a server 
 time. E.g. if the servers says it is time X, I set the animation on each 
 computer to time X.
 My first thought was to use the addUpdateCallback and set in the 
 operator()(osg::Node* node, osg::NodeVisitor* nv) method the animation time, 
 but there is no setAnimationTime(...)
 After that I was trying with setTimeOffset(...) but this didn't work too.
 Now I am out of guesses
 Thank you for any help!

 Cheers,
 Harald

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





 ___
 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] [osgPlugins] A problem in rendering the exported file?

2014-06-17 Thread Jaeha Kim

Alberto Luaces wrote:
 
 Hi Jaeha,
 
 I'd say that the normals are wrong.  You can fix that easily in Blender.
 
 -- 
 Alberto
 
 




Dear Alberto:


Thank you for your quick reply.

Your advice did perfectly work for me.


By the way, I still do not understand why fixing normals in Blender did no help 
with *.STL format, but successfully worked with *.3ds...


Anyway, thank you very much! :D

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





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


Re: [osg-users] [osgPlugins] A problem in rendering the exported file?

2014-06-17 Thread Alberto Luaces
Jaeha Kim writes:

 By the way, I still do not understand why fixing normals in Blender
 did no help with *.STL format, but successfully worked with *.3ds...

Glad I could help.  I guess that the STL file did not store normal
information inside, so if the triangles are defined in an inconsistent
manner, later the normals might be computed either facing inside or
outside.

-- 
Alberto

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


[osg-users] Incremental GL compile

2014-06-17 Thread Riccardo Corsi
Hi all,

for a project I'm loading a scene which fits into system memory but most
likely not in video memory.
I prefer to load the whole scene at startup to run some pre-processing on
the scene elements.

What I'm after is then to dynamically precompile/release GL objects at
runtime for different elements of the scene - I want them precompiled
before merging into the visible scene to avoid frame drops.

The way I'm doing it right now is:
- when adding element, I push them into an
osgUtil::IncrementalCompileOperation. When compiled I merge them into the
visible scenegraph
- when removing, I simply detach the nodes

Is this a correct approach?

In particular, is it correct NOT to release explicitly the GL objects when
removing the nodes?
From what I've read in the archives, osg should do it automatically at an
appropriate time...

Other hints are welcome :)
Thanks,
ricky
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Incremental GL compile

2014-06-17 Thread Robert Osfield
HI Ricky,

Your approach sounds correct.  You are correct in that the user
doesn't need to explicitly for the release of GL objects as the OSG
will pass the GL objects across to the OSG's internal object cache to
be release by automatically by the draw thread.  Reuse of GL objects
will also happen automatically for you.

Robert.

On 17 June 2014 11:07, Riccardo Corsi riccardo.co...@kairos3d.it wrote:
 Hi all,

 for a project I'm loading a scene which fits into system memory but most
 likely not in video memory.
 I prefer to load the whole scene at startup to run some pre-processing on
 the scene elements.

 What I'm after is then to dynamically precompile/release GL objects at
 runtime for different elements of the scene - I want them precompiled before
 merging into the visible scene to avoid frame drops.

 The way I'm doing it right now is:
 - when adding element, I push them into an
 osgUtil::IncrementalCompileOperation. When compiled I merge them into the
 visible scenegraph
 - when removing, I simply detach the nodes

 Is this a correct approach?

 In particular, is it correct NOT to release explicitly the GL objects when
 removing the nodes?
 From what I've read in the archives, osg should do it automatically at an
 appropriate time...

 Other hints are welcome :)
 Thanks,
 ricky

 ___
 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] Incremental GL compile

2014-06-17 Thread Riccardo Corsi
Good to know then - my tests so far show a correct and solid behavior.
Thanks Robert,

ricky


On Tue, Jun 17, 2014 at 12:15 PM, Robert Osfield robert.osfi...@gmail.com
wrote:

 HI Ricky,

 Your approach sounds correct.  You are correct in that the user
 doesn't need to explicitly for the release of GL objects as the OSG
 will pass the GL objects across to the OSG's internal object cache to
 be release by automatically by the draw thread.  Reuse of GL objects
 will also happen automatically for you.

 Robert.

 On 17 June 2014 11:07, Riccardo Corsi riccardo.co...@kairos3d.it wrote:
  Hi all,
 
  for a project I'm loading a scene which fits into system memory but most
  likely not in video memory.
  I prefer to load the whole scene at startup to run some pre-processing on
  the scene elements.
 
  What I'm after is then to dynamically precompile/release GL objects at
  runtime for different elements of the scene - I want them precompiled
 before
  merging into the visible scene to avoid frame drops.
 
  The way I'm doing it right now is:
  - when adding element, I push them into an
  osgUtil::IncrementalCompileOperation. When compiled I merge them into the
  visible scenegraph
  - when removing, I simply detach the nodes
 
  Is this a correct approach?
 
  In particular, is it correct NOT to release explicitly the GL objects
 when
  removing the nodes?
  From what I've read in the archives, osg should do it automatically at an
  appropriate time...
 
  Other hints are welcome :)
  Thanks,
  ricky
 
  ___
  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] hello all, find osg is very powerful after learned five months

2014-06-17 Thread LearningOSG LearningOSG
And more osg demos are coming,welcome vist OSG DEMOS SITE
www.osg3d.org
my email:learning...@gmail.com
skype:learning...@hotmail.com
Thanks all.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Changing image in texture2d

2014-06-17 Thread Jaime
Hi,

I have a texture2D, and I want to change its image dynamically. How can I do 
it? 

I tried:

 
 Create()===
 osg::ref_ptrosg::Geode geode = new osg::Geode;
 geode-addDrawable( osg::createTexturedQuadGeometry(osg::Vec3(), 
 osg::Vec3(40.0,0.0,0.0), osg::Vec3(0.0,0.0,40.0)) );
 geode-setDataVariance(osg::Object::DYNAMIC);
 textureLensFlare = new osg::Texture2D;
 textureLensFlare-setImage( im );
 textureLensFlare-setDataVariance(osg::Object::DYNAMIC);
 textureLensFlare-setFilter(osg::Texture::MIN_FILTER, 
 osg::Texture::LINEAR_MIPMAP_LINEAR);
 textureLensFlare-setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
 textureLensFlare-setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP);
 textureLensFlare-setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP);
 geode-getOrCreateStateSet()-setTextureAttributeAndModes(0, 
 textureLensFlare, osg::StateAttribute::ON );
 geode-getOrCreateStateSet()-setDataVariance(osg::Object::DYNAMIC);
 geode-getOrCreateStateSet()-setMode(GL_BLEND, osg::StateAttribute::ON);
 geode-getOrCreateStateSet()-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
 
 Change==
 switch (_iCurrentTexture)
 {
   case 1:
   textureLensFlare-setImage(_im1);
   _im1-dirty();
   break;
 
   case 2:
   textureLensFlare-setImage(_im2);
   _im2-dirty();
   break;
 
   case 3:
   textureLensFlare-setImage(_im3);
   _im3-dirty();
   break;
 }
 textureLensFlare-dirtyTextureObject();
 

But it didn't work. I try with -dirty() , dirtyTextextureObject(), 
-setDaraVariance(osg::Object::DYNAMIC), etc... but no success :(

And another question...What about performance of this method? Approximately, I 
will change texture twice each second. Is this a good solution, Or is there any 
other better?

Thanks!

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





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


Re: [osg-users] hello all, find osg is very powerful after learned five months

2014-06-17 Thread Jaime
Good example! Congratulations!

Are you going to share the code? It would be great!

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





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


Re: [osg-users] hello all, find osg is very powerful after learned five months

2014-06-17 Thread Jaime
Yeah, I mean sharing the source code of your demo.

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





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


Re: [osg-users] hello all, find osg is very powerful after learned five months

2014-06-17 Thread LearningOSG LearningOSG
Hi Jaime,
   Thanks,currently i only know how to make a cool and beautiful osg
demo,and have many questions about osg mechanism,because only learned osg
five months.
   cheers
LearningOSG



2014-06-17 23:21 GMT+08:00 Jaime xatp...@hotmail.com:

 Good example! Congratulations!

 Are you going to share the code? It would be great!

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





 ___
 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] hello all, find osg is very powerful after learned five months

2014-06-17 Thread LearningOSG LearningOSG
Yeah,Have the possibility,if you get the template,then you can also make
such a demo,without write one line osg code,are you familiar with LUA?this
demo is writen using LUA JIT.
only a few keyboard click,then the osg demo comes out,this is the reason i
consider osg is very very powerfull!
cheers
LearningOSG


2014-06-17 23:36 GMT+08:00 Jaime xatp...@hotmail.com:

 Yeah, I mean sharing the source code of your demo.

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





 ___
 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] Synchronize animations between different computers

2014-06-17 Thread Harald Müller
Thanks!

Hmmm I think the SimulationTime and the ReferenceTime doesn't help me do solve 
this problem ... 

What I am searching for is function to jump e.g. to the middle of the 
animation. 


Example: 
- Client A starts animation X
- Client A hast 40% finished of animation X
- Server sends control message that the X should be at 50%
- Client A sets animation X to 50%

compyler had an similar problem: 
http://forum.openscenegraph.org/viewtopic.php?t=10012

But I don't know which class provides this methods and how to use it: 

Code:
animationManager-playAnimation( myAnimation ); 
myAnimation-setStartTime(myAnimation-getStartTime() -3.0); 



I'm building an osg::AnimationPath and simply add it to the addUpdateCallback: 


Code:

transform-addUpdateCallback(new MyCallback(this, buildAnimationPath(), 0.0, 
1));





Thank you!

Cheers,
Harald

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





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


Re: [osg-users] Shader Problems, AMD is Fine, NVIDIA is not

2014-06-17 Thread Fitz Chivalrik
Hi SMesserschmidt,

many thanks for your answer!
It really helps for a newbie like me if he reads the confirmation, that it is 
not related to his OSG Code but to Shader. I was struggling with this a whole 
week and did not know where to look.
I did not initialized the vec4 color var in my method, which could be part of 
the problem. After I did this, it still did not work on every maschine, but in 
some more. What finally was the answer was a piece of false code in the shader, 
which existed there since the beginning and which I overlooked for a whole 
week. Shame on me, I dunno how i did that
Anyway, these two lines were faulty:
color += gl_FrontMaterial.ambient * 
gl_LightSource[lightIndex].ambient[lightIndex]; 
color += gl_BackMaterial.ambient * 
gl_LightSource[lightIndex].ambient[lightIndex]; 
ambient is of course not an array!
I really dunno why my AMD drivers did let that error pass...
Again, many thanks for taking your time to answer me!

Thank you!

Cheers,
Fitz

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





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


Re: [osg-users] Synchronize animations between different computers

2014-06-17 Thread Robert Osfield
Hi Harald,

With a cluster you would dispatch the SimulationTime from the master
to all the slaves so that they use the master's SimulationTime, so if
it's simulation time jumps then so till will the slaves.

Robert.


On 17 June 2014 18:32, Harald Müller lacky19102...@yahoo.de wrote:
 Thanks!

 Hmmm I think the SimulationTime and the ReferenceTime doesn't help me do 
 solve this problem ...

 What I am searching for is function to jump e.g. to the middle of the 
 animation.


 Example:
 - Client A starts animation X
 - Client A hast 40% finished of animation X
 - Server sends control message that the X should be at 50%
 - Client A sets animation X to 50%

 compyler had an similar problem: 
 http://forum.openscenegraph.org/viewtopic.php?t=10012

 But I don't know which class provides this methods and how to use it:

 Code:
 animationManager-playAnimation( myAnimation );
 myAnimation-setStartTime(myAnimation-getStartTime() -3.0);



 I'm building an osg::AnimationPath and simply add it to the addUpdateCallback:


 Code:

 transform-addUpdateCallback(new MyCallback(this, buildAnimationPath(), 0.0, 
 1));





 Thank you!

 Cheers,
 Harald

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





 ___
 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] Synchronize animations between different computers

2014-06-17 Thread Harald Müller
Hi Robert,

of course you're right, but the problem is the SimulationTime has nothing to do 
with the progress of the animation ... :O
So if I start a Client 5 Seconds later, and it gets Server-Time 5000 the 
animation doesn't start at time 5 Sec, it starts from the beginning ... 

To take your example, this gives exactly the same result: 

Code:
mySimulationTime= 0;
while(!viewer.done())
{
viewer.frame(mySimulationTime);
mySimulationTime+=0.01f;
}


as this:

Code:
mySimulationTime= 100;
while(!viewer.done())
{
viewer.frame(mySimulationTime);
mySimulationTime+=0.01f;
}



both start from the beginning.

Thank you!

Cheers,
Harald

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





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


Re: [osg-users] Synchronize animations between different computers

2014-06-17 Thread Trajce Nikolov NICK
Hi Harald,

have a look at the osgcluster example. You can see there syncing of viewers
across machines based on the simulation time

Nick


On Tue, Jun 17, 2014 at 9:22 PM, Harald Müller lacky19102...@yahoo.de
wrote:

 Hi Robert,

 of course you're right, but the problem is the SimulationTime has nothing
 to do with the progress of the animation ... :O
 So if I start a Client 5 Seconds later, and it gets Server-Time 5000 the
 animation doesn't start at time 5 Sec, it starts from the beginning ...

 To take your example, this gives exactly the same result:

 Code:
 mySimulationTime= 0;
 while(!viewer.done())
 {
 viewer.frame(mySimulationTime);
 mySimulationTime+=0.01f;
 }


 as this:

 Code:
 mySimulationTime= 100;
 while(!viewer.done())
 {
 viewer.frame(mySimulationTime);
 mySimulationTime+=0.01f;
 }



 both start from the beginning.

 Thank you!

 Cheers,
 Harald

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





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




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


[osg-users] 2D orthographic view with panning and zooming

2014-06-17 Thread Radu Marin Butoi

Hello everyone,

I am writing an application to display and select elements from 2D 
triangular meshes and 3D tetrahedral meshes. Displaying the 3D mesh 
works fine (thanks Robert for the previous help!). With the 2D I'd like 
to have the display show the XY (or XZ, or YZ, depending on the input; 
the bounding of the geometry can be used to determine this) plane 
directly and enable panning and zooming with the mouse. I have a single 
osgViewer and I have tried using the various 
getCamera()-set{View,Projection}* functions, but as I understand the 
camera manipulator will overwrite the view matrix. So, what is the 
simplest way to display an orthographic 2D scene with mouse panning and 
zooming in a similar way that a perspective 3D scene is displayed by 
default?


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