de-Roo.Lukas Posted December 19, 2017 Share Posted December 19, 2017 When I rotate the helicopter in the Y axis, the rotation in X-axis (roll) also changes. How to fix the problem, thanks. RotateNode(helicopterNode, Math::quat(0, 1, 0, -val2 * movement_speed *Game::get()->getIFps())); // when it runs, rollValue = helicopterNode->getRotation().getAngle(vec3 (1,0,0)) the rollValue will also change int RotateNode(Unigine::NodePtr node, Unigine::Math::quat rotationDirection) { // getting current node transformation matrix Unigine::Math::Mat4 transform = node->getTransform(); // calculating delta rotation around an arbitrary axis Unigine::Math::quat delta_rotation = Unigine::Math::quat(rotationDirection); // setting node's scale, rotation and position node->setRotation(node->getRotation() * delta_rotation); return 1; } Link to comment
silent Posted December 19, 2017 Share Posted December 19, 2017 Hi Lukas, Hard to say without seeing the actual node and it's hierarchy. Please, also check the following tutorial about basic object movement and rotation: https://developer.unigine.com/en/docs/2.6/start/programmer/transformations Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts