本文整理汇总了C++中Object3D::rotateX方法的典型用法代码示例。如果您正苦于以下问题:C++ Object3D::rotateX方法的具体用法?C++ Object3D::rotateX怎么用?C++ Object3D::rotateX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object3D
的用法示例。
在下文中一共展示了Object3D::rotateX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyPressEvent
void BulletExample::keyPressEvent(KeyEvent& event) {
/* Movement */
if(event.key() == KeyEvent::Key::Down) {
_cameraObject->rotateX(5.0_degf);
} else if(event.key() == KeyEvent::Key::Up) {
_cameraObject->rotateX(-5.0_degf);
} else if(event.key() == KeyEvent::Key::Left) {
_cameraRig->rotateY(-5.0_degf);
} else if(event.key() == KeyEvent::Key::Right) {
_cameraRig->rotateY(5.0_degf);
/* Toggling draw modes */
} else if(event.key() == KeyEvent::Key::D) {
if(_drawCubes && _drawDebug) {
_drawDebug = false;
} else if(_drawCubes && !_drawDebug) {
_drawCubes = false;
_drawDebug = true;
} else if(!_drawCubes && _drawDebug) {
_drawCubes = true;
_drawDebug = true;
}
/* What to shoot */
} else if(event.key() == KeyEvent::Key::S) {
_shootBox ^= true;
} else return;
event.setAccepted();
}
示例2: rotate
void DualQuaternionTransformationTest::rotate() {
{
Object3D o;
o.transform(DualQuaternion::translation({1.0f, -0.3f, 2.3f}));
o.rotateX(Deg(17.0f))
.rotateY(Deg(25.0f))
.rotateZ(Deg(-23.0f))
.rotate(Deg(96.0f), Vector3(1.0f/Constants::sqrt3()));
CORRADE_COMPARE(o.transformationMatrix(),
Matrix4::rotation(Deg(96.0f), Vector3(1.0f/Constants::sqrt3()))*
Matrix4::rotationZ(Deg(-23.0f))*
Matrix4::rotationY(Deg(25.0f))*
Matrix4::rotationX(Deg(17.0f))*
Matrix4::translation({1.0f, -0.3f, 2.3f}));
} {
Object3D o;
o.transform(DualQuaternion::translation({1.0f, -0.3f, 2.3f}));
o.rotateXLocal(Deg(17.0f))
.rotateYLocal(Deg(25.0f))
.rotateZLocal(Deg(-23.0f))
.rotateLocal(Deg(96.0f), Vector3(1.0f/Constants::sqrt3()));
CORRADE_COMPARE(o.transformationMatrix(),
Matrix4::translation({1.0f, -0.3f, 2.3f})*
Matrix4::rotationX(Deg(17.0f))*
Matrix4::rotationY(Deg(25.0f))*
Matrix4::rotationZ(Deg(-23.0f))*
Matrix4::rotation(Deg(96.0f), Vector3(1.0f/Constants::sqrt3())));
}
}
示例3: drawEvent
void MotionBlurExample::drawEvent() {
GL::defaultFramebuffer.clear(GL::FramebufferClear::Color|GL::FramebufferClear::Depth);
camera->draw(drawables);
swapBuffers();
cameraObject->rotateX(Deg(0.5f));
spheres[0]->rotateZ(Deg(-1.0f));
spheres[1]->rotateZ(Deg(0.5f));
spheres[2]->rotateZ(Deg(-0.25f));
redraw();
}
示例4: drawEvent
void MotionBlurExample::drawEvent() {
defaultFramebuffer.clear(DefaultFramebuffer::Clear::Color|DefaultFramebuffer::Clear::Depth);
camera->draw(drawables);
swapBuffers();
cameraObject->rotateX(1.0_degf);
spheres[0]->rotateZ(-2.0_degf);
spheres[1]->rotateZ(1.0_degf);
spheres[2]->rotateZ(-0.5_degf);
Utility::sleep(40);
redraw();
}