[osg-users] Can OSG be built to have Vec3 be a Vec3d
Hi, Is there a CMake option to allow Vec3 be a typedef to Vec3d instead of Vec3f? Jason This email and any files transmitted with it from Charles Machine Works are confidential and intended solely for the use of the individual or entity to which they are addressed. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to convert a QPixmap to a osg::Image ?
This is what I do to convert a QImage to osg::Image: QImage img ... QImage glimg(QGLWidget::convertToGLFormat(img)); osg::Image* osgImg = new osg::Image; unsigned char* bits = new unsigned char[glimg.byteCount()]; memcpy(bits, glimg.bits(),glimg.byteCount()); osgImg-setImage(img.width(), img.height(), 1, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, bits, osg::Image::USE_NEW_DELETE); Jason -Original Message- From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Lv Qing Sent: Sunday, May 03, 2015 11:26 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] how to convert a QPixmap to a osg::Image ? Hi, Our picture has storge as a QPixmap(a image format used by QT4.8) in database,when I got a QPixmap object,how to convert to a osg::Image ? Thank you! Cheers, Lv -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63619#63619 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] GL_GEOMETRY_SHADER_EXT not declared
I just checked out the latest revision from the trunk (rev 14678) and attempted to compile. I receive the following compiler error: In file included from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/StateAttribute:20:0, from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/AlphaFunc:17, from C:\Users\jason\Desktop\dev\OpenSceneGraph\src\osg\AlphaFunc.cpp:14: C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/Shader:93:24: error: 'GL_GEOMETRY_SHADER_EXT' was not declared in this scope GEOMETRY = GL_GEOMETRY_SHADER_EXT, It appears this was originally defined in include/osg/GL2Extensions but was recently removed? What is the proper fix to redefine this? (and other possible errors I will receive) Thank you, Jason This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL_GEOMETRY_SHADER_EXT not declared
Update: I added the following to include/osg/Shader just above the Shader class definition #ifndef GL_GEOMETRY_SHADER_EXT #defineGL_GEOMETRY_SHADER_EXT 0x8DD9 #endif #ifndef GL_GEOMETRY_VERTICES_OUT_EXT #defineGL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA #endif #ifndef GL_GEOMETRY_INPUT_TYPE_EXT #defineGL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB #endif #ifndef GL_GEOMETRY_OUTPUT_TYPE_EXT #defineGL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC #endif Everything builds fine except example_osgtransformfeedback fails with: GL_RASTERIZER_DISCARD was not declared From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason MacDonald Sent: Tuesday, February 03, 2015 9:24 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] GL_GEOMETRY_SHADER_EXT not declared I just checked out the latest revision from the trunk (rev 14678) and attempted to compile. I receive the following compiler error: In file included from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/StateAttribute:20:0, from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/AlphaFunc:17, from C:\Users\jason\Desktop\dev\OpenSceneGraph\src\osg\AlphaFunc.cpp:14: C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/Shader:93:24: error: 'GL_GEOMETRY_SHADER_EXT' was not declared in this scope GEOMETRY = GL_GEOMETRY_SHADER_EXT, It appears this was originally defined in include/osg/GL2Extensions but was recently removed? What is the proper fix to redefine this? (and other possible errors I will receive) Thank you, Jason This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL_GEOMETRY_SHADER_EXT not declared
Thanks Robert, GLDefines attempts to include osg/GL I don't seem to have this file, nor can I locate it in the SVN anywhere. I don't understand your question: how you get on I use TortoiseSVN and connect to http://svn.openscenegraph.org/osg Building with: Windows 7 64bit Mingw64 4.8.1 posix seh rev5 I've been using OSG for a while now, and am attempting an upgrade from rev 13782 From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Tuesday, February 03, 2015 10:25 AM To: OpenSceneGraph Users Subject: Re: [osg-users] GL_GEOMETRY_SHADER_EXT not declared Hi Jason, The GL_GEOMETRY_SHADER_EXT should now be GL_GEOMETRY_SHADER as this is what GLDefines and modern OpenGL provides. I have checked this fix into svn/trunk. Could you update to latest in svn/trunk and let me know how you get on. Cheers, Robert On 3 February 2015 at 15:24, Jason MacDonald jason.macdon...@ditchwitch.commailto:jason.macdon...@ditchwitch.com wrote: I just checked out the latest revision from the trunk (rev 14678) and attempted to compile. I receive the following compiler error: In file included from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/StateAttribute:20:0, from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/AlphaFunc:17, from C:\Users\jason\Desktop\dev\OpenSceneGraph\src\osg\AlphaFunc.cpp:14: C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/Shader:93:24: error: 'GL_GEOMETRY_SHADER_EXT' was not declared in this scope GEOMETRY = GL_GEOMETRY_SHADER_EXT, It appears this was originally defined in include/osg/GL2Extensions but was recently removed? What is the proper fix to redefine this? (and other possible errors I will receive) Thank you, Jason This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL_GEOMETRY_SHADER_EXT not declared
Ok, solved the GL include problem, its created by cmake and put in the output path. Thanks From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason MacDonald Sent: Tuesday, February 03, 2015 10:56 AM To: OpenSceneGraph Users Subject: Re: [osg-users] GL_GEOMETRY_SHADER_EXT not declared Thanks Robert, GLDefines attempts to include osg/GL I don't seem to have this file, nor can I locate it in the SVN anywhere. I don't understand your question: how you get on I use TortoiseSVN and connect to http://svn.openscenegraph.org/osg Building with: Windows 7 64bit Mingw64 4.8.1 posix seh rev5 I've been using OSG for a while now, and am attempting an upgrade from rev 13782 From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Tuesday, February 03, 2015 10:25 AM To: OpenSceneGraph Users Subject: Re: [osg-users] GL_GEOMETRY_SHADER_EXT not declared Hi Jason, The GL_GEOMETRY_SHADER_EXT should now be GL_GEOMETRY_SHADER as this is what GLDefines and modern OpenGL provides. I have checked this fix into svn/trunk. Could you update to latest in svn/trunk and let me know how you get on. Cheers, Robert On 3 February 2015 at 15:24, Jason MacDonald jason.macdon...@ditchwitch.commailto:jason.macdon...@ditchwitch.com wrote: I just checked out the latest revision from the trunk (rev 14678) and attempted to compile. I receive the following compiler error: In file included from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/StateAttribute:20:0, from C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/AlphaFunc:17, from C:\Users\jason\Desktop\dev\OpenSceneGraph\src\osg\AlphaFunc.cpp:14: C:/Users/jason/Desktop/dev/OpenSceneGraph/include/osg/Shader:93:24: error: 'GL_GEOMETRY_SHADER_EXT' was not declared in this scope GEOMETRY = GL_GEOMETRY_SHADER_EXT, It appears this was originally defined in include/osg/GL2Extensions but was recently removed? What is the proper fix to redefine this? (and other possible errors I will receive) Thank you, Jason This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] To Convert QImage to OSG::Image
Here is my method: QImage glimg(QGLWidget::convertToGLFormat(img-image())); //image() is the QImage osg::Image* osgImg = new osg::Image; unsigned char* bits = new unsigned char[glimg.byteCount()]; memcpy(bits, glimg.bits(),glimg.byteCount()); osgImg-setImage(img-pixelWidth(), img-pixelHeight(), 1, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, bits, osg::Image::USE_NEW_DELETE); -Original Message- From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of manish Choudhary Sent: Thursday, December 04, 2014 4:18 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] To Convert QImage to OSG::Image Hi, In my application I required to convert QImage to osg::Image to use that as a texture to wrap it on model. What is the best way to convert QImage to Osg::Image ? Thank you! Cheers, manish -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61976#61976 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Positional Animation
I'm unsure of your method, but here is how I handle it: _position is a PositionAttitudeTransform Quat h,r,p; h.makeRotate(osg::DegreesToRadians(heading), Vec3d(0,0,1)); p.makeRotate(osg::DegreesToRadians(pitch), Vec3d(0,1,0)); r.makeRotate(osg::DegreesToRadians(roll), Vec3d(1,0,0)); _position-setAttitude(r*p*h); Jason -Original Message- From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris Hidden Sent: Friday, September 05, 2014 5:35 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Positional Animation Hey everyone. I may be interpreting how this is done improperly, but all I want at the moment is to animate two hand models. I have two osg::MatrixTransform objects which I add my loaded hand models too. I then attach an instance of a class that extends from osg::NodeCallback Then in that class i have: Code: public: HandMovementX() :incrementer(-0.5), incrementer2(-0.5), pitch(-90.0), roll(12.0){} virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { OSG_FATAL Being called std::endl; roll += incrementer2; if (roll 57) incrementer2 = -0.5; if (roll -33) incrementer2 = 0.5; pitch += incrementer; if (pitch -135) incrementer = 0.5; if (pitch -90) incrementer = -0.5; osg::MatrixTransform *trans = dynamic_castosg::MatrixTransform * (node); if (trans != NULL) { osg::Matrixd handRotation; handRotation.makeRotate( osg::inDegrees(90.0f), osg::X_AXIS, osg::inDegrees(pitch), osg::Y_AXIS, osg::inDegrees(roll), osg::Z_AXIS ); trans-setMatrix(handRotation * osg::Matrix::translate(15, 0, 8) ); worldCoordMatrix = osg::computeLocalToWorld(nv-getNodePath()); } traverse(node, nv); } private: osg::Matrix worldCoordMatrix; float pitch; float roll; float incrementer; float incrementer2; The hands are moving, but not at all how I want them too and it seems that it animates first the Y axis and then the Z axis and then the translate. I want all positions to be taken into account in a single movement on each frame. Am I approaching this totally wrong or what? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=60958#60958 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] loading animated GIFs or TIFF files with OSG plug-ins?
GIF files are supported through the ImageStream class. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=57202#57202 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deprecated osgViewer::computIntersections
Hi, That is the exact build that changed things up. Revision 13710 fixes the uninitialized epsilon, but revision 13753 changed things up again. Cheers, Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56671#56671 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deprecated osgViewer::computIntersections
Hi, I'm not sure of the details of your problem, but I recently had a problem with intersections as well. The epsilon value was changed in LineSegmentIntersector.cpp line 410. I changed back to 1e-4 from 1e-13 and it solved my problems. Cheers, Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56660#56660 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Compute Intersections with GL_POINT drawable
Hello, I am trying to do some hit tests on a geode that only has one drawable of a GL_POINT. It seems my hit test only picks up the very center of the point, no matter how large I draw the point. Could I get some guidance on how to pick the object using the actual size? Here is the picking code: Code: osg::Node *hitObj = NULL; osg::ref_ptrosgUtil::PolytopeIntersector picker = pick(x,y,view); if (!picker-containsIntersections()) { return false; } osgUtil::PolytopeIntersector::Intersections::const_iterator it; for (it = picker-getIntersections().begin(); it!=picker-getIntersections().end(); ++it) { const osg::NodePath nodePath = it-nodePath; unsigned int idx = nodePath.size(); while (idx--) { hitObj = nodePath[idx]; switch (m_state) { case DEFAULT: if (dynamic_castShape*(hitObj) !plan-locked()) { return true; } . osg::ref_ptrosgUtil::PolytopeIntersector Picker::pick(float x, float y, osgViewer::View *view) { float win = 1; osg::ref_ptrosgUtil::PolytopeIntersector picker = new osgUtil::PolytopeIntersector(osgUtil::Intersector::WINDOW, x-win,y-win,x+win,y+win); osgUtil::IntersectionVisitor iv(picker.get()); view-getCamera()-accept(iv); return picker.get(); } And here is the geode: Code: Geometry* geom = new Geometry; Vec3Array* vert = new Vec3Array; vert-push_back(Vec3(0,0,0)); geom-setVertexArray(vert); geom-addPrimitiveSet(new DrawArrays(osg::PrimitiveSet::POINTS,0,1)); StateSet* state = geom-getOrCreateStateSet(); state-setMode(GL_LIGHTING, StateAttribute::OFF | StateAttribute::PROTECTED); state-setAttribute(new Point(20), StateAttribute::ON); state-setMode(GL_POINT_SMOOTH, StateAttribute::ON); Geode* geode = new Geode; geode-addDrawable(geom); geode-setCullingActive(false); ColorSetterVisitor color(Vec4(1,1,1,1)); geode-accept(color); addChild(geode); [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56436#56436 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgWidget Frame borders
Thank you for your help. Modifying the textures to use CLAMP_TO_EDGE has a positive effect, but does not fix the problem entirely. See attached image. The dark pixels seem to come from some other blending going on... If I switch the theme I use to a full white 66x66 image, the lines do not show. Do you have any more advice for me? Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48442#48442 attachment: frame.png___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgWidget Frame borders
(I am reposting this because of a mailing list error I received the first time) I am having trouble with osgWidget::Frame and the included osgwidgetframe example program. There are pixel gaps in between the corners and borders that make the frame look quite awful. I am guessing there are some ever so slight rounding errors when computing the quad locations. See attached image. Are there any work arounds? Thanks, Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=48409#48409 attachment: frame.png___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgWidget examples dataset
I am having the same issue with the pixel gap. Did you make any progress on it? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47998#47998 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Incorrect rendering when modifying camera
Hello, I am new to OSG and having trouble with modifying the camera. I have added my own event handler to process keyboard inputs to change the camera view. This handler holds references to 5 camera manipulators, and upon a KEYDOWN, it switches to the correct camera manipulator as such: Code: .. if (key == '1' m_topCamera.valid()) { m_scene-setCameraManipulator(m_topCamera, false); m_topCamera-update(); return true; } if (key == '2' m_sideCamera.valid()) { m_scene-setCameraManipulator(m_sideCamera, false); m_sideCamera-update(); return true; } if (key == '4' m_userCamera.valid()) { m_scene-setCameraManipulator(m_userCamera, false); m_userCamera-update(); return true; } . m_topCamera is an OrthoCamera derived from StandardManipulator m_userCamera is a UserCamera derived from FirstPersonManipulator each has a _camera member that points to the same instance Code: void OrthoCamera::update() { double aR,l,r,b,t,n,f, fov; if (_camera-getProjectionMatrixAsOrtho(l,r,b,t,n,f)) { aR = fabs(r-l)/fabs(t-b); _camera-setProjectionMatrixAsOrtho2D(-_zoom*aR, _zoom*aR, -_zoom, _zoom); } else { _camera-getProjectionMatrixAsPerspective(fov,aR,n,f); _camera-setProjectionMatrixAsOrtho2D(-_zoom*aR, _zoom*aR, -_zoom, _zoom); } } Code: void UserCamera::update() { double aR,l,r,b,t,n,f, fov; if (_camera-getProjectionMatrixAsOrtho(l,r,b,t,n,f)) { aR = fabs(r-l)/fabs(t-b); _camera-setProjectionMatrixAsPerspective(54.0, aR, n, f); } else { _camera-getProjectionMatrixAsPerspective(fov,aR,n,f); _camera-setProjectionMatrixAsPerspective(fov, aR, n, f); } } The problem: When switching back and forth from top camera to user camera, everything works great. However, when switching from side camera to user camera, all the normals appear to be inverted... all the lighting is messed up and I am seeing the inside of objects. It also seems to draw objects in front of objects that should be hidden. This problem is fixed when I go back to top camera then back to user camera. Am I needing to do some type of invalidating to get things refreshed? Sorry, very new to OSG and unaware of all the functions. Thanks, Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47827#47827 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Incorrect rendering when modifying camera
Well, I figured it out. The near plane was becoming negative, so now I fix it to 1.0f when in perspective mode. Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47858#47858 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Problems with OSG 3.0.1, Qt 4.8.0, mingw 64-bit
I am using Qt 4.7.0 with mingw 32bit. I had possibly similar problems when first trying to get OSG to work with Qt. It ended up being that I was building OSG in Release mode, but everything else was in debug. Have you tried building your Qt program in Release mode? You can build OSG in Debug by setting the CMAKE_BUILD_TYPE option to 'Debug' in CMake. (I notice this does not give the plugins the proper appended 'd' to the dll's, but doing so manually worked.) Jason -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47866#47866 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org