Re: [osg-users] The problem of loading a model in osg
try it like this:osg::ref_ptrosg::Node Node_Reader = new osg::Node; -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48605#48605 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Top 10 OSG Debugging Tips
Hi, Actually You have to redirect both stdout and stderr osgviewer cow.osg foo.txt 21 On windows standard way of logging is to use OutputDebugString function that connects application to windows debugging facilities (i.e output window of visual studio). Many libraries print debug messages this way including MFC, WxWidgets and Qt. My intention is to incorporate OSG notifications into GUI applications. For instance I would like to display notifications in a GUI list widget with messages coloured according to notification severity. In Qt you can do this by installing custom message sink with qInstallMsgHandler. In OSG you're stuck with plain std::ostream handle and no severity information. My proposal is to replace stdout and stderr returned by osg::notify with custom stream that uses osg::NotifyHandler as message sink (similar to qInstallMsgHandler in Qt). ... Thank you! Cheers, jack -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48622#48622 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] play animation backwards?
Hi, Unfortunately I couldnt figure out how to play a given animation backwards. The animation is part of a model read from an osgt file. Looking at osgAnimation/Animation.cpp it would be straightforward to add an additional switch case to Animation::update() case ONCE_BACKWARDS: t = _originalDuration - t; if (t 0) return false; However, I wonder if there is an obvious way to achieve the same without having to modify the file Animation.cpp ? Thank you for any hints! Cheers, Thilo Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App fr iPhone und Android.https://produkte.web.de/freemail_mobile_startseite/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ECEF Oriented Compass Implementation
Since you're navigating on a sphere, you always need to calculate the bearing based off the local up vector of the sphere (ground stabilized) and not the up vector of the ownship. The reason why your code works from the birds eye view is because the up vectors between the two are the same in this case. When you introduce pitch and roll, the up vector of the ownship diverges from the sphere up vector which probably explains why your code below no longer works. Once you calculate the bearing correctly, your compass heading can then be calculated by using the bearing angle to rotate around the z-axis (0,0,1). -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of onur akkaya Sent: Thursday, June 28, 2012 1:20 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] ECEF Oriented Compass Implementation Hi, I have an ECEF terrain and I want to implement a compass node to show the true north to the user. I tried the code below but at some angles it does not work correctly. When the camera is vertical (birds eye view) to the terrain, it works perfect but if you rotate the camera (elevation or roll) it does not show the correct value. thanks, class Compass : public osg::Camera { public: Compass(void) { } Compass( const Compass copy, osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY ): osg::Camera(copy, copyop), _plateTransform(copy._plateTransform), _needleTransform(copy._needleTransform), _mainCamera(copy._mainCamera), m_bIsFirst(false) { } Compass::~Compass(void) { } META_Node( osg, Compass ); void setPlate( osg::MatrixTransform* plate ) { _plateTransform = plate; } void setNeedle( osg::MatrixTransform* needle ) { _needleTransform = needle; } void setMainCamera( osg::Camera* camera ) { _mainCamera = camera; } virtual void traverse( osg::NodeVisitor nv ) { if ( _mainCamera.valid() nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR ) { osg::Matrix matrix = _mainCamera-getViewMatrix(); matrix.setTrans( osg::Vec3() ); osg::Vec3 northVec = osg::Z_AXIS * matrix; northVec.z()= 0.0; northVec.normalize(); osg::Vec3 axis = osg::Y_AXIS ^ northVec; float angle = atan2(axis.length(), osg::Y_AXIS*northVec); axis.normalize(); if ( _plateTransform.valid() ) { _plateTransform-setMatrix( osg::Matrix::rotate(angle, axis) ); } _plateTransform-accept( nv ); _needleTransform-accept( nv ); osg::Camera::traverse( nv ); } } osg::MatrixTransform* createCompassPlate( const std::string image, float radius, float height) { osg::Vec3 center(-radius, -radius, height); osg::ref_ptrosg::Geode geode = new osg::Geode; geode-addDrawable(createTexturedQuadGeometry(center, osg::Vec3(radius*2.0f,0.0f,0.0f), osg::Vec3(0.0f,radius*2.0f,0.0f)) ); osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; texture-setImage(osgDB::readImageFile(image)); osg::ref_ptrosg::MatrixTransform part =new osg::MatrixTransform(); part-getOrCreateStateSet()-setTextureAttributeAndModes(0, texture.get() ); part-getOrCreateStateSet()-setRenderingHint(osg::StateSet::TRANSPARENT _BIN ); part-addChild(geode.get()); return part.release(); } osg::MatrixTransform* createCompassNeedle( const std::string image, float radius, float height) { osg::Vec3 center(-radius/4, -radius, height); osg::ref_ptrosg::Geode geode = new osg::Geode; geode-addDrawable(createTexturedQuadGeometry(center, osg::Vec3(radius/2,0.0f,0.0f), osg::Vec3(0.0f,radius*2,0.0f)) ); osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; texture-setImage(osgDB::readImageFile(image)); osg::ref_ptrosg::MatrixTransform part =new osg::MatrixTransform(); part-getOrCreateStateSet()-setTextureAttributeAndModes(0, texture.get() ); part-getOrCreateStateSet()-setRenderingHint(osg::StateSet::TRANSPARENT _BIN ); part-addChild(geode.get()); return part.release(); } protected: osg::ref_ptrosg::MatrixTransform _plateTransform; osg::ref_ptrosg::MatrixTransform _needleTransform; osg::observer_ptrosg::Camera _mainCamera; bool m_bIsFirst; }; -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48579#48579 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g
Re: [osg-users] play animation backwards?
Did you try decrementing the simulation time in your call to Viewer::frame()? I'm not familiar with osgAnimation internals, but other animations in oSG, such as osg AnimationPath, osgSim animated light points, and osgParticle simulations, are all based on the simulation time. It would be very odd if osgAnimation didn't work the same way. -Paul On 7/2/2012 9:09 AM, Thilo Weigel wrote: Hi, Unfortunately I couldn't figure out how to play a given animation backwards. The animation is part of a model read from an osgt file. Looking at osgAnimation/Animation.cpp it would be straightforward to add an additional switch case to Animation::update() case ONCE_BACKWARDS: t = _originalDuration - t; if (t 0) return false; However, I wonder if there is an obvious way to achieve the same without having to modify the file Animation.cpp ? Thank you for any hints! Cheers, Thilo Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android. *https://produkte.web.de/freemail_mobile_startseite/* ___ 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] play animation backwards?
Hi, Thilo You can do this with://animationPathCallback is a osg::AnimationPathCallback*double animationTime = animationPathCallback-getAnimationTime();//use animation duration instead if you want to play from last frameanimationPathCallback-setTimeMultiplier(-1.0);animationPathCallback-setTimeOffset(animationTime); Cheers,Sergey.02.07.2012, 19:09, "Thilo Weigel" thilo.wei...@web.de:Hi, Unfortunately I couldn't figure out how to play a given animation backwards. The animation is part of a model read from an osgt file. Looking at osgAnimation/Animation.cpp it would be straightforward to add an additional switch case to Animation::update() case ONCE_BACKWARDS: t = _originalDuration - t; if (t 0) return false; However, I wonder if there is an obvious way to achieve the same without having to modify the file Animation.cpp ? Thank you for any hints! Cheers, Thilo Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android. https://produkte.web.de/freemail_mobile_startseite/___osg-users mailing listosg-users@lists.openscenegraph.orghttp://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] play animation backwards?
Ouch, for some reason i thought you were using osg::AnimationPath animation. Cant say anything about osgAnimation. 02.07.2012, 19:56, "Sergey Polischuk" pol...@yandex.ru:Hi, Thilo You can do this with://animationPathCallback is a osg::AnimationPathCallback*double animationTime = animationPathCallback-getAnimationTime();//use animation duration instead if you want to play from last frameanimationPathCallback-setTimeMultiplier(-1.0);animationPathCallback-setTimeOffset(animationTime); Cheers,Sergey.02.07.2012, 19:09, "Thilo Weigel" thilo.wei...@web.de:Hi,Unfortunately I couldn't figure out how to play a given animation backwards. The animation is part of a model read from an osgt file. Looking at osgAnimation/Animation.cpp it would be straightforward to add an additional switch case to Animation::update() case ONCE_BACKWARDS: t = _originalDuration - t; if (t 0) return false; However, I wonder if there is an obvious way to achieve the same without having to modify the file Animation.cpp ? Thank you for any hints! Cheers, Thilo Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android. https://produkte.web.de/freemail_mobile_startseite/___osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org___osg-users mailing listosg-users@lists.openscenegraph.orghttp://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] Rendering a terrain
Hi, What's the best way to render a terrain given an elevation model (DEM) and an orthophoto (texture)? Thanks This email and any files transmitted with it are confidential and contain proprietary information belonging to VisionMap Ltd. VisionMap Ltd. asserts in respect of this email and any files transmitted with it all rights for confidentiality and proprietary interests to the fullest extent permitted by law. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Thank you. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering a terrain
What's the best way to render a terrain given an elevation model (DEM) and an orthophoto (texture)? VirtualPlanetBuilder or osgEarth. -- 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 Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Help: Is there a way to hide a node from a camera?
Hello, The scene graph structure is as following: Nodes B and C are children of Transform Node A. Node A is attached to two camera nodes CamA and CamB(pre render). I want CamA to be able to render B and C, but CamB only B. Is there a way to achieve that without using fragment shader with if discard ? Thank you very much in advance. Best wishes Shuiying ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help: Is there a way to hide a node from a camera?
On Mon, Jul 2, 2012 at 10:51 AM, wang shuiying shuiying.w...@fu-berlin.dewrote: Hello, The scene graph structure is as following: Nodes B and C are children of Transform Node A. Node A is attached to two camera nodes CamA and CamB(pre render). I want CamA to be able to render B and C, but CamB only B. Is there a way to achieve that without using fragment shader with if discard ? This is what NodeMasks are for. http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/NodeMaskDemo or if that's still not responding, try the Google cache version: http://webcache.googleusercontent.com/search?q=cache:IpBLdKB5Zq4J:www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/NodeMaskDemo+cd=1hl=enct=clnkgl=us -- 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 Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osg-submissions] ReaderWriter X reworked
Hi Ulrich, I also spotted the missing ''. You're absolutely right. Well, if you already fixed them you can submit ^^... or else I'll do (but sincerely I don't know when...) Cheers, Sukender - Mail original - De: Ulrich Hertlein u.hertl...@sandbox.de À: OpenSceneGraph Submissions osg-submissi...@lists.openscenegraph.org Cc: Sukender suky0...@free.fr Envoyé: Jeudi 14 Juin 2012 15:52:30 Objet: Re: [osg-submissions] ReaderWriter X reworked Hi Sukender, I had a quick look at the patch and checked that it still works with the various .x files I have flying around. One thing I did notice in the code is that you're passing 'const std::string' in some places. For the sake of efficiency these chould be replaced with 'const std::string' to avoid making a copy every time. Same for passing 'osg::Vec', these should always be passed as const-ref unless they are modified or returned. Maybe this is something you could fix and resubmit? Apart from that I'd say it's good to go. Just my $0.02 Cheers, /ulrich On 31/05/12 11:14 , Sukender wrote: And now the patch. It is about .X: - Brand new writer for .x format. Yes, the format is deprecated but some still use it. Current implementation has limitations (only supports one texture, for instance) but works. - Reader - Added checks, warnings, and crash guards - Now handles FrameTransformMatrix element (kind of osg::MatrixTransform) - Fixed CW / CCW for faces - Better handling of materials (handles meshes with no materials, fixed reading of transparent textures...) - Handling triangles and polygons differently - Reader can now create indexed geometries - And more... The reader clearly doesn't read 100% of .x files, but handling is way better now. Sorry for the huge amount of changes, but these are the result of many commits from a colleague, and giving you these commits separately won't help you merge the code as the 1 commit = 1 feature rule was not followed at all... Cheers, Sukender ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help: Is there a way to hide a node from a camera?
On 07/02/2012 07:06 PM, Chris Hanson wrote: This is what NodeMasks are for. http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/NodeMaskDemo Or a SwitchNode if you need only few nodes changed. Regards, Jan ___ 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 61, Issue 2
Hello, Chris NodeMask works well. Thank you very much! cheers Shuiying On 07/02/2012 09:03 PM, osg-users-requ...@lists.openscenegraph.org wrote: Message: 15 Date: Mon, 2 Jul 2012 11:06:01 -0600 From: Chris Hanson xe...@alphapixel.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Help: Is there a way to hide a node from a camera? Message-ID: cagoufmyryvhpqfuxbxvsgq1h1sesuedw4cdribrunnytgvt...@mail.gmail.com Content-Type: text/plain; charset=windows-1252 On Mon, Jul 2, 2012 at 10:51 AM, wang shuiying shuiying.w...@fu-berlin.dewrote: Hello, The scene graph structure is as following: Nodes B and C are children of Transform Node A. Node A is attached to two camera nodes CamA and CamB(pre render). I want CamA to be able to render B and C, but CamB only B. Is there a way to achieve that without using fragment shader with if discard ? This is what NodeMasks are for. http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/NodeMaskDemo or if that's still not responding, try the Google cache version: http://webcache.googleusercontent.com/search?q=cache:IpBLdKB5Zq4J:www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/NodeMaskDemo+cd=1hl=enct=clnkgl=us -- 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 Digital Imaging ? GIS ? GPS ? Telemetry ? Cryptography ? Digital Audio ? LIDAR ? Kinect ? Embedded ? Mobile ? iPhone/iPad/iOS ? Android -- next part -- An HTML attachment was scrubbed... URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20120702/5fea0376/attachment-0001.htm ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] VPB
Where do you get Virtual Planet Builder from now? I do not see the SVN link anywhere. I apologize if has been asked I probably missed it. Please post again. Thanks, Michael ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] VPB
On Mon, Jul 2, 2012 at 4:06 PM, Michael Hall hal...@att.net wrote: Where do you get Virtual Planet Builder from now? I do not see the SVN link anywhere. I apologize if has been asked I probably missed it. Please post again. https://www.google.com/search?q=+site:openscenegraph.org+virtualplanetbuilder Use the Google cache. The original wiki seems to be getting over-run by crap now. Thanks, Michael -- ** ___ 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 Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] (no subject)
Spam. Do not visit this link. On Mon, Jul 2, 2012 at 3:18 PM, m...@arne-kreutzmann.de wrote: http://newmodeluk.com/time.php?ocean208.png ___ 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 Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] build VPB on VS 10
@Robert: I'm having the same problem with Virtual Planet Builder. I'm using gdal 1.7 already, and virtual planet builder version 0.9.7. OSG version 3.1.1. Which version of osg should I use? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48648#48648 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org