Re: [osg-users] get OpenGL context
Hi, Thanks for you answer Robert. I have already include GLExtensions. I try to use GLX_NV_swap_group and for example, there is this function : Code: typedef Bool ( * JOINSWAPGROUPPROC) (Display* dpy, GLXDrawable drawable, GLuint group); I search to get the current Display*. Thank you! Cheers, Patrice -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35566#35566 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Calculating altitude with LineSegmentIntersector
i have some trouble to calculate the altitude in my application i have - a pagedlod terrain - a runway - and an airplane model i have taken some of the osgearth code in elevationmanager.cpp as a starting point this code is called every frame : Code: Transform tr; mAirplane-GetTransform(tr); tr.GetTranslation(x,y,z); osg::Vec3d start, end, zero; start.x() = x; start.y() = y; start.z() = 5; end.x() = x; end.y() = y; end.z() = -5; zero.x() = x; zero.y() = y; zero.z() = 0; osgUtil::LineSegmentIntersector* i = new osgUtil::LineSegmentIntersector( start, end ); osgUtil::IntersectionVisitor iv; iv.setIntersector( i ); mTerrain-GetOSGNode()-accept( iv ); osgUtil::LineSegmentIntersector::Intersections results = i-getIntersections(); if ( !results.empty() ) { const osgUtil::LineSegmentIntersector::Intersection result = *results.begin(); osg::Vec3d isectPoint = result.getWorldIntersectPoint(); double out_elevation = (isectPoint-end).length2() (zero-end).length2() ? (isectPoint-zero).length() : -(isectPoint-zero).length(); std::cout distance std::endl; ps : i am using delta3D the problem is that the result out_elevation is always a static number and it don't change when i move the airplane what the simplest formula to calculate the altitude with the LineSegmentIntersector ? thanks and good day -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35567#35567 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] (no subject)
On Wed, Jan 12, 2011 at 6:21 AM, Vivek Kumar Dwivedi vivekcsjm...@gmail.com wrote: Pléase don't send me queries. -- Vivek Dwivedi, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org If want to disable subscription or unsubscribe then simply follow the list to the mailing list admin page - it's appended to all posts (see above you post even had all the info you need). Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] (no subject)
Hi Robert, Could you remove him from the mailing list ? he have sent dozens of mails like this. Mourad If want to disable subscription or unsubscribe then simply follow the list to the mailing list admin page - it's appended to all posts (see above you post even had all the info you need). Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shader Update Latency?!
Hi Guo, On Wed, Jan 12, 2011 at 7:04 AM, Guo Chow guo.c...@gmail.com wrote: I encounter a similar latency problem when I try to update a uniform using camera's view matrix in the uniform's callback. Since this uniform is needed to compute only once per frame, I decide to compute it on CPU before it's submitted to GPU. It seems that when the uniform's callback is called, the camera has not been updated yet, right? Currently I solve this problem by updating the uniform in a PreDrawCallback of the camera. But is this a graceful way to achieve it? By default the osgViewer::Viewer/CompositeViewer runs the update traversal before the camera matrices are set, this is done as camera manipulators might be tracking movement of nodes in the scene which are update in the update traversal so has to be run second. One thing you could do is set the camera view matrix prior to the updateTraversal() method is called, or do the update of your Uniforms explicitly after the updateTraversal(). Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] get OpenGL context
Hi Patrice, The include/osgViewer/api/X11/GraphicWindowX11 has the Display variable. public: // X11 specific access functions Display* getEventDisplay() const { return _eventDisplay; } Display* getDisplayToUse() const ; Window getParent() { return _parent; } Window getWindow() { return _window; } Cursor getCurrentCursor() { return _currentCursor; } Or perhaps you could just modify src/osgViewer/GraphicsWindowX11.cpp directly and the support for the extension directly and then submit to me to merge and then the whole community can help maintain it ;-) Cheers, Robert. On Wed, Jan 12, 2011 at 8:12 AM, Patrice Defond patrice.desfo...@rsacosmos.com wrote: Hi, Thanks for you answer Robert. I have already include GLExtensions. I try to use GLX_NV_swap_group and for example, there is this function : Code: typedef Bool ( * JOINSWAPGROUPPROC) (Display* dpy, GLXDrawable drawable, GLuint group); I search to get the current Display*. Thank you! Cheers, Patrice -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35566#35566 ___ 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] osgmovie and stereo
Hi Robert, I've wondered about this for a while - why does osgstereoimage map all the images to a curved plane? Have I missed something obvious about stereo images? Cheers. Kim. On 11 January 2011 17:14, Robert Osfield robert.osfi...@gmail.com wrote: Hi Vijay, You can play videos in stereo just fine, see the osgstereoimage for an example that use side by side images for the left and right images, and then uses cull masks to rendered alternate subgraphs that pick out the appropriate portion of the image for left and right eyes. Video's are just images that are updated by a background thread so all this code will work just fine. Present3D also has support for doing stereo image and videos. Robert. On Tue, Jan 11, 2011 at 4:52 PM, Vijay Kalivarapu vijayki...@gmail.com wrote: Hi, I have two live video streams that are set apart for left and right eye. Does anyone know if osgmovie can play them in active/passive stereo? If not, what is the best way to play two video streams in stereo? Thank you! Cheers, Vijay -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35543#35543 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LineSegmentIntersector::Intersection contains no indexList
Hi Robert, thanks for the reply. I have used the ShapeDrawable as an example. My code uses nodes read from COLLADA models and it doesn't work there either (those nodes display just fine, with the texture on them, so I know uv mapping is also working). I can't understand why the code allows the calculation of the correct intersection point, but not the reference of the Nodes. It seems to be an artificial limitation. Greetings, Oliver -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35577#35577 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgmovie and stereo
Hi Kim, On Wed, Jan 12, 2011 at 12:02 PM, Kim Bale kcb...@googlemail.com wrote: I've wondered about this for a while - why does osgstereoimage map all the images to a curved plane? Oh a looong way back I wrote the example for a Reality Center that had a cylindrical screen, I've hardly touched the example since. Have I missed something obvious about stereo images? You didn't missing anything obvious ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] gelGlShaderInfoLog returning false
Hi, Right. I had wondered if that may be the problem, but couldn't find anything to confirm it. Thanks for the tip! I also did try attaching a callback and checking it there. I received an unhandled exception error identical to what I received if I tried to access the log before viewer.frame() was called. Joel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35580#35580 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] how to render a scene to image?
Hi, I want to render a scene to image file or bitmap without visible window. How to do this ? I'm newhand. Can anyone give me example code please? Thank you! Cheers, tysen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35579#35579 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to render a scene to image?
Look at osgscreencapture example and the code for pbuffer-only. jp On 12/01/11 14:44, Tysen Chan wrote: Hi, I want to render a scene to image file or bitmap without visible window. How to do this ? I'm newhand. Can anyone give me example code please? Thank you! Cheers, tysen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35579#35579 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to render a scene to image?
I have two question: First:in the osgscreencapture example, there also run osg::viewer::run(). is it must run it ? Second:Is there have methods like opengl render scene to image? forexample: HDC hdc = CreateCompatibleDC(0); HBITMAP hbm = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, (void **) pbits, 0, 0); HGDIOBJ r = SelectObject(hdc, hbm); …… render(); …… -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35582#35582 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Display a triad in a viewport corner
Hey Jean Sébastien, And thanks a lot for your help, it works just fine the way you explained! Antoine ;) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35583#35583 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] get OpenGL context
Thanks ! I 'm not sure i understand what do you mean for modify src/osgViewer/GraphicsWindowX11.cpp I have found an other solution with the function viewerbase::getWindows(Windows ). If i cast the GraphicsWindow into GraphicsWindowX11, i have acces to the function getDisplay() and getWindow(). But i also need an integer for identify the screen ... For example in this function (the second parameter) : Code: Bool glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count); [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35584#35584 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] PERSPECTIVE --FIELD OF VIEW
Hi, I have been looked the perspective projection.But,I dont understood some value in there.Pls help me...Can I change fovy with fovx.Is there a value like fovx.Can I change horizantol value of the fov(x) not fov (y).Other problem is Aspect that I could not understand exactly what it mean Thank you! Cheers, Sümeyra :' -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35585#35585 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Improper rotation
Hi, i'm trying to rotate a rod (part of a 3rd party model) on its Y asxis. I read on OSG Startguide that to do it, i need to find the correct position of my object from the origin and apply a multiplication like T * M * -T. The source code that tries to do it is the follow Code: ing: printVector(Original amtRod trans: , amtRod-getWorldMatrices()[0].getTrans()); printVector(Original amtRod rotate: , amtRod-getWorldMatrices()[0].getRotate()); printVector(\t amtRod center: , amtRod-getBound().center()); osg::Vec3 offset = amtRod-getWorldMatrices()[0].getTrans(); printVector(\t amtRod offset = , offset); osg::Matrix get = osg::Matrix::translate(-amtRod-getBound().center() - offset); osg::Matrix m = amtRod-getMatrix() * osg::Matrix::rotate(rotation, osg::Vec3(0,1,0)); osg::Matrix put = osg::Matrix::translate( amtRod-getBound().center() + offset); amtRod-setMatrix( get * m * put ); printVector(\t get.getTrans = , get.getTrans()); printVector(\t m.getRotate = , m.getRotate()); printVector(\t m.getTrans = , m.getTrans()); printVector(Current amtRod trans: , amtRod-getWorldMatrices()[0].getTrans()); printVector(Current amtRod rotate: , amtRod-getWorldMatrices()[0].getRotate()); (printVector only prints the osg::Vec3 or a osg::Quat in a file). The result isn't what i expect, since it rotates the rod but also translate it, as the following output demonstrates: Original amtRod trans: (0, 0, -309) Original amtRod rotate: (0, 0, 0) amtRod center: (6.55547, 150.952, -142.15) amtRod offset = (0, 0, -309) get.getTrans = (-6.55547, -150.952, 451.15) m.getRotate = (0, -0.130526, 0) m.getTrans = (79.9751, 0, -298.471) Current amtRod trans: (-36.5678, 0, -315.54) Current amtRod rotate: (0, -0.130526, 0) What's wrong in my reasoning? Thank you for help! Cheers, Axel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35586#35586 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Improper rotation
I understood part of the issue, and thus I corrected (part of) the error. Now seems that the rotation and the translation is formally right, but visually translation is wrong. I enclosed 3 pics of the scene, before rotating, after 1st rotation and after 2nd rotation. I correct the source as follows: Code: printVector(Original amtRod trans: , amtRod-getWorldMatrices()[0].getTrans()); printVector(Original amtRod rotate: , amtRod-getWorldMatrices()[0].getRotate()); printVector(\t amtRod center: , amtRod-getBound().center()); osg::Vec3 offset = amtRod-getWorldMatrices()[0].getTrans(); printVector(\t amtRod offset = , offset); osg::Matrix get = osg::Matrix::translate(- offset); osg::Matrix m = amtRod-getMatrix() * osg::Matrix::rotate(rotation, osg::Vec3(0,1,0)); osg::Matrix put = osg::Matrix::translate( offset); amtRod-setMatrix( get * m * put ); printVector(\t get.getTrans = , get.getTrans()); printVector(\t m.getRotate = , m.getRotate()); printVector(\t m.getTrans = , m.getTrans()); printVector(Current amtRod trans: , amtRod-getWorldMatrices()[0].getTrans()); printVector(Current amtRod rotate: , amtRod-getWorldMatrices()[0].getRotate()); Now the output is: Original amtRod trans: (0, 0, -309) Original amtRod rotate: (0, 0, 0) amtRod center: (6.55547, 150.952, -142.15) amtRod offset = (0, 0, -309) get.getTrans = (-0, -0, 309) m.getRotate = (0, -0.130526, 0) m.getTrans = (79.9751, 0, -298.471) Current amtRod trans: (0, 0, -309) Current amtRod rotate: (0, -0.130526, 0) Original amtRod trans: (0, 0, -309) Original amtRod rotate: (0, -0.130526, 0) amtRod center: (-36.8519, 150.952, -146.139) amtRod offset = (0, 0, -309) get.getTrans = (-0, -0, 309) m.getRotate = (0, -0.258819, 0) m.getTrans = (79.9751, 0, -298.471) Current amtRod trans: (-74.5249, 0, -339.869) Current amtRod rotate: (0, -0.258819, 0) Are there suggestions? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35587#35587 Attachments: http://forum.openscenegraph.org//files/after_2nd_rotation_175.png http://forum.openscenegraph.org//files/after_1st_rotation_272.png http://forum.openscenegraph.org//files/before_rotating_202.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problems with osgUtil::TangentSpaceGenerator
Hi, I'm trying to implement a bump mapping shader. That works well for a simple shape like that plane, where I define the tangent attribute manually: Code: Geometry* plane = new Geometry(); Vec3Array* vertices = new Vec3Array(); Vec3Array* normals = new Vec3Array(); DrawElementsUInt* faces = new DrawElementsUInt(PrimitiveSet::TRIANGLES, 0); Vec3Array* texcoords = new Vec3Array(); Vec3Array* tangents = new Vec3Array(); vertices-push_back(Vec3f(1.0f, 0.0f, 1.0f)); vertices-push_back(Vec3f(-1.0f, 0.0f, 1.0f)); vertices-push_back(Vec3f(1.0f, 0.0f, -1.0f)); vertices-push_back(Vec3f(-1.0f, 0.0f, -1.0f)); normals-push_back(Vec3f(0.0f, -1.0f, 0.0f)); texcoords-push_back(Vec3f(1.0f, 1.0f, 1.0f)); texcoords-push_back(Vec3f(0.0f, 1.0f, 1.0f)); texcoords-push_back(Vec3f(1.0f, 0.0f, 1.0f)); texcoords-push_back(Vec3f(0.0f, 0.0f, 1.0f)); faces-push_back(0); faces-push_back(1); faces-push_back(3); faces-push_back(3); faces-push_back(2); faces-push_back(0); tangents-push_back(Vec3(-1,0,0)); plane-setVertexArray(vertices); plane-setNormalArray(normals); plane-setTexCoordArray(0, texcoords); plane-addPrimitiveSet(faces); plane-setNormalBinding(Geometry::BIND_OVERALL); plane-setVertexAttribData(6, Geometry::ArrayData(tangents, Geometry::BIND_OVERALL)); But for more complex shapes I have to use the TangentGenerator. When I try to run this: Code: ref_ptrosgUtil::TangentSpaceGenerator tsg = new osgUtil::TangentSpaceGenerator(); tsg-generate(plane, 0); I get an Debug Assertion Failed with Expression: vector subscript out of range in generate(). Did I forget something? I cannot see the fault. Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35575#35575 ___ 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
If you're using a geocentric database, you can use the osgSim::GetHeightAboveTerrain(...) method to get the altitude of either the terrain itself or an altitude above the terrain at a given lat,lon. This method takes into account paged databases in extracting the correct value... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of issam boughanmi Sent: Wednesday, January 12, 2011 1:46 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Calculating altitude with LineSegmentIntersector i have some trouble to calculate the altitude in my application i have - a pagedlod terrain - a runway - and an airplane model i have taken some of the osgearth code in elevationmanager.cpp as a starting point this code is called every frame : Code: Transform tr; mAirplane-GetTransform(tr); tr.GetTranslation(x,y,z); osg::Vec3d start, end, zero; start.x() = x; start.y() = y; start.z() = 5; end.x() = x; end.y() = y; end.z() = -5; zero.x() = x; zero.y() = y; zero.z() = 0; osgUtil::LineSegmentIntersector* i = new osgUtil::LineSegmentIntersector( start, end ); osgUtil::IntersectionVisitor iv; iv.setIntersector( i ); mTerrain-GetOSGNode()-accept( iv ); osgUtil::LineSegmentIntersector::Intersections results = i-getIntersections(); if ( !results.empty() ) { const osgUtil::LineSegmentIntersector::Intersection result = *results.begin(); osg::Vec3d isectPoint = result.getWorldIntersectPoint(); double out_elevation = (isectPoint-end).length2() (zero-end).length2() ? (isectPoint-zero).length() : -(isectPoint-zero).length(); std::cout distance std::endl; ps : i am using delta3D the problem is that the result out_elevation is always a static number and it don't change when i move the airplane what the simplest formula to calculate the altitude with the LineSegmentIntersector ? thanks and good day -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35567#35567 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PERSPECTIVE --FIELD OF VIEW
May I suggest you look at how OpenGL sets up the projection matrix. This is what OSG uses. gluPerspective is the routine that uses fovy and aspect to set up the projection matrix; It may be more intuitive for you to use the setProjectionMatrixAsFrustum() method in OSG to establish the projection matrix. For example, you could set things up as follows given vertical and horizontal fovs... double left = tan(osg::DegreesToRad(fov_left)) * near; double right = tan(osg::DegreesToRad(fov_right)) * near; double bottom = tan(osg::DegreesToRad(fov_bot)) * near; double top = tan(osg::DegreesToRad(fov_top)) * near; view-getCamera()-setProjectionMatrixAsFrustum(left, right, bottom, top, near, far); where near and far are the frustum near and far clipping planes. -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sümeyra Söyler Sent: Wednesday, January 12, 2011 8:36 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] PERSPECTIVE --FIELD OF VIEW Hi, I have been looked the perspective projection.But,I dont understood some value in there.Pls help me...Can I change fovy with fovx.Is there a value like fovx.Can I change horizantol value of the fov(x) not fov (y).Other problem is Aspect that I could not understand exactly what it mean Thank you! Cheers, Sümeyra :' -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35585#35585 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org smime.p7s Description: S/MIME cryptographic signature ___ 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
Re: [osg-users] Improper rotation
Hi Axel, In the step where you're calculating m, it looks like you're applying the rotation to the original matrix, which includes a translation already. Code: osg::Matrix m = amtRod-getMatrix() * osg::Matrix::rotate(rotation, osg::Vec3(0,1,0)); It sounds like what you want to do is rotate then translate - so you can create a rotation matrix, post-multiply it by a translation matrix (the translation of the original), and set the product as your overall matrix. Something like: Code: osg::Matrix rotation = osg::Matrix::rotate(rotation_amount, rotation_axis); osg::Matrix translation = osg::Matrix::translate(original_translation); amtRod-setMatrix(rotation*translation); I'm not sure why you say that the rotation and translation is formally right - the final translation should be equal to the original translation if you're rotating about a local axis, but it isn't. Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35591#35591 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph website appears to be down, again :)
Hi, I'm also experiencing the same problem (OperationalError: database is locked) when I try to visit www openscenegraph org (Thanks in advance to the admins when it's back online again.) Cheers, Rob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35422#35422 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] MouseY Order Reversal
Greetings All! Gee, this is one of the Issues in OSG that makes me stop and Ask! In a View Class, if you set the camera setting setAllowEventFocus to false, the setMouseYOrientation is changed to Y_INCREASING_DOWNWARDS instead of the other way around (that is default). :| :| :| Why? D Glenn! D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35595#35595 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] multiple tex gen modes in a single scene
Hi all -- Has anyone ever successfully used multiple TexGen modes (say, EYE_LINEAR and OBJECT_LINEAR) on different objects in the same scene? What is the recommended way to do this in OSG? The TexGenNode has a pointer to a TexGen, and the TexGen has the mode. I assume I should create two TexGens, one OBJECT_LINEAR and one EYE_LINEAR, and two TexGenNodes to reference them, and add the two TexGenNodes to the scene graph. Then, I assume I should attach the same two TexGens as StateAttributes to different Node's StateSets as needed. I am running into some issues with this. If it sounds like I'm doing everything right, I'll post a small example that fails, or dig into the OSG code. More than likely, I'm doing something wrong here, so I just wanted to ask what the intended usage is. Thanks, -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] multiple tex gen modes in a single scene
Hi Paul, The TexGenNode should work just like the LightSource. It affects all nodes in the scene graph expect those with GL_TEXTURE_GEN_... set to OFF. So... I've no idea, too, about how to use multiple TexGenNodes to handle different generations in your shoes. :-) A possible way may be to apply two TexGen attributes to nodes and handle OpenGL's positional state issues in callbacks. But it will be much better if we could still make use of TexGenNodes. Cheers, Wang Rui 2011/1/13 Paul Martz pma...@skew-matrix.com: Hi all -- Has anyone ever successfully used multiple TexGen modes (say, EYE_LINEAR and OBJECT_LINEAR) on different objects in the same scene? What is the recommended way to do this in OSG? The TexGenNode has a pointer to a TexGen, and the TexGen has the mode. I assume I should create two TexGens, one OBJECT_LINEAR and one EYE_LINEAR, and two TexGenNodes to reference them, and add the two TexGenNodes to the scene graph. Then, I assume I should attach the same two TexGens as StateAttributes to different Node's StateSets as needed. I am running into some issues with this. If it sounds like I'm doing everything right, I'll post a small example that fails, or dig into the OSG code. More than likely, I'm doing something wrong here, so I just wanted to ask what the intended usage is. Thanks, -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ 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] Display a triad in a viewport corner
Hi, On 12/01/11 16:29, Antoine Rennuit wrote: Hey Jean Sébastien, And thanks a lot for your help, it works just fine the way you explained! if you have time..., a new osg example would be great ;) Then in future we can point people to that. rgds jp Antoine ;) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35583#35583 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PERSPECTIVE --FIELD OF VIEW
Hi, aspect is w/h, so you can get w if given aspect and h. jp On 12/01/11 17:36, Sümeyra Söyler wrote: Hi, I have been looked the perspective projection.But,I dont understood some value in there.Pls help me...Can I change fovy with fovx.Is there a value like fovx.Can I change horizantol value of the fov(x) not fov (y).Other problem is Aspect that I could not understand exactly what it mean Thank you! Cheers, Sümeyra :' -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35585#35585 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Need Help ! How to get Camera Position inside shaders
Heey Guys, I hope you will fine, anyway, i have question about how i can get the camera position inside shader from open scene graph do i must pass it, or open scene graph already do that. Thank you! Cheers, Laith -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35600#35600 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org