Re: [osg-users] Clamping models to an osgTerrain
Hi Brad, I'm assuming you've looked at the osgSim class? It has the ability to query where the ground is at the highest LOD of the terrain. It has other methods you can use to interact with osgTerrain that may be able to help you. Shayne > On December 20, 2019 at 4:53 PM Brad Colbert wrote: > > Hi folks, > > I googled but not found an answer that goes into this. > > I have what can be considered a town and want to clamp the buildings to > the terrain (obviously). > > What I would prefer is to have some pre-process that runs intersectors on > the terrain, pushing up (or down) through the PagedLODs, placing the model at > the appropriate height, and then saving that tile back out. This way the > models just get loaded in with the PagedLOD and are already at the right > height as the terrain height pops up and down based on the LOD. > > Is this even possible with 3.6? If so, any ideas, thoughts, pointers? > > Best, > Brad > > > > -- > You received this message because you are subscribed to the Google Groups > "OpenSceneGraph Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to osg-users+unsubscr...@googlegroups.com > mailto:osg-users+unsubscr...@googlegroups.com . > To view this discussion on the web visit > https://groups.google.com/d/msgid/osg-users/dd3b24e4-a1da-46de-9957-c98bf330d2c1%40googlegroups.com > > https://groups.google.com/d/msgid/osg-users/dd3b24e4-a1da-46de-9957-c98bf330d2c1%40googlegroups.com?utm_medium=email_source=footer > . > ___ > 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] People currently using the ffmpeg/libavcodec plugin?
Were using it to stream video and display it on a quad... Shayne - Original Message - From: "Chris Hanson"To: "OpenSceneGraph Users" Sent: Friday, November 3, 2017 8:44:45 PM Subject: Re: [osg-users] People currently using the ffmpeg/libavcodec plugin? Hmm. Well, we have some forthcoming improvements to the original ffmpeg plugins. Just trying to find out if anyone is using it. On Fri, Nov 3, 2017 at 1:04 PM, Arthur Bogard < arthur.bog...@gmail.com > wrote: I work at Digitalis. We developed that plugin a while ago and dev against ffmpeg proper. Our work was to get it working under vdpau for better performance with high res video. There were still several issues with high CPU usage, so we're deving a new plugin from scratch to be able to use nvenc and nvdec, but I'm not sure what the status is of it at the moment. It's probably a ways away from release. We needed it to be able to decode 8k x 8k streams. I don't know why it wasn't merged. I can't remember what conversations were had. Let us know what you think of it ours, and I think you're free to merge it in if it works for people. Arthur On Fri, Nov 3, 2017 at 11:26 AM, Chris Hanson < xe...@alphapixel.com > wrote: That's weird. Why isn't this a part of the main OSG distribution? On Fri, Nov 3, 2017 at 11:52 AM, Raymond De Vries < ree...@xs4all.nl > wrote: Hi Chris, I remember a few discussions about this subject. Please search the archives. One of them is https://bitbucket.org/digitalis/osg-ffmpeg-plugin if I remember correctly this one can do 4k.. plz keep us updated. Cheers! Raymond On Nov 3, 2017, at 17:07, Chris Hanson < xe...@alphapixel.com > wrote: Just a quick survey -- is anyone using the OSG FFMPEG plugin (which utilizes the libavcodec) presently, and if so, would you mind commenting on how you are using it and how you feel about what it does and does not do at the moment? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ 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 -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ 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 -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ 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] mixing Direct3D and OSG...
Hello, I have a Direct3D app in where I need to render a background image using OSG. The approach I was thinking of using is to use off-screen memory or context to render the OSG imagery and then try to load the results into a Direct3D surface somehow. Perhaps a render-to-texture sort of approach? Is something like this feasible? Is there a better approach to doing this? In case someone asks, porting in either direction is not possible at this time... Thank you! Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69787#69787 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] mixing Direct3D and OSG...
Hello, I have a Direct3D app in where I need to render a background image using OSG. The approach I was thinking of using is to use off-screen memory or context to render the OSG imagery and then try to load the results into a Direct3D surface somehow. Perhaps a render-to-texture sort of approach? Is something like this feasible? Is there a better approach to doing this? In case someone asks, porting in either direction is not possible at this time... Thank you! Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69786#69786 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] NVTT 3rdParty x64 libs for OSG...
Hi, I was wondering if anyone out there in OSG land has had success building the Nvidea texture tools version 2.0.8 using VS2013 for x64 to use with the nvtt plugin in the OSG. I've set the NVTT_SHARED=1 so that the libs are built as shared libraries. All libraries compile just fine. However, when I compile and link the nvtt.lib, I get a bunch of linker errors (LNK2019 and LNK2001 unresolved external symbols) dealing with functions found in the nvimage library. I suspect is has something to do with the calling convention __cdecl when the libs are built as shared libs. When I set NVTT_SHARED=0, all the libs compile and link just fine but then the OSG no longer builds for the obvious reasons when it tries to compile the nvtt-dependent plugin If anyone can help or suggest something that will result in getting rid of the linker errors, that would be great. Cheers, Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67561#67561 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] 64 bit 3rdParty libs
The nvtt plugin in the OSG uses it. Other apps use it as well that use the OSG such as VirtualPlanetBuilder and osgEarth. I did find the link you provided for the source for the nvidia texture tools but I haven't had luck in getting them built. I'm getting a bunch of linker errors when trying to build the libs using VS2013. Thanks for your feedback. Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67548#67548 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] 64 bit 3rdParty libs
This does not help me. I need the Nvidia texture tools 64bit dependency which is not available on your website. I already have all the other 64 bit dependencies needed to build OSG 64bit. I'm just missing the Nvidia texture tools. Since no one has any input on this, the next step is to try and build them myself from source. I'm sure this will be an ugly mess... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67520#67520 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgVisual 3rdparty downloads
Just so everyone knows, the 64 bit versions of the nvidia texture tools libs in the 3rdParty dependencies are missing for VS2013... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67518#67518 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] 64 bit 3rdParty libs
I went to your suggested website and it does not have the dependencies I need...sorry. Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=67517#67517 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Why isn't OpenSceneGraph used in games?
This is probably off topic but since OpenIG was brought up, I had a question about it... Does OpenIG support CIGI? If it doesn't, adding it would go a long way in making it more mainstream in the IG community. It would sure make it easier for a host that is using CIGI to switch over... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=66927#66927 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to setup multi channel
Just to chime in here on this multi-channel discussion... I was aware of the OSGs support for master/slave cameras (channels) running on ONE computer but I didn't think it supported a master/slave architecture for running each channel on a different computer with it's own graphics card/context and monitor. If the latter is true, I would like more details on how this is done... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65997#65997 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads won't stop on Windows...
Robert, Thanks for the feedback. I wasn't doing the checkCancel() in my loop in the run() method. Once I put that in there, it started working as expected when I called cancel() for a particular thread. Interestingly, when I started pinning each thread on a different processor using setProcessorAffinity(), I could no longer cancel the threads (i.e. they wouldn't stop running). If I let the OS scheduler decide where the threads are running (by not calling setProcessorAffinity()) or pin the threads on the same processor, cancel() started working again. Not sure why it is doing this. For now, I'll just ignore setting the processor affinity for each thread so that cancel() will work properly when I shut down the threads... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65963#65963 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OpenThreads won't stop on Windows...
Hi, I'm using OpenThreads in an app that's using osgEarth. When I go to stop the thread, I call the cancel() method but it doesn't seem to be working. The thread is still running. Is there something else I need to do to stop the thread and shut it down? I have a stopThread() method that breaks out of my loop in the run() method, however, the thread is sometimes paused in execution inside the loop when I go to shut it down. I need to stop the thread unconditionally when I go to exit. I thought cancel() would do it but it doesn't work. Thoughts? Thank you! Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65955#65955 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] _intersectionLimit doesn't seem to be working...
Robert, You bring up excellent points that explains the divergences I'm seeing in my results, both in terms of performance and correlation. I do have a couple of questions then... So, if I understand you correctly, there's no way to tell VPB to build a flat file (i.e. one that that does not have Paged LODs in it) in geocentric space? In other words, is there a way to decorate a sphere with just raw DTED data using VPB? I know this doesn't make sense for a visual database but it might make sense for other usages like viewing a raw DTED tile on a spheroid. If VPB won't do this, I suppose I can just use a height field and map it to a spheroid myself. My second question has to do with the LODs in VPB. What is the default LOD setting for VPB? You mentioned that I might not have gone deep enough in my database? It appears to me that VPB builds LODs by default and goes deep enough based on the resolution of the original source data. For example, I ran VPB on just one tile of level 1 DTED and didn't specify any levels of detail setting on the command line. It built the database to level 6. I then did another build and specified --PagedLOD and -l 24 on the command line and it didn't do anything different. It still just built to level 6... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64843#64843 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] error using VPB on DTED level 2...
Hi, I'm attempting to use VPB to build a paged geocentric database from level 2 DTED source data. I'm only using 3 tiles of level 2 DTED so it's not a lot of data. I get the following error... Warning: Task tasks/build_subtile_L2_X1_Y5.task has failed, blacklisting machine and resubmitting task. I looked at the log file for this task, it gives the following info... E:\simData\osgDatabase\dtedlevel2\logsmore build_subtile_L2_X1_Y5.log 0.113: Adding terrainTile 0.113: getTaskName(2,1,5) no nest, 3 0 0.113: DataSet::_run() 3 0 0.126: started DataSet::createDestination(30) 0.127: Time for after_reproject 0.000145 0.127: local_extents = xMin() 38.00 40.000100 0.127: yMin() 30.00 34.000100 0.127: AR=2.999600 C1=1 R1=3 0.127: createNewDestinationGraph 0.135: Time for destinationGraph-computeMaximumSourceResolution() = 0. 00 0.135: Time for createDestinationGraph 0.007809 0.135: Time for after_computeNeighbours 0.13 0.135: completed DataSet::createDestination(30) 0.135: Error: no destination graph built, cannot proceed with build. 0.135: Time to write out DatabaseRevision::FileList - FilesAdded dtedlev el2_subtile_L2_X1_Y5/dtedlevel2_L2_X1_Y5.ive.task.0.added, 0 0.135: Time to write out DatabaseRevision::FileList - FilesRemoved dtedl evel2_subtile_L2_X1_Y5/dtedlevel2_L2_X1_Y5.ive.task.0.removed, 0 0.135: Time to write out DatabaseRevision::FileList - FilesModified dted level2_subtile_L2_X1_Y5/dtedlevel2_L2_X1_Y5.ive.task.0.modified, 0 0.135: Elapsed time = 0.134646 I read another thread that was posted a while back on a similar error where there was a fix checked in but I don't know if that is related to this. It seems to only do this when I build with level 2 DTED. Level 1 DTED seems fine. Any ideas on what is causing this or where I can look further to debug the problem? I'm using VPB version 0.9.13 and OSG version 3.2.1 on Windows 7... Thanks, -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64845#64845 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] _intersectionLimit doesn't seem to be working...
So...I figured out why I was not getting just one intersection returned for my LOS tests. Apparently when KdTrees are enabled, intersectionLimit is ignored in the LineSegmentIntersector. When I turned off KdTrees, I got just one intersection returned but it is still abysmally slow compared with using KdTrees. This suggests that time spent traversing the scenegraph is the bottleneck vs. traversing KdTrees. That being said, KdTrees is still unacceptably slow when doing lots of visibility LOS tests on terrain. My next question is, is there a way to limit the number of intersections returned when using KdTrees like there is for the conventional case? Optimally, I would like to get the nearest intersection (or even just one intersection) from the start point and then have the intersector bail out to save time. Any help or input would be appreciated... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64754#64754 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] _intersectionLimit doesn't seem to be working...
All, I'm using the osgSim::LineOfSight class to perform visibility tests (intersections) on an osgTerrain database built with VPB. I'm setting the intersectionLimit to be LIMIT_ONE or LIMIT_NEAREST to help with performance. However, for each LOS test I'm doing, I'm still seeing the number of intersections quite high ( 1) which is puzzling. I want the intersector to register one hit and then bail out but this doesn't seem to be happening. Can anyone explain why this is happening or is this a bug? I'm using OpenSceneGraph 3.2.1 running on Windows... Thank you! -Shayne Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64726#64726 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] window contents into osg::Image
Hi, I have a window (windows 7) that is updated by another application's output at a 60Hz rate. The other application is embedding its output into this window based on the window's HWND handle. I would like to capture the window's contents and pipe it to an osg::Image to display on a textured quad in my OSG application. Is such a thing possible? If so, how would I do this? Is there a better way for me to go about doing this? Thank you! Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63738#63738 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] embed osgViewer into FLTK window...
All, I'm trying to embed an osgViewer that has a transparent background into an FLTK main window. The embedded osgViewer needs to have a transparent background so that I can see the parent window behind it. Is this even possible? What I'm trying to do is use the osgViewer as an overlay to render symbology on top of the main parent FLTK window. I've looked at the osgViewerFLTK example and the osgHUD example but nothing has worked so far. Any suggestions or help would be appreciated... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63209#63209 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] geographical coordination conversion
The code snippet you provided maps from a geodetic coordinate system to a geocentric ECEF cartesian coordinate system so that the point (lat,lon,0) maps to the cartesian point (o,p,q) which lies on the surface of the ellipsoid. This probably isn't what you're looking for since it sounds like you've built your database to cater to a cylindrical map projection. Also in the method convertLatLongHeightToXYZ(), height is given in meters, not degrees... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53860#53860 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Height of the terrain on a given lang/long
I'm still not clear on what you're trying to accomplish. I thought you were trying to get HOT for a given lat/lon pair. In this case, there's only one intersection. From your last post, it sounds like you're tying find intersections with the terrain for a given LOS between two points. Is this true? A couple of questions so that I have a clear understanding... 1) Why would you want to have the lower LODs available for doing collision tests? You always want the highest LOD for doing intersection tests with the terrain. 2) What are you using for doing the LOS check between the line and the terrain? Are you using your code snippet that you posted earlier or are you using osgSim? You should be using the methods in osgSim because it pages in all the tiles you need to check for intersections between two points in the case of LOS on terrain. The highest LOD for each tile that lies between the two points is what you need for intersection testing... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53726#53726 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Height of the terrain on a given lang/long
On the performance issue, you need to leverage the database cache feature for LOS and HAT. Take a look at the osgintersection example to see how this is done for los and hat. Using the computeHeightAboveTerrain method is sort of an immediate mode for HAT queries which isn't the best for performance when you have a bunch of them to do per frame. I'm not sure I understand your last issue. The readNodeFile() reads the paged terrain database (*.ive) file and the database pager pages in whatever LOD is needed without any work on your part. When you query HAT, the highest LOD is paged in to get the correct value, again without any extra work on your part. Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53706#53706 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] reading dem/image files...
Just a followup post to my original inquiry... After appending the .gdal to my .dt1 files to get the readHeightFieldFile() to read the DTED file format, I also had to do the following to get the DTED to render correctly... osg::HeightField *grid = osgDB::readHeightFieldFile(n41.dt1.gdal); grid-setOrigin(osg::Vec3(0.0, 0.0, 0.0)); xsize = (radius * osg::PI * grid-getXInterval()) / 180.0; ysize = (radius * osg::PI * grid-getYInterval()) / 180.0; grid-setXInterval(xsize); grid-setYInterval(ysize); where radius is the mean radius of the Earth in meters. Hopefully this help someone who wants to do simple display of raw DTED data (i.e. *.dt1 files) using the default osg viewer... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53690#53690 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Height of the terrain on a given lang/long
If you want HOT (height of terrain) for a particular lat/lon, use the same code as above and do the following... Code: maxElevationInDatabase = 3962.0; // meters earth-convertLatLongHeightToXYZ(osg::DegreesToRadians(lat), osg::DegreesToRadians(lon), maxElevationInDatabase, X,Y,Z); hat = osgSim::HeightAboveTerrain::computeHeightAboveTerrain(terrain.get(), osg::Vec3d(X,Y,Z)); hot = maxElevationInDatabase - hat; The caveat is that you need the maximum height in your database (Mt Everest perhaps?) -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53696#53696 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] reading dem/image files...
osgEarth is sort of an overkill for my little app that just displays raw DTED (*.dt1) geocells for inspection. I did find an earlier thread that addresses my question. The plugin is found if you append .gdal onto the file name (i.e. w112_n42.dt1.gdal). The plugin is now found and the file is read but the displayed data is garbled and all wrong. For a sanity check, I did the following... osgviewer --dem w112_n42.dt1.gdal and I get the same results of garbled data. Any ideas? Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53573#53573 ___ 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
Thanks to everyone for their input so far. I guess if one presents information or a tutorial for building OSG on Android for Windows, it should be complete, accurate, and thorough. It appears that vital information or detail is missing in the tutorial regarding the role of the Android NDK or getting it set up in building the OSG in this context. Anway, I did add the environment variables that were missing which allowed me to progress further but now I'm getting the following error when I run the make... Android NDK: Parsing Application.mk Android NDK: APP_PIE is C:/AndroidDevelopment/android-ndk-r8e/build/gmsl/__gmsl:512: *** non-numeric second argument to `wordlist' function: ''. Stop. make[2]: *** [Android-OpenSceneGraph] Error 2 make[1]: *** [CMakeFiles/ndk.dir/all] Error 2 make: *** [all] Error 2 Any idea on what this error is referring to? Just as a sanity check, has anyone else had success in building OSG for Android using the tutorial given above? I thought I'd ask before investing too much time in something that may not work... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53435#53435 ___ 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
Jan, My comments or inquries were in reference to the tutorial as presented in this thread. Of course I don't expect the OSG wiki doc to go into explicit detail regarding the Android NDK. My point is that if someone posts a tutorial (in this case the main gist of this thread), there should be more detail so that a novice can come in, follow its steps, and be successful in completing the desired task. Obviously there are some steps missing, hence the reason for this discussion. It appears that I would be best served by following your recommendation of following the steps provided on the wiki. It's becoming obvious that taking this course of action will give me the greatest chance of success in getting the OSG working for Android rather than following what is presented here. Again, thanks to all who have taken the time out to address my questions and concerns. I'm sure there will be more... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53439#53439 ___ 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
Careful. Many people (including me) are reading this via the mailing list, not forum - there is a gateway between the two, so forum posts go to the list and list posts show up on the forum. Thus I had no clue which tutorial as presented in this thread are you referring to. For me the thread started with your questions about the OSG not building. And only now I see that in addition to the Wiki page there is another, two months old mail (in another e-mail thread) from Nathan Collins from the 4th February explaining how to build OSG using MinGW tools (unsupported way, btw). Or is there yet another tutorial that you have actually used? I'm aware of that. I actually use both the email list and the forum interchangeably. I assumed most people did as well to see the full context of discussion. Apparently that is not the case. For individuals who mainly use the email list, I will try to be more explicit in referring back to the forum. In answer to your question...no, I'm not referring to another tutorial. This was the only one. I tried it out and it didn't work so well (so far). I simply asked why and I got answers. Nothing more, nothing less. Right, correct. However, please do address that to Nathan - you haven't specified that it was actually his tutorial, so it is likely that nobody has realized that that is the one you are talking about. Nathan also seems to be using the mailing list, not forum, so he likely missed the question entirely. Hmmm...you must have missed the email list response from Alistair Baxter on 4/3/13 @ 2:11am who was addressing my questions in behalf of Nathan Collins who is out of town. He apparently saw what I wrote and the context that it was written in. He knew what I was talking about... On the other hand, OSG and NDK is *not* meant for complete novices, especially OSG on Android is still a bit rough for various reasons. So let's be reasonable here - a novice is actually expected to read the documentation before starting on something (like the Cygwin issue ...) Not sure what to say regarding this comment... Give that a shot. That tutorial is tried, it does work and is using the official (Google supported) way of building applications for Android. However, you may still encounter bugs - like the last compilation error you had. That is the nature of the beast, because the NDK is quite fast moving target and Google is prone to fix one bug and introduce two new ones in every release. Furthermore, their documentation for it is pretty much non-existent. Pretty hard to read documentation that is pretty much non-existent...even for a novice...;^) -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53443#53443 ___ 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, I went through this tutorial and got stuck when invoking the make command to build OSG. It errors out with the message ANDROID_NDK-NOTFOUND\ndk-build ... I'm supposing that there was a step omitted in the tutorial that tells the cmake configure utility on where to find the android ndk (i.e. defining the path to find ndk-build). Is this correct or am I missing something? I would like to try and get this to work. Thanks for any help in advance... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53413#53413 ___ 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 Jan, So are you saying that Cygwin is the best way to compile OSG for Android on Windows? I don't think the tutorial in this thread uses Cygwin which makes this all the more confusing... I'll try setting the ANDROID_NDK environment variable to the path where it resides and issue the make command again. Thanks for your help. -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53415#53415 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to acquire the screen coordinates of a 3D object?
It looks like you forgot to concatenate the window matrix from the Viewport object onto the MVPW matrix in what you call the automatic version. You also need to remove the matrix mutiply of the window matrix with the screenPosition4d object. This should not happen after the perspective divide. Look again closely at the orginal code snippet you used for your automatic version to see the error. I think it would be helpful for you to understand the OpenGL transformation pipeline since that is what the OSG is using under the hood. Paul Martz does a great job of explaining this in his book. http://www.opengldistilled.com/ Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52475#52475 ___ 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] How to acquire the screen coordinates of a 3D object?
If you're new to the OSG, it is really helpful to look at the examples and also search the OSG forums for the problems you're looking for. Many of the questions most new folks ask, have already been addressed and answered in the forum. Hopefully the link below will help you... http://forum.openscenegraph.org/viewtopic.php?t=9172highlight= Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52305#52305 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgSim::HeightAboveTerrain not returning any hits
What code exactly are you referring to? What is the error you're seeing? Without an example or more detail, it is difficult for us to resolve your problem. *.ive files are typically databases built with VirtualPlanetBuilder or similar tools. I don't have any experience with the TerraPage (*.txp) format or loader so I can't offer any input here... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52175#52175 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help me! i have problem for Height Above Terrain!!
You may also want to search in the forum for discussion threads that address this topic (GetHeightAboveTerrain). It has been discussed many times with solutions. -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52176#52176 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with material alpha
Hi, It's unclear what exactly you're attempting to do or what it means when you say it doesn't work for some models. I can only venture a guess as to what the problem is. I'm assuming you're trying to change the transparency of the object? For the models in question, cow.osg already has lighting and materials associated with the stateset which probably explains why your code works here. On the other hand, axes.osg has no materials (color only). You can see this by viewing the contents of each osgt file. Remember, materials (and material alpha) only make sense when lighting is enabled. If lighting is disabled, color (r,g,b,a) is what is used. Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50613#50613 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Difficulty Positioning Camera Manipulator in Geocentric Database
Hi Rob, That is interesting. I don't use the setHomePosition() method and my stuff works fine specifying the manipulator matrix explicitly (setByMatrix()). I am using CompositeViewer and setting the camera for each view added to the viewer. One camera is using the Flightmanipulator and the other is controlled manually or placed stationary on the ground. Not sure if this makes any difference... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50617#50617 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with material alpha
Hi, Materials (and material alpha) only get used when lighting is enabled. Make sure that lighting is enabled in the applicable stateset... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50590#50590 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Difficulty Positioning Camera Manipulator in Geocentric Database
Hi Rob, In my app, I have an option to navigate on a geocentric database using the standard Flight Manipulator. Below is the code snippet to do this... Before you enter the render loop (i.e. viewer.run()), do the following to configure and set the initial position of your ownship using lat, lon, altitude with a heading, pitch, roll of 0.0... view-setCameraManipulator(new osgGA::FlightManipulator()); osg::Matrixd position; earth-computeLocalToWorldTransformFromLatLongHeight( osg::DegreesToRadians(lat), osg::DegreesToRadians(lon), altitude, position); osg::Matrixd rotation2YUp; rotation2YUp.makeRotate(M_PI_2, osg::Vec3d(1.0, 0.0, 0.0)); position = rotation2YUp * position; view-getCameraManipulator()-setByMatrix(position); After you do this, the Flight Manipulator will move your ownship along like usual. If you need to extract positional info from the manipulator, you can get it from the ownship update callback. For example, in your callback, you can extract out the ownship position in geocentric coordinates from the flight manipulator by doing the following... osg::Vec3d geocentric_eye = view-getCamera()-getInverseViewMatrix().getTrans(); Hope this helps... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50530#50530 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB in VS10...
Chris, See my previous post. The template compile errors that I'm getting are strange. Perusing the forum, I did find something similar when someone was compiling osgPhysics against OSG... Thanks, Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50261#50261 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB in VS10...
Ok...I'm pretty sure I got the projects built correctly using CMake in Windows for VPB. When I open the solution and try to do ALL_BUILD, I get a ton of compile errors which are: error C2784: could not deduce template argument for 'type' from 'type' The compiler cannot determine a template argument from the supplied function arguments. These are all coming from the OSG header files that VPB is indirectly referencing. If I just try to compile HeightFieldMapper.cpp in the vpb project, I get the same compile errors. Anyone have any ideas why this is happening? -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50244#50244 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using OSG Embedded in an Existing OpenGL Project
To render OSG in an existing OGL viewport, you still need to create an OSG viewer because that is what kicks off the OSG traversals when the frame() method is called. You also need to manage (i.e. Push and Pop) OGL state correctly since OSG and OGL share the same render context so that you don't trash your existing OGL rendering state. Anyway, here's basically what you do to setup and render OSG stuff in an OGL viewport/window. This uses CompositeViewer so you could render multiple OSG viewports embedded inside an OGL window...:) osgViewer::CompositeViewer *viewer = new osgViewer::CompositeViewer(); osgViewer::GraphicsWindowEmbedded *gw = new osgViewer::GraphicsWindow(ogl_x, ogl_y, ogl_w, ogl_h); osgViewer::View *view = new osgViewer::View; view-getCamera-setGraphicsContext(gw); view-getCamera-setViewport(osg_x, osg_y, osg_w, osg_h); // somewhere inside OGL viewport/window that has origin in LL corner . . // set rest of the view OSG camera state and matrices as usual . . view-setSceneData(scenegraph); viewer-addView(view); viewer-realize(); . . // do this during rendering loop for each OGL frame... PushOGLState(); viewer-frame(); // render OSG embedded viewport in OGL window PopOGLState(); Hope this helps... Shayne[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50153#50153 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Ok...so I upgraded to OSG 3.0.1 and tried this intersection limit test in my app (setIntersectionLimit()) I first tried LIMIT_ONE. Performance did improve over the NO_LIMIT case but I noticed that the number of intersections calculated were as high as 6 for some of the line segments. I would have expected just one intersection calculated. Why is more than one intersection being done in this case? Next I tried LIMIT_NEAREST. This resulted in many more intersections calculated. Some segments got as high as 27 intersections. That would suggest that this option is calculating intersections and then sorting through to determine which one is closest to the line segment starting point? I should point out that I'm intersecting my line segments with a terrain database... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50026#50026 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Farshid, I'm actually modifying the osgSim::LineOfSight class for my tests. I went into LineOfSight.cpp and modified the computeIntersections() method to support setIntersectionLimit() since there's currently no way to control this for the Line of Sight stuff in OSG. I added the call setIntersectionLimit() for each LineSegmentIntersector instanced in the computeIntersections() method. This was done at the top of the method where the iterator loop is for each entry of _LOSlist. I believe this is the correct way to do it... I then called LineOfSight::computeIntersections() in my app to test it out against my terrain database. I would include the actual code snippet but my email machine doesn't have the code on it so I hope that the above description of what I did makes sense... It does make sense on how the LIMIT_NEAREST option works. Thanks for that explanation. -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50029#50029 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector question...
Farshid, If I understand the code correctly, each intersector in the LOS code is associated with a start end pair defining the line segment. In other words, it's a 1 to 1 mapping. If I have 45 LOS queries, the code generates 45 LineSegmentIntersectors. Each intersector in turn is added to an IntersectorGroup so that this one group contains 45 LineSegmentIntersectors. Perhaps Robert can chime in here to verify that this is the case. When I retrieve the intersection count for EACH individual intersector, I'm getting the number of intersections 1. This seems incorrect for the LIMIT_ONE case. For this case, I would expect the number of intersections to be always 1 (if a hit is found) for each intersector. I will investigate the code further to see what is going on or what might be wrong... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50034#50034 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
When you instance an Ellipsoid object, the default is already an oblate spheroid (WGS84 with polar and equatorial radii defined in meters). I suspect your problem has something to do with your shape drawable where you're using a sphere in your code. For starters, I would suggest that you reference off the ellipsoid directly to position objects on the earth. I have never had any problems mapping geodetic to geocentric coordinates and vice versa when I reference the EllipsoidModel object with its conversion methods (i.e. convertLatLongHeightToXYZ). Entities are placed on the surface of the spheroid correctly as expected (assuming Height is 0.0). -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47745#47745 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
osg::EllipsoidModel *ellipsoid = new osg::EllipsoidModel(); ellipsoid-convertLatLongHeightToXYZ(osg::DegreesToRadians(lat), osg::DegreesToRadian(lon), Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47728#47728 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Trying to build OSG terrain
Hi, If you're having build errors, make sure you're using the correct version of VPB (i.e. osgdem or vpbmaster) with the correct version of OSG. You cannot arbitrarily mix and match different versions... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47729#47729 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Strategies for reducing visual terrain-tile-popping with osgTerrain
Hi, The popping is the effect of an abrupt change from one LOD to another. The typical solution is to geomorph the terrain over several frames with the LOD change. It smooths out the transition so that LOD changes are subtle. High end visual IGs have been doing geomorphing a long time with terrain skins. With the advent of shader technology, this technique is making its way into the standard desktop PCs. As others have pointed out, its complicated but it can be done. Here's an interesting article on it that may shed light on the problem and how to address it. http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/terrain-geomorphing-in-the-vertex-shader-r1936 -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47273#47273 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Why no games with OSG?
Hi, As others have pointed out, OSG is not a game engine. It's a scene graph and should be used in this context (no pun intended). There are plenty of rendering technologies that use OSG under the hood. When I went to IITSEC last year, there were a lot of vendors using OSG underneath for rendering. In terms of gaming, take a look at Delta3D which is an open source gaming engine using OSG technology... http://www.delta3d.org/ -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47274#47274 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Release built OSG libs with debug built app...
All, I believe this issue has been addressed before but I can't find the previous discussion. Therefore I will ask again... Is there a way to get Release-built OSG libs to play nicely with an app that is built with Debug? Right now if I link with Release-built OSG libs, my app (built with Debug option) doesn't work. If I link with Debug-built OSG libs, things work fine. If I built my app with Release, then it also works fine. Because OSG is so slow when using the Debug libs, I would like to avoid using them since I have no need to debug down into OSG code. I do need to debug my app. I'm using VS 2008 SP1 on Windows 7... Thank you! Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45809#45809 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Large VPB Database build fails without
Just a followup on this problem... If I run osgdem directly on the dted files, things build just fine. If I run vpbmaster on exactly the same dted files, it blows up with the error no destination graph built, cannot proceed with build in one of the tasks. It's not clear to me why osgdem works and vpbmaster does not on the same data set... :? Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44747#44747 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] World to Screen Space
Hi, This topic has been discussed in various forms. Please see http://forum.openscenegraph.org/viewtopic.php?p=18256#18256 -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44280#44280 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] How to get the coordinate system information?
Hi, If you build the database using the --geocentric option, and your source data uses WGS-84, you can use the EllipsoidModel class to convert from one CS to another. Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43935#43935 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Lighting problem
Hi, What you're seeing is the specular highlights based on your light source and material properties. To turn this off, set your specular material rgb and shininess to 0.0. Since OSG uses OpenGL under the hood, it would be helpful to understand the OpenGL lighting model...:) Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43905#43905 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Intersection of two lines
I am not aware of a function in OSG to do this, however, you can do it yourself. If you have a starting point and direction for each line, you can define each line parametrically as Line 1: P + rA Line 2: Q + sB where P,Q are the starting points and A,B are the unit direction vectors. The scalars r,s are what we want to solve for. This can be done by equating the two lines P + rA = Q + sB or rA - sB = Q - P For 2D, this is a simple 2x2 linear system. The scalars r,s can be uniquely solved for by using Cramer's rule (stable for small systems). Of course, this assumes that the lines are not parallel or on top of each other (check for this first). Once the scalars r,s are solved for, plug them back into Line 1 or Line 2 to get the point of intersection in your coordinate system. For 3D, the system above turns into an overdetermined system of equations (i.e. 3 equations and 2 unknowns) which does not have a solution except when the system contains linearly dependent equations. For the case where there is no solution, you can solve for a point of intersection in a least squares sense using the method of normal equations. This method is numerically stable for small systems. To do this, write the system above as Cx = d where C is a 3x2 matrix, x is a 2x1 column vector containing the scalars r,s we want to solve for, and d is 3x1 column vector. Using the method of normal equations, we can rewrite the system to be CtCx = Ctd where Ct is the transpose of C. This new system now becomes a 2x2 linear system which can be solved like the 2D case above. Hope this helps... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42509#42509 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to compute the coordinates of specific point ?
Do you have a code snippet you can show us on how you're currently using this model for collision detection? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=37156#37156 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] vpbmaster build question...
All, I fired off a VPB build using vpbmaster on a 16 processor machine running Linux Fedora core 13. The number of tasks generated was 5314 for this build. As predicted, vpbmaster fired off 16 osgdem threads to work on the build. As the build went along I noticed that the number of osgdem threads running had slowly decreased until that now there are only 0 to 2 threads running with about 2500 tasks remaining. I never see any more osgdem threads than 2 being generated to work on the build. This seems a bit strange. Is this correct behavior? I would have thought that up to 16 threads would have been working as the build process went along to completion. There is no indication of any errors in the output so far. Has anyone else seen this or know what might be going on? Thank you! -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=36210#36210 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NVidiaTextureTools integration moved from VPB to OSG
Hi, This may be a dumb question in relation to this thread, but does one still need to employ the Mesa tools to bypass the graphics card when using VPB to build databases with the NVTT? -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35871#35871 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Calculating altitude with LineSegmentIntersector
More accurately, the method is: osgSim::HeightAboveTerrain::computeHeightAboveTerrain(...) Sorry for the mistake in the previous post... -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35590#35590 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] VPB vs osgEarth...
All, Up to this point, we've used VPB for building our databases that our OSG app uses. However, I've contemplated taking a look at osgEarth for future consideration. My question is, is what advantages are there for using osgEarth vs. VPB? I understand that source content (DTED, GeoTiff, etc.) is loaded on the fly in osgEarth but doesn't that hurt performance when compared to a statically built database done with VPB? Thanks for any input in advance... -Shayne ... Thank you! Cheers, Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35137#35137 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] thread hangs when LineSegmentIntersector is used...
All, After further invesigation on why my thread is hanging, I narrowed it down to when OSG creates an IntersectorGroup() object via the 'new' operator in the intersection code. Just for a sanity check, I did the following in the run() method of my thread: char *start = (char *)malloc(4) and it never returns after I issue the malloc() call. It would appear that 'new' or malloc() hangs the thread. Do I need to do use some sort of special memory management scheme in OpenThreads when it comes to dynamic memory allocation? As stated earlier, I'm new to threaded programming so I'm probably failing to do something that is needed in the case of dynamic memory allocation in a thread... Thank you! Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33831#33831 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] thread hangs when LineSegmentIntersector is used...
All, I have a two process application where one process loads the scenegraph for rendering via CompositeViewer while the other process loads a subset of the same scenegraph (terrain) for extracting database information. No rendering is going on in the second process. In the second process, I'm starting a thread using OpenThreads to perform intersection calculations with the terrain. The thread seems to start ok and go into the run() method until it requests an intersection with the terrain. Once LineSegmentIntersector is called, the thread hangs and seems to be in some sort of wait state that never comes back. I don't understand why the thread stops running when I do an intersection calculation. Is it possible that LineSegmentIntersector is modifying the scenegraph when it does its calculations? Would that cause the thread to stop running? This is my first attempt at using OpenThreads so I'm probably missing something... Thanks for any help in advance... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33748#33748 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] thread hangs when LineSegmentIntersector is used...
Hi Robert, Thanks for the reply. If LineSegmentIntersector does nothing to the scenegraph, I'm definitely not modifying the scenegraph in the process that spawned the thread so there must be something else going on that is causing the thread to stop running. I have gone into the debugger and the thread goes into a wait state which never returns. Obviously I will need to dig deeper to find out why. My purpose of inquiry to the forum was to make sure I wasn't forgetting something with using OpenThreads or in understanding how LineSegmentIntersector works on the scenegraph. It is curious that the thead stops running when using LineSegmentIntersector to compute intersections. Otherwise it runs fine... For the record, I'm currently using 64bit Linux Fedora core 13. This exact same software runs fine on Fedora core 10 and RedHat 5.4...weird. Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33753#33753 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org