Re: [osg-users] Geocentric terrain and camera positioning
Hi everyone, I just begun to develop similar flight simulation record player with openscenegraph. I have some questions regarding to terrain, object and camera positioning. I build flat terrain with osgdem from dted and geotiff texture data as *.ive file. I checked result with simple demo application and I saw the terrain without any problem. Here are difficulties that I have encountered; I am using recorded positions for whole simulation objects as lat, log and alt. I can successfully display, animate and track flight with orbit camera man. using recorded data. But I could not position flight on terrain :(. Also I could not positioning camera on terrain center or real real world coordinate. - How can I position camera on terrain center or some special real world coordinate? - How can I position and simulate flight on terrain? - I could not display terrain with OsgEarth but is Osgearth good idea for these difficulties ? Thanks for any help. Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52081#52081 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Local coordinates
Hi everyone, I just started using Openscenegraph. I have some questions regarding coordinate systems. I am trying to develop simple debriefing application. I am using geographic (lat, long and alt ) coordinates and rotations information that were recorded on vehicle to transform objects in 3D space. I am also using geocentric terrain in order to show vehicle on the correct coordinates. I have no problem on terrain displaying phase but the transformation is not smooth because of cordinates's higher value. I am using world coordinates which are obtained by computeLocalToWorldTransformFromLatLongHeight to transform and position objects. So Can I use local coordinates instead of world coordinates for object transformations? or How can I transform rootscene to the origin point? ... Thank you for any help. Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52387#52387 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] delta3d like terrain displaying
Hi everyone, I am working on simple flight simulator on flat terrain. I successfully build my terrain using osgdem and I can display using osgviewer. My problem is how to show terrain correctly as Delta3d did. Delta3d can zoom on terrain when I change camera position and also it can handle with height mismatching like osgTDS. ... Thanks for all your help Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52116#52116 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Question about the correct use of osg::FrameBufferObject
HI Frank, The way you usually use osg::FrameBuffrerObject is associated with a render to texture osg::Camera. You assign the various buffer settings on the osg::Camera including any textures you want to assign it to and then the OSG's rendering backend will create the required FBO's and assigned Textures to it automatically, you won't need to directly assign an osg::FrameBufferObject to anything. Have a look at the osgprerender and osgprerendercubemap and other examples that set up the osg::Camera. Robert. On 5 February 2013 23:10, Frank Sullivan knarf.navil...@gmail.com wrote: Hi, I'm looking at the source code for osg::FrameBufferObject, and as far as I can tell, I just have to set this as an attribute on a node's StateSet and be done with it? If this is true, then can I use it in conjunction with Nested Render cameras in order to get render-to-texture cameras that render in the order in which they are encountered in the scene graph? Thank you! Cheers, Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52399#52399 ___ 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] OSC plugin, VS2010 64-bit
Thanks Stephan for the fix and Paul for the testing. Fix now merged and checked into svn/trunk. On 6 February 2013 03:19, Paul Martz pma...@skew-matrix.com wrote: Thanks, Stephan! That worked great. Cross-posting to osg-submissions. -Paul On 2/5/2013 4:52 PM, Stephan Huber wrote: Hi Paul, as I do only have VS2005 I can't build for 64bit. Attached is a possible fix for 64bit-builds with VS2010. Can you test the modified file on your end and report back? Thanks in advance, Stephan Am 05.02.13 23:53, schrieb Paul Martz: Forgot to mention: 32-bit builds fine, 64-bit is the issue. -Paul On 2/5/2013 3:41 PM, Paul Martz wrote: Hi Stephan -- The OSC plugin has compile errors with VS2010 for 64-bit builds, and I thought you might want to take a look at it. This is from trunk r13330. Thanks! -Paul ___ osg-submissions mailing list osg-submissi...@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geocentric terrain and camera positioning
HI Zeki, I've just seen that you've made three similar posts with no answers to any of them yet. It's generally best to be patient and stick to one thread per topic rather than splurt it out ever where. If it's a new topic it's also best to start a new thread. As for the problems you have right now it's hard to know where to start as it's hard to know what you actually understand about scene graphs, OSG particularly, and what you've done so far. The best we can do at this stage is provide general answers. First up, what it sounds like you are trying to achieve is done by OSG users all the time, terrain visualization it's very much one of the OSG core areas of usage. The OSG is capable it's just a matter of learning how to use it. Rather than diving in at the deep end and trying to develop your application right away it may be best to start learning about the various bits of software from a more ground up approach. Getting one of the OSG books would probably be a good starting place. For you particular needs I think you'll need to deal with what coordinate system you want to work in, this will mean converting your path data into the scene graphs coordinate system, or creating the scene graph in the path data's coordinate system, or converting back and forth. The later might be best if you are dealing with whole earth databases as the scene graph will be in Earth Center Earth Fixed. Robert. On 24 January 2013 13:37, Zeki Yugnak zeki.yug...@gmail.com wrote: Hi everyone, I just begun to develop similar flight simulation record player with openscenegraph. I have some questions regarding to terrain, object and camera positioning. I build flat terrain with osgdem from dted and geotiff texture data as *.ive file. I checked result with simple demo application and I saw the terrain without any problem. Here are difficulties that I have encountered; I am using recorded positions for whole simulation objects as lat, log and alt. I can successfully display, animate and track flight with orbit camera man. using recorded data. But I could not position flight on terrain :(. Also I could not positioning camera on terrain center or real real world coordinate. - How can I position camera on terrain center or some special real world coordinate? - How can I position and simulate flight on terrain? - I could not display terrain with OsgEarth but is Osgearth good idea for these difficulties ? Thanks for any help. Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52081#52081 ___ 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] Geocentric terrain and camera positioning
Thank you Robert. My earlier messages sent at different times in the last weeks and I solved most of them at time period. Also, moderator has just approved all my messages :). In the current situation, I am facing coordinate system problem. I am using geocentric terrain and geocentric coordinate system in order to show vehicle on the correct coordinates in the debriefing application. All geographic (lat, long and alt ) coordinates recorded on vehicle. I have no problem on terrain displaying but the transformation is not smooth because of higher value of the coordinates. World coordinates which are obtained by computeLocalToWorldTransformFromLatLongHeight are very high values. I try to convert recorded object coordinates according to a origin point and transform terrain to this origin. But terrain and object is not correlated. - How can I use middle coordinate system for object and terrain transformations? Thank you! Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52409#52409 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geocentric terrain and camera positioning
Hi Zeki, On 6 February 2013 10:08, Zeki Yugnak zeki.yug...@gmail.com wrote: I have no problem on terrain displaying but the transformation is not smooth because of higher value of the coordinates. World coordinates which are obtained by computeLocalToWorldTransformFromLatLongHeight are very high values. I try to convert recorded object coordinates according to a origin point and transform terrain to this origin. But terrain and object is not correlated. It's very hard to know what you mean and thus what to recommend. What do you mean the transformation is not smooth because of height value of coordinates? Could it be that you have float precision problems? The OSG by default uses double for all camera and all internal scene graph transform nodes to avoid jitter problems caused by float. - How can I use middle coordinate system for object and terrain transformations? Again, don't know what you mean by middle coordinate system. For geocentric terrain databases VirtualPlanetBuilder and osgEarth both arrange the tiles such that they have a local origin and are in the units of meters, and place these tiles under MatrixTransform that place them in ECEF (Earth Center Earth Fixed). The CoorindateSystemNode/Terrain(which subclasses from CoordinateSystemNode) nodes are used to decorate terrain subgraphs and provide a EllipsoidModel object that can convert from ECEF to lats/long/height. Does this make sense? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Using cmath to clean up include/osg/Math
Hi All, A peculiar bug under Windows with the dds plugin and mipmap levels has pointed to bug in the maths libraries that can be worked around by using the standard C++ cmath definitations, so a potential workaround for this bug is to use cmath in include/osg/Math instead of the current c library math.h. Making this change for just one compiler combination under one platform on it's own is probably not appropriate - usually I'd keep such workarounds local to the place that has the problem or to simply specify don't use broken dependencies. In this case I am considering the change for more wider reasons, our include/osg/Math header over the years has tried to handle lots of oddities on different platforms and with it has ended up rather convoluted and difficult to follow, I feel that perhaps now is the time to standardize on using Standard C++'s cmath library and clean up our Math header. It's kinda of incredibly that it's now 2013 and I'm only just getting brave enough to suggest dropping platforms that don't properly support cmath, I personally just have modern Linux boxes which I use for development, so have no problems with modern C++ usage, and the vast majority of our community will be using modern platforms as well and wouldn't expect them to have issues with adopting cmath over math.h. The problem comes from the niche platforms like Solaris, HP-Ux, AIX and IRIX. IRIX is pretty well dead, with the last members of the community providing testing under IRIX finally dropping their own IRIX machines a few years back so while it's likely that we are now well beyond being able to get the code base compiling back under IRIX. I do recall IRIX being one of the key problem platforms for using cmath, but am not sure about Solaris, HP-Ux and AIX. I think platforms can mostly be used with the GNU compilers so we are probably in the clear. I'm not even sure we have many members of the community using these niche platforms anymore. So... Thoughts form the community? Can we finally using cmath in include/osg/Math is clean this header up? With this issue I'm inclined to make the change and then push the problem out in the community to test, if no one complains that it'll be plain sailing all the way to the next stable release, for this topic at least. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geocentric terrain and camera positioning
Hi Robert, thanks for your help. It's very hard to know what you mean and thus what to recommend. What do you mean the transformation is not smooth because of height value of coordinates? Could it be that you have float precision problems? The OSG by default uses double for all camera and all internal scene graph transform nodes to avoid jitter problems caused by float. Again, don't know what you mean by middle coordinate system. I am using double precision. X,y,z coordinates are over million in ECEF coordinate system after converting from lats/long/height. I supposed that graphic card is giving rounding off error and there is flickering on object motion in OSG. So I want to use different coordinate system that is between world and local coordinate system. I am calculating all recorded object coordinates according to origin point and the origin point is the center of the terrain in geographic coordinate system (lats/long/height). I am using Delta3D's GeoCoordinate class for calculation. class reference link is below; http://www.delta3d.org/api/api_2.0/classdt_terrain_1_1_geo_coordinates.html I need to use different coordinate system that is between world and local coordinate systems for smooth motion displaying (without flickering). I hope that my problem is clear now. Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52413#52413 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geocentric terrain and camera positioning
HI Zeki, On 6 February 2013 11:56, Zeki Yugnak zeki.yug...@gmail.com wrote: I am using double precision. X,y,z coordinates are over million in ECEF coordinate system after converting from lats/long/height. I supposed that graphic card is giving rounding off error and there is flickering on object motion in OSG. If the database is created correctly and the camera position is computed correctly your shouldn't see visible jitter. Have a look through the achives on this topic we've written about it many times. I touched on it my previous reply, but you do need to go and do the back research to understand the topic. So I want to use different coordinate system that is between world and local coordinate system. I am calculating all recorded object coordinates according to origin point and the origin point is the center of the terrain in geographic coordinate system (lats/long/height). I am using Delta3D's GeoCoordinate class for calculation. class reference link is below; http://www.delta3d.org/api/api_2.0/classdt_terrain_1_1_geo_coordinates.html I need to use different coordinate system that is between world and local coordinate systems for smooth motion displaying (without flickering). I hope that my problem is clear now. I don't know Delta3D personally, if you are using Delta3D classes then it's best to ask the question with the Delta3D community. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using cmath to clean up include/osg/Math
Hi All, On 6 February 2013 11:02, Robert Osfield robert.osfi...@gmail.com wrote: With this issue I'm inclined to make the change and then push the problem out in the community to test, if no one complains that it'll be plain sailing all the way to the next stable release, for this topic at least. I have gone ahead and cleaned up include/osg/Math so that it uses cmath and cfloat on all platforms, there is only one platform specific hack left and that for MS's dumb arse we're not doing the Standard C++ properly, we'll do it in a own way so naa naa naa, the hack being _isnan in place of the proper std::isnan. I have checked this clean up in to svn/trunk so would appreciate testing out in the community for as wide range of platforms as you can. Fingers crossed it'll just work for all the platforms we need and life can be good :-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image::computeImageSizeInBytes bug
HI Marcin, On 5 February 2013 14:28, Marcin Prus p...@ai.com.pl wrote: I've sent fix to submission list early january. Was it rejected? Or is it still pending on your list? I haven't posted a osg-submissions fix for this issue. Looking at other threads about this issue it looks like using the Standard C++ cmath header instead of math.h might be the solution, and as I've just checked in a clean up of the include/osg/Math header to use cmath and cfloat instead of lots of platform specific hacks it could well be that this problem is already fixed. Could you try out svn/trunk version of the OSG and let me know if you still see the problem? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geocentric terrain and camera positioning
:) I think you misunderstood me. I have been searching all forum. The terrain (is not whole earth) database was created correctly using osgdem with Terrain and geocentric parameters. Also camera position is computed correctly and I can easily track may object using orbit manipulator. But, If I use object transformation in ECEF coordinate system, My object does not move smoothly. It moves up and down little bit. If I use local coordinates that are converted from lats/long/height according to an origin point, object moves correctly. Also I am not using delta3d directly and the problem is not related to GeoCoordinate. If I transform terrain or root scene to this origin point, how can I calculate object transformation without terrain-object correlation problem ? Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52417#52417 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] useVertexAttributeAliasing and vertex color
Hi, I've sent a patch for this : http://forum.openscenegraph.org/viewtopic.php?p=52418#52418 About my second message, forgot it, it was an error in my shader code -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52419#52419 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] simulation lag
Hi, I have been working on gesture based terrain navigation for wall displays. I am using optitrack for head tracking, and acquired head orientation quaternions via VRPN. I have used two threads, one for rendering and another for position updates from optitrack. The problem is that there is roughly around 0.3 second lag between position updates. http://www.youtube.com/watch?v=cBao22LmIcw Do you think the problem lies on from the fact that I used two threads, what sort of design ideas do you follow in such scenarios, where you require orientation information to manipulate the camera. Thank you! Cheers, Yonas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52421#52421 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] simulation lag
On Wed, Feb 6, 2013 at 1:51 PM, Yonas Sahlemariam yoniclas...@yahoo.comwrote: Do you think the problem lies on from the fact that I used two threads, what sort of design ideas do you follow in such scenarios, where you require orientation information to manipulate the camera. Without seeing your code nobody can really help you. A common problem with multiple threads is priority inversion - your vrpn thread is blocking the rendering way too often. I am using VRPN with OSG in such way that I call the mainloop() function in the main viewer loop and poll VRPN for new data in an update callback. The VRPN client classes are designed to be lightweight and return immediately, so there is no need to run it on separate thread. Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using cmath to clean up include/osg/Math
Hi, On Wednesday, February 06, 2013 11:02:43 Robert Osfield wrote: Can we finally using cmath in include/osg/Math is clean this header up? As you already mentioned above. We have stopped using IRIX some years back. The rest of the unixes, followed about two years later. Where only irix had problems with the c++98 type c headers like cmath. So, if we consider IRIX dead this change should be safe. I would be careful with the argument with the gnu compilers. Where I believe we should be safe for this particular change, sometimes you rely on 3rd party (binary) libraries compiled with the native compilers. Greetings Mathias ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using cmath to clean up include/osg/Math
Hi Robert, The cmath header changes can build with Visual Studio 2012 under Windows 7. I'd like to help test on the OpenSolaris platform later if I could download and make it work on my virtual machine. :-) Wang Rui 2013/2/6 Robert Osfield robert.osfi...@gmail.com Hi All, On 6 February 2013 11:02, Robert Osfield robert.osfi...@gmail.com wrote: With this issue I'm inclined to make the change and then push the problem out in the community to test, if no one complains that it'll be plain sailing all the way to the next stable release, for this topic at least. I have gone ahead and cleaned up include/osg/Math so that it uses cmath and cfloat on all platforms, there is only one platform specific hack left and that for MS's dumb arse we're not doing the Standard C++ properly, we'll do it in a own way so naa naa naa, the hack being _isnan in place of the proper std::isnan. I have checked this clean up in to svn/trunk so would appreciate testing out in the community for as wide range of platforms as you can. Fingers crossed it'll just work for all the platforms we need and life can be good :-) 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] An OSG Resource Compiler ?
Hi, is there an OSG-way to compile resources directly into your OSG projects, so that for example you would not have to load your e.g. axes.osg from file during application startup? What would be the best way to do this at the moment? Actually I am thinking about a generic way to store osg::Object's in a generated .cpp file integrating that data into some Singleton. osg::ref_ptrosg::Object osgDB::Resources::instance()-getObjectResource(:/some-label/object.osgt); osg::ref_ptrosg::Node osgDB::Resources::instance()-getNodeResource(:/some-label/axes.osgt); osg::ref_ptrosg::Image osgDB::Resources::instance()-getImageResource(:/some-label/my_picture.jpg); Would that be a nice add-on to OSG or is it just a stupid idea because there's already a cool way to do this? Thank you! Cheers, Johannes --- Johannes Scholz Software Engineer P3 Voith Aerospace GmbH, Bremen, Germany -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52425#52425 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] An OSG Resource Compiler ?
Hi Johannes, Have a look at the osg2cpp example, and also have a look at how the shaders are included in src/osgVolume/Shaders/*.cpp, these .cpp's are directly generated from .glsl files. Robert. On 6 February 2013 13:39, Johannes Scholz osg-supp...@vtxtech.net wrote: Hi, is there an OSG-way to compile resources directly into your OSG projects, so that for example you would not have to load your e.g. axes.osg from file during application startup? What would be the best way to do this at the moment? Actually I am thinking about a generic way to store osg::Object's in a generated .cpp file integrating that data into some Singleton. osg::ref_ptrosg::Object osgDB::Resources::instance()-getObjectResource(:/some-label/object.osgt); osg::ref_ptrosg::Node osgDB::Resources::instance()-getNodeResource(:/some-label/axes.osgt); osg::ref_ptrosg::Image osgDB::Resources::instance()-getImageResource(:/some-label/my_picture.jpg); Would that be a nice add-on to OSG or is it just a stupid idea because there's already a cool way to do this? Thank you! Cheers, Johannes --- Johannes Scholz Software Engineer P3 Voith Aerospace GmbH, Bremen, Germany -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52425#52425 ___ 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 build OpenSceneGraph for Android in Windows
Hi Nathan, Thanks for the posting the guide. On 4 February 2013 14:39, Nathan Collins nat...@mve.com wrote: The most important thing is to use the latest stable version of OSG (3.0.1) - we found that the svn trunk version just does not want to work. This is due to issues loading libraries as well as some problems with OSG its self. What were the problems you encountered when trying to use the svn/trunk version of the OSG? I'd like to resolved these so they can make it into next dev release and subsequent stable release. Thanks, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Local coordinates
Zeki, Don't transform the root scene (I assume you mean the terrain). Instead just take the matrix you got from computeLocalToWorldTransformFromLatLongHeight() and put that into a MatrixTransform. Then any points under that MatrixTransform are local to that world point, and you won't have any precision jittering problems. Glenn Waldron / @glennwaldron On Tue, Feb 5, 2013 at 9:36 AM, Zeki Yugnak zeki.yug...@gmail.com wrote: Hi everyone, I just started using Openscenegraph. I have some questions regarding coordinate systems. I am trying to develop simple debriefing application. I am using geographic (lat, long and alt ) coordinates and rotations information that were recorded on vehicle to transform objects in 3D space. I am also using geocentric terrain in order to show vehicle on the correct coordinates. I have no problem on terrain displaying phase but the transformation is not smooth because of cordinates's higher value. I am using world coordinates which are obtained by computeLocalToWorldTransformFromLatLongHeight to transform and position objects. So Can I use local coordinates instead of world coordinates for object transformations? or How can I transform rootscene to the origin point? ... Thank you for any help. Regards. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52387#52387 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] How to play Video on Android
Koduri, As long as you are able to link the libav* libraries, the plugin should work. Where are you storing the video file? You should also be able to see what is happening by catching logs from OSG using the NotifyHandler. David ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image::computeImageSizeInBytes bug
Robert, problem I found is different from the one discussed about math/cmath/log etc. and I can confirm it still exists in current version. Algorithm is wrong, computation doesn't take block nature of some compressions into account and fails for last mipmaps in non square textures (size computed is smaller then single block size). My solution is to use code from dds plugin instead of one introduced in image.cpp. This way we have single function instead of two of them and new one (from old dds plugin code) works properly. Best, Marcin W dniu 2013-02-06 13:20, Robert Osfield pisze: HI Marcin, On 5 February 2013 14:28, Marcin Prusp...@ai.com.pl wrote: I've sent fix to submission list early january. Was it rejected? Or is it still pending on your list? I haven't posted a osg-submissions fix for this issue. Looking at other threads about this issue it looks like using the Standard C++ cmath header instead of math.h might be the solution, and as I've just checked in a clean up of the include/osg/Math header to use cmath and cfloat instead of lots of platform specific hacks it could well be that this problem is already fixed. Could you try out svn/trunk version of the OSG and let me know if you still see the problem? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Marcin Prus Zastępca Kierownika Działu Oprogramowania ETC-PZL Aerospace Industries Sp. z o.o. Al. Krakowska 110/114, P.O. Box 22 02-256 Warszawa http://www.ai.com.pl tel: (48-22) 846-54-17 wew. 135 fax (48-22) 846-54-18 e-mail: p...@ai.com.pl NIP 522-01-01-817KRS 010025 Sąd Rejonowy dla m. st. Warszawy w Warszawie XIII Wydział Gospodarczy Krajowego Rejestru Sądowego. Wniesiony kapitał zakładowy Spółki wynosi 1 000 000 złotych. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Local coordinates
Hi Glenn , I have been already doing what you're saying. Here is the transformation code block; Code: osg::Vec3 rotation(currentRotation.Heading, currentRotation.Pitch, currentRotation.Roll); osg::Matrix hprRotationMat; Util::HprToMatrix(hprRotationMat, rotation); //Ellipsoid model of the root scene osg::EllipsoidModel* ellipsoid = pScene-getEllipsoidModel(); //x, y, z positions of the object in ECEF coordinate system osg::Matrix worldMatrix; ellipsoid-computeLocalToWorldTransformFromLatLongHeight(GeoPosition.Latitude, GeoPosition.Longitude, GeoPosition.Altitude, worldMatrix); osg::Matrix resultMat = worldMatrix; osg::Quat currentRotationQuat = hprRotationMat.getRotate(); resultMat.preMultRotate(currentRotationQuat); double scaleSize = 1.0; myObject-setMatrix(GMatrix::scale( scaleSize, scaleSize, scaleSize ) * resultMat ); There is not problem correlation to object and terrain with these code block. The problem is that my object does not move smoothly. It moves up and down little bit. X,y,z coordinates are over million in ECEF coordinate system. I supposed that graphic card is giving rounding off error or else what? If I use local coordinates that are converted from lats/long/height according to center point of the terrain, object moves correctly. Bu this time, I am having terrain-object correlation problem. The terrain (is not whole earth) was created correctly using osgdem with --terrain and --geocentric parameters. Also I can compute camera position correctly and easily track my object using orbit manipulator. The question is, How can I calculate object transformation without terrain-object correlation problem ,using different coordinate system that is calculated according to center of the terrain? Below is the local coordinate calculation code block; Code: osg::Vec3d GetCartesianPoint(mLatitude, mLongitude, mAltitude) { osg::Vec3d rawCartesian; rawCartesian.x() = (mLongitude * EQUATORIAL_RADIUS) * osg::DegreesToRadians(1.0); // azuma: removed negation on mLatitude, so that as latitude increases, Y increases rawCartesian.y() = (mLatitude * EQUATORIAL_RADIUS) * osg::DegreesToRadians(1.0); rawCartesian.z() = mAltitude; osg::Vec3d mCartesianPoint = rawCartesian - gOriginOffset; return mCartesianPoint; } //gOriginOffset is computed with below code block, OriginLongitude, OriginLatitude and OriginAltitude are the center coordinates of the terrain { gOriginOffset.x() = (OriginLongitude * EQUATORIAL_RADIUS) * osg::DegreesToRadians(1.0); // azuma: removed negation on mLatitude, so that as latitude increases, Y increases gOriginOffset.y() = (OriginLatitude * EQUATORIAL_RADIUS) * osg::DegreesToRadians(1.0); gOriginOffset.z() = OriginAltitude; } Thank you! Regards.[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52435#52435 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] An OSG Resource Compiler ?
Hi, I use OSG in a Qt application, and I do this : osg::ref_ptrosg::Object osgDB::readObject(:/some-label/object.osgt.qtresource); The .qtresource extension is mapped to a pseudo-loader written using Qt classes to load :/some-label/object.osgt file from Qt resources and decode it using the plugin associated to .osgt extension Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52437#52437 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Question about the correct use of osg::FrameBufferObject
Hi Frank -- Just adding to what Robert said: Although FrameBufferObject does derive from StateAttribute, I have never seen it used as an attribute attached to a StateSet. Rather, it's something that Camera uses essentially internally. Previous postings from Art Tevs (osgPPU) have warned of issues when attaching a FrameBufferObject as an attribute to a StateSet... I think he expected it to override the FrameBufferObject used by some parent Camera, but it didn't work that way. There were possibly other issues too, I don't recall. The bottom line is that you should probably not use FrameBufferObject directly, and should always let Camera manage it for you. -Paul On 2/5/2013 4:10 PM, Frank Sullivan wrote: Hi, I'm looking at the source code for osg::FrameBufferObject, and as far as I can tell, I just have to set this as an attribute on a node's StateSet and be done with it? If this is true, then can I use it in conjunction with Nested Render cameras in order to get render-to-texture cameras that render in the order in which they are encountered in the scene graph? Thank you! Cheers, Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52399#52399 ___ 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] Local coordinates
A couple of observations: 1) The units will be in millions because your database is a round earth database using the WGS84 spheroid ECEF CS with units in meters. 2) I don't understand how your second code blocks maps correctly to the geocentric cartesian round earth database built with osgdem using the --geocentric flag. I use this code block to map from geodetic to geocentric CS just fine without precision problems. My models move smoothly on the terrain surface... Code: void Model::UpdateOrientation() { orientation.makeRotate(osg::DegreesToRadians(roll), osg::Vec3f(0.0,1.0,0.0), // roll osg::DegreesToRadians(pitch), osg::Vec3f(1.0,0.0,0.0), // pitch osg::DegreesToRadians(-heading), osg::Vec3f(0.0,0.0,1.0)); // yaw (-heading) } void Model::UpdatePosition() { _ellipsoid-computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadians(lat), osg::DegreesToRadians(lon), altitude, position); } void Model::Update() { osg::Matrixd t_matrix; t_matrix = osg::Matrixd::rotate(orientation) * position; transform-setMatrix(t_matrix); } Shayne[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52441#52441 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph new website almost ready
Hi Jordi, Really nice work! Thank you, Rafa. 2013/2/6 Jordi Torres jtorresfa...@gmail.com Hi osg'ers, The new joomla site is almost done, check it out in http://openscenegraph.com. We are going to maintain the old trac alive for archive purposes so don't panic :). I marked some sections with 'ask community' in the migration tasks section, these are related to community nodekits, projects and user groups. So if your Nodekit/Project/UserGroup is still alive you may want to publish it in the community section of the new site. Feel free to use the new site posting community news or adding use cases, videos, new projects, etc. There are a few sections not migrated yet and some of them requires community help specially the tutorials section (the code is outdated), but in general the vast majority of the sections are done. We are going ahead and the joomla site will be the main osg website shortly. So if you have any suggestion or you see any error don't hesitate to talk in this thread. Thank you! -- Jordi Torres Fabra ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Rafael Gaitán Linares CTO at Mirage Technologies S.L - http://www.mirage-tech.com gvSIG3D Developer - http://gvsig3d.blogspot.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Question about the correct use of osg::FrameBufferObject
Thank you, Paul and Robert. Just as a suggestion, it may be useful to have a way for NESTED_RENDER ordered cameras to render to a texture. It's my understanding, from looking at the code and from past forum posts, that NESTED_RENDER cameras ignore the camera RTT stuff. I was hoping that attaching an FBO to a StateSet below the camera would be a useful way to compel a NESTED_RENDER camera to switch over to a new FBO. The reason I bring it up is that it would make setting the render order on these cameras brainless -- if camera A needs to render before camera B, then one can simply place camera A as an ancestor of camera B, and not have to worry about setting an explicit render order number. This could be useful for systems that have data-driven pipelines where you have multiple passes over multiple scenes, that are required to happen in a specific order. Thanks again! Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52445#52445 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Failure in casting to osg::AnimationPathCallback*
Hi all, I'm running into an interesting bug in my code which manifests as behaviour that works on one platform (Windows) and not on another (OS X) with the same OSG code. (Using OSG trunk, around 3.1.4) I am using the following node visitor to reset animations attached to transform nodes: class ResetAnimationNodesVisitor : public osg::NodeVisitor { public: ResetAnimationNodesVisitor(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} virtual void apply(osg::Transform transform) { osg::NodeCallback *nc = transform.getUpdateCallback(); osg::AnimationPathCallback* apc = dynamic_castosg::AnimationPathCallback*(nc); if (apc) { apc-reset(); apc-update(transform); } traverse(transform); } }; This visitor is instantiated on a node thus: void resetAnimationTime(osg::ref_ptrosg::Node modelNode) { ResetAnimationNodesVisitor ranv; modelNode-accept(ranv); } When compiled and run on an animated model under Windows (compiled with Visual Studio 2010 SP1) all works as expected. When the exact same code is compiled and run under OS X (using Xcode 4.5.2, with LLVM 4.2.1) the dynamic cast to osg::AnimationPathCallback* is always NULL. I have checked that RTTI is not disabled (it's on by default, and no errors are produced by the dynamic_cast, and that indeed things are as expected with this snippet inside apply(): if (nc) osg::notify(osg::NOTICE) UpdateCallback: className is std::string(transform.getUpdateCallback()-className()) and type_id.name() is typeid(transform.getUpdateCallback()).name() std::endl; which produces the output: UpdateCallback: className is AnimationPathCallback and type_id.name() is PN3osg12NodeCallbackE So it looks like a failure somewhere in RTTI. Both typeid and the dynamic_cast fail to convert the osg::NodeCallback* to an osg::AnimationPathCallback*. Yet clearly, the callback IS the right type, as evidenced by OSG's className() function's output. Any ideas about where this kind of issue might be coming from? Regards, Phil.___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] i am having problem compiling program related to TraingleFunctor
i am not able to compile program using TriangleFunctor. at the first compilation i got some error saying cout is not a member of std + some other chunks . So i added a iostream header file. And when i comiled it again there are 3-4 screenful errors. am not able to understand these scripts of error ... Errors and My program is attached below ... thanks for the help in advance i am attaching my program main.cpp https://docs.google.com/file/d/0B3dFjVubf5gKQ2RrQzdhOU9OR28/edit Errors Description: Binary data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Local coordinates
Hi Shayne, Thanks for your help. Your's transformation code block is the same as mine's. I really do not know why object's translation is not smooth. Also I could not use second code block because of terrain-object correlation problem. But I hope that I will translate object smoothly using local coordinates, if I can transform terrain or scene to a origin point that is used to calculate object local coordinates. Do you have any idea that could not handle with over million values in ECEF coordinate system using different coordinates system to transform object ? For example, If I transform root scene to the center of the terrain in ECEF coordinate system or add my object as a child of the terrain, Can I calculate object transformations again according to the center of the terrain in ECEF coordinate system? Do you think that it makes sense? Thank you! Regards -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52448#52448 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph new website almost ready
Jordi, great job, thank you for your effort! One question: What will happen to the VirtualPlanetBuilder website? There are some helpful tutorials which should survive :) Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52449#52449 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg-users Digest, Vol 68, Issue 6
来信收到,谢谢! -- 原始邮件 -- From:osg-users-requestosg-users-requ...@lists.openscenegraph.org; Date:2013年2月5日(星期二) 凌晨4:04 To:osg-usersosg-users@lists.openscenegraph.org; Subject:osg-users Digest, Vol 68, Issue 6 Send osg-users mailing list submissions to osg-users@lists.openscenegraph.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org or, via email, send a message with subject or body 'help' to osg-users-requ...@lists.openscenegraph.org You can reach the person managing the list at osg-users-ow...@lists.openscenegraph.org When replying, please edit your Subject line so it is more specific than Re: Contents of osg-users digest... Today's Topics: 1. Re: 3D mice (Thomas Lerman) 2. Re: How to build OpenSceneGraph for Android in Windows (Jordi Torres) 3. Re: 3D mice (Jan Ciger) 4. Re: 3D mice (Paul Martz) 5. Re: 3D mice (Torben Dannhauer) -- Message: 1 Date: Mon, 04 Feb 2013 17:42:40 +0100 From: Thomas Lerman osgfo...@tevs.eu To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] 3D mice Message-ID: 1359996160.m2f.52...@forum.openscenegraph.org Content-Type: text/plain; charset=UTF-8 [quote=Sebastian Messerschmidt]Hello Thomas, yes. I've more or less successfully integrated the 3dConnexion SpaceMouse into a custom Handler. Also there is some class in the osgVisual-project. Unfortunately it uses DirectX which is why I use a slightly modified OpenInputSystem. cheers Sebastian[/quote] [quote=Jan Ciger]On Sun, Feb 3, 2013 at 6:41 PM, Thomas Lerman osgfo...@tevs.eu ([email]osgfo...@tevs.eu[/email]) wrote: Sure, it is not hard. Probably the simplest way to do so is to use VRPN, then you can use anything that VRPN supports (and not only a 3D mouse). 3D Connexion SpaceNavigator and the old SGI SpaceBall worked just fine with it - you get an orientation quaternion from VRPN and apply that to a MatrixTransform node in the scenegraph, e.g. using a callback. I believe there is even a VRPN nodekit for OSG already (osgVRPN?), saving you even that work. Regards, Jan[/quote] [quote=Paul Martz]The osgWorks project supports both VRPN and DirectX input devices, and works with OSG 2.8.5 and later. http://osgworks.googlecode.com -Paul[/quote] Thank you Sebastian, Jan, and Paul. Any code samples (I do not have the hardware or drivers yet)? I did check out osgWorks and did not see any mention of this capability, but could have missed it. Thank you again, Thomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52368#52368 -- Message: 2 Date: Mon, 4 Feb 2013 18:48:14 +0100 From: Jordi Torres jtorresfa...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] How to build OpenSceneGraph for Android in Windows Message-ID: cam4stfcswzse2bbfev-xfk-sv1z1kiydy7tg9vf59fbon0b...@mail.gmail.com Content-Type: text/plain; charset=iso-8859-1 Hi Nathan, good tutorial! It could be useful to post this to the android section of the new openscenegraph joomla site: http://www.openscenegraph.com/index.php/documentation/platform-specifics/android Cheers. 2013/2/4 Nathan Collins nat...@mve.com Hi there, We have been attempting to build OSG for Android and thought it would be a good idea to share the steps we used to finally get it to work in Windows. This guide assumes you have Eclipse, the Android SDK and NDK installed and set up already. Whilst you may be used to using the NDK tools in Cygwin, we have only used CMD in this guide. The most important thing is to use the latest stable version of OSG (3.0.1) - we found that the svn trunk version just does not want to work. This is due to issues loading libraries as well as some problems with OSG its self. As usual, your mileage may vary! Install make and MinGW == - Download and install make from http://gnuwin32.sourceforge.net/downlinks/make.php; - Download and install MinGW from http://sourceforge.net/projects/mingw/files/latest/download?source=files. Don't forget to add the C++ compiler during the installation options; - Add the install directories to your PATH. Mine were C:\Program Files (x86)\GnuWin32\bin and C:\MinGW\bin. Setup a clean version of the OSG source === I used a clean version of the OSG source, because we are using a separate set of CMake commands. *** It is important to use the latest stable version (3.0.1), rather than the trunk, otherwise it will not work! *** To get a clean version: - Install tortoise SVN http://tortoisesvn.net/downloads.html ; - In C:\Local use SVN Checkout (a context menu option) http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-3.0.1 Set the checkout-directory to be