Hi Nebi, You can put osg::MatrixTransform on top of the group and setMatrix(myRotateMatrix). And you construct myRotateMatrix with Quaternion, something like this:
osg::Quat q; q.makeRotate(osg::Vec3(0,1,0),osg::Vec3(0,angle,0)); osg::Matrix myRotateMatrix; myRotateMatrix = osg::Matrix::rotate(q); osgh::ref_ptr<osg;;MatrixTransform> mxt = new osg::MatrixTransform; mxt.setMatrix(myRotateMatrix); mxt->addChild(myTextGroup); Something like this On Sun, Feb 20, 2022 at 5:03 AM Nebi Sarikaya <[email protected]> wrote: > Hello, > > This may be an old subject, but how do you rotate all osg::Text's as a > group in 2D space? > > Thanks > > On Monday, January 7, 2019 at 5:20:25 AM UTC-5 [email protected] wrote: > >> Well, it's hard to say because I don't really know how you are doing it >> now, but it seems to me like you're spending a lot of effort rotating and >> positioning each text element individually. Normally, I don't go through >> that process. >> >> Normally, I make a hierarchy of a few groups, each with various children >> individually positioned. Then, I can adjust the overall position and >> rotation of the whole set by applying position and rotation transforms to >> the Group node, not to each text or other sub-element. >> >> From your description (maybe I misinterpreted what you were saying) it >> didn't sound like you were doing it this way, and I worried that you were >> making unnecessary work for yourself as a result. >> >> >> >> On Mon, Jan 7, 2019 at 8:40 AM Nebi Sarikaya <[email protected]> wrote: >> >>> Hi Chris; >>> >>> Can you be more specific on "I usually put all of the text and HUD >>> elements into a group and position them relative to the group and then >>> rotate and shift that group. All the sub-children will rotate properly. " ? >>> >>> Thank you! >>> >>> Cheers, >>> Nebi >>> >>> ------------------ >>> Read this topic online here: >>> http://forum.openscenegraph.org/viewtopic.php?p=75394#75394 >>> >>> >>> >>> >>> >>> _______________________________________________ >>> osg-users mailing list >>> [email protected] >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >>> >> >> >> -- >> Chris 'Xenon' Hanson, omo sanza lettere. [email protected] >> 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 <https://twitter.com/alphapixel> facebook.com/alphapixel (775) >> 623-PIXL [7495] >> > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/osg-users/fa4f53fd-c5cc-4e3e-bf9a-a27a3eb766ban%40googlegroups.com > <https://groups.google.com/d/msgid/osg-users/fa4f53fd-c5cc-4e3e-bf9a-a27a3eb766ban%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- trajce nikolov nick -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/CAO-%2BzinV3zNXNUmf0GBn6qGMm_eUiMtRZSfZjnsjExxTJ6ARgQ%40mail.gmail.com.
