Ogre笔记(1)
旋转:
缩放:
Ogre::Entity* ent2 = mSceneMgr->createEntity("MyEntity2","Sinbad.mesh");
Ogre::SceneNode* node2 = mSceneMgr->createSceneNode("Node2");
node->addChild(node2);
node2->setPosition(10,0,0);
node2->pitch(Ogre::Radian(Ogre::Math::HALF_PI)); // 绕x轴旋转, 旋转方式: 弧度
node2->attachObject(ent2);
Ogre::Entity* ent3 = mSceneMgr->createEntity("MyEntity3","Sinbad.mesh");
Ogre::SceneNode* node3 = mSceneMgr->createSceneNode("Node3");
node->addChild(node3);
node3->translate(20,0,0);
node3->yaw(Ogre::Degree(90.0f)); // 绕y轴旋转, 旋转方式: 角度
node3->attachObject(ent3);
Ogre::Entity* ent4 = mSceneMgr->createEntity("MyEntity4","Sinbad.mesh");
Ogre::SceneNode* node4 = mSceneMgr->createSceneNode("Node4");
node->addChild(node4);
node4->setPosition(30,0,0);
node4->roll(Ogre::Radian(Ogre::Math::HALF_PI)); // 绕z轴旋转, 旋转方式: 弧度
node4->attachObject(ent4);
Ogre::Entity* ent3 = mSceneMgr->createEntity("MyEntity3","Sinbad.mesh");
Ogre::SceneNode* node3 = node->createChildSceneNode("node3",Ogre::Vector3(20,0,0)); // node3为node的子节点, 相对node移动(20, 0, 0)
node3->scale(0.2f,0.2f,0.2f); // x, y, z轴方向都缩小为原始大小的0.2倍
node3->attachObject(ent3);
---------------------------------------------------------------------------
You got a dream
You gotta protect it
People can't do something themselves
They wanna tell you you can do it
If you want something
Go get it
You got a dream
You gotta protect it
People can't do something themselves
They wanna tell you you can do it
If you want something
Go get it