Re: [osg-users] Implementation of movement, rotation of scale
Hi, i finded code, but in this function is failed why? Code: osg::Node* addDraggerToScene(osg::Node* scene, const std::string& name) { scene->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); osg::MatrixTransform* selection = new osg::MatrixTransform; selection->addChild(scene); osgManipulator::Dragger* dragger = createDragger(name); osg::Group* root = new osg::Group; root->addChild(dragger); root->addChild(selection); float scale = scene->getBound().radius() * 1.6; dragger->setMatrix(osg::Matrix::scale(scale, scale, scale) * osg::Matrix::translate(scene->getBound().center())); osgManipulator::GridConstraint *con = new osgManipulator::GridConstraint(*selection, osg::Vec3(0, 0, 0), osg::Vec3(30, 30, 30)); osg::ref_ptr m_pManipulator = new osgManipulator::TabBoxDragger; m_pManipulator->addConstraint(con); dragger->addConstraint(con); dragger->addTransformUpdating(selection); // we want the dragger to handle it's own events automatically dragger->setHandleEvents(true); // if we don't set an activation key or mod mask then any mouse click on // the dragger will activate it, however if do define either of ActivationModKeyMask or // and ActivationKeyEvent then you'll have to press either than mod key or the specified key to // be able to activate the dragger when you mouse click on it. Please note the follow allows // activation if either the ctrl key or the 'a' key is pressed and held down. dragger->setActivationModKeyMask(osgGA::GUIEventAdapter::MODKEY_CTRL); dragger->setActivationKeyEvent('a'); return root; } after RETURN failde:( ... Thank you! Cheers, Maxim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76159#76159 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Implementation of movement, rotation of scale
Hi, i finded code, but in this function is failed why? Code: osg::Node* addDraggerToScene(osg::Node* scene, const std::string& name) { scene->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); osg::MatrixTransform* selection = new osg::MatrixTransform; selection->addChild(scene); osgManipulator::Dragger* dragger = createDragger(name); osg::Group* root = new osg::Group; root->addChild(dragger); root->addChild(selection); float scale = scene->getBound().radius() * 1.6; dragger->setMatrix(osg::Matrix::scale(scale, scale, scale) * osg::Matrix::translate(scene->getBound().center())); osgManipulator::GridConstraint *con = new osgManipulator::GridConstraint(*selection, osg::Vec3(0, 0, 0), osg::Vec3(30, 30, 30)); osg::ref_ptr m_pManipulator = new osgManipulator::TabBoxDragger; m_pManipulator->addConstraint(con); dragger->addConstraint(con); dragger->addTransformUpdating(selection); // we want the dragger to handle it's own events automatically dragger->setHandleEvents(true); // if we don't set an activation key or mod mask then any mouse click on // the dragger will activate it, however if do define either of ActivationModKeyMask or // and ActivationKeyEvent then you'll have to press either than mod key or the specified key to // be able to activate the dragger when you mouse click on it. Please note the follow allows // activation if either the ctrl key or the 'a' key is pressed and held down. dragger->setActivationModKeyMask(osgGA::GUIEventAdapter::MODKEY_CTRL); dragger->setActivationKeyEvent('a'); return root; } after RETURN failde:( ... Thank you! Cheers, Maxim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76158#76158 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Implementation of movement, rotation of scale
Hi, I want to move, rotate and scale the object with the help of auxiliary axes, so as done in the blendar, are there any libraries or code? [img]inspector_gizmo_scale.png[/img] ... Thank you! Cheers, Maxim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=76153#76153 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
Alberto Luaces wrote: > "Maxim Senin" writes: > > > > I want to completely detach the door!!! > > > > Nice to know!!! Then what you want is to use > osg::Transform::setReferenceFrame() on the node holding the position of > the door, switching from RELATIVE_RF to ABSOLUTE_RF so its coordinates > are in the global system and not in the coordinate system of the whole > car. > > -- > Alberto > > ___ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- > Post generated by Mail2Forum Is there an example or sample of such a solution? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75914#75914 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
Alberto Luaces wrote: > "Maxim Senin" writes: > > > > Yes, I found the necessary node, what should I do next? > > > > It depends: do you want to completely detach the door, or just rotate it > around its hinges? > > -- > Alberto > > ___ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- > Post generated by Mail2Forum I want to completely detach the door!!! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75911#75911 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
icf80 wrote: > Hi, > > Get this book, it learns basic stufff: > > https://www.amazon.com/OpenSceneGraph-3-0-Beginners-Rui-Wang/dp/1849512825 > > Thank you! > > Cheers, > Catalin this is a bad answer. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75888#75888 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
icf80 wrote: > Hi, > > You have to find the node associated to your object by intersection: > > osgUtil::LineSegmentIntersector::Intersections ints; > bool bHasIntersections = > viewer->computeIntersections(viewer->getCamera(), > osgUtil::Intersector::WINDOW, x, y, ints, CULL_MASK_HERE); > > if (bHasIntersections) > { > const osgUtil::LineSegmentIntersector::Intersection& inter = > *(ints.begin()); > > const osg::NodePath& nodePath = inter.nodePath; > unsigned int idx = nodePath.size(); > while (idx--) > { > osg::Node*node =nodePath[idx]; > > > > > Thank you! > > Cheers, > Catalin Yes, I found the necessary node, what should I do next? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75883#75883 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] Dragging individual model nodes
Hi, I have model - car. It consists of two doors, four wheels . I want select right door by mouse and move it to another area. How and through what should I implement it? Maybe there are examples of this? ... Thank you! Cheers, Maxim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75878#75878 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] QPropertyAnimation with openscengraph window
Hi, i have QWidget and i want him to disappear duration X time. In qt my code works: ... Thank you! Cheers, Maxim Code: #include "mainwindow.h" #include "ui_mainwindow.h" #include #include #include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(); ui->pushButton->setGraphicsEffect(eff); QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity"); a->setDuration(3500); a->setStartValue(0); a->setEndValue(1); a->setEasingCurve(QEasingCurve::InCubic); a->start(QPropertyAnimation::DeleteWhenStopped); //connect(a,SIGNAL(finished()),this,SLOT(hideThisWidget())); connect(ui->pushButton, SIGNAL(clicked(bool)), this, SLOT(hideButton()) ); } MainWindow::~MainWindow() { delete ui; } void MainWindow::hideButton() { QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(); ui->pushButton->setGraphicsEffect(eff); QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity"); a->setDuration(3500); a->setStartValue(1); a->setEndValue(0); a->setEasingCurve(QEasingCurve::OutBack); a->start(QPropertyAnimation::DeleteWhenStopped); } but then i use this code with OSG, he doesn't work. The window where everything happens is osgViewer::CompositeViewer. How can I solve this problem? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=71491#71491 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to change "field of view"(FOV), distance.
Hi, thanks guys!!! Task resolved! ... Thank you! Cheers, Maxim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=71490#71490 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to change "field of view"(FOV), distance.
Hi, How to change "field of view"(FOV) and distance? I used : ... Thank you! Cheers, Maxim Code: osg::CameraView* cameraview = new osg::CameraView(); cameraview->addChild(group); cameraview->setFieldOfView(120.0f); osgViewer::Viewer viewer; viewer.setSceneData(cameraview); but it's not work. Help me please. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=71374#71374 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] KeBox offset
Hi, how move wall image skybox? or make skybox spgete type, not cube? ... Thank you! Cheers, Maxim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=71352#71352 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problems with view .FBX files
Hi, a load .fbx file and have problems with view. Some times i see full view , but then a rotate image i have bad view. What should I do to make the image rotate when it's always full? ... Thank you! Cheers, [/img] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=71328#71328 Attachments: http://forum.openscenegraph.org//files/notwork_932.jpg http://forum.openscenegraph.org//files/notwork1_160.jpg http://forum.openscenegraph.org//files/work_117.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org