本文整理汇总了C++中TransformNode::translate方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformNode::translate方法的具体用法?C++ TransformNode::translate怎么用?C++ TransformNode::translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformNode
的用法示例。
在下文中一共展示了TransformNode::translate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SceneNode
/**
Graph scene init
*/
Dynamic1::Dynamic1()
{
ROOT=new SceneNode("ROOT_WALK_Strahov");
TransformNode* w_B_TRANSFORM=new TransformNode("NODE_WALK_Strahov_tranf", ROOT);
//ArrayModel::createCube("ROOT_WALK_CUBE",1.0f,w_B_ROOT);
w_B_TRANSFORM->scale(glm::vec3(4.0f, 4.0f, 4.0f) );
w_B_TRANSFORM->translate(glm::vec3(0.0, 0.35f, 0.0) );
(new MeshNode(StrahovModel::fileName, w_B_TRANSFORM))->setGeometry(StrahovModel::load());
TransformNode* transform =new TransformNode("transform", w_B_TRANSFORM);
transform->translate(glm::vec3(5.25f,-0.2f,2.5f));
transform->scale(glm::vec3(3.0f));
RotationAnimNode* rot = new RotationAnimNode("rot",transform);
rot->setAxis(glm::vec3(0.0f,1.0f,0.0f));
// rot->setSpeed(M_PI/10);
TrashbinModel::setAsChild(rot,10);
transform =new TransformNode("transform", w_B_TRANSFORM);
transform->translate(glm::vec3(0.2f,-0.18f,0.4f));
transform->scale(glm::vec3(0.85f));
rot = new RotationAnimNode("rot",transform);
rot->setAxis(glm::vec3(0.0f,-1.0f,0.0f));
// rot->setSpeed(M_PI/10);
SofaModel::setAsChild(rot,20);
transform =new TransformNode("transform", w_B_TRANSFORM);
transform->translate(glm::vec3(0.2f,-0.18f,0.4f));
transform->scale(glm::vec3(0.85f));
transform->rotate(180, glm::vec3(0.0f, 1.0f, 0.0f));
SofaModel2::setAsChild(transform, 30);
transform =new TransformNode("transform", w_B_TRANSFORM);
transform->translate(glm::vec3(0.0f,-0.3f,0.0f));
SplineAnimNode* splineAnim = new SplineAnimNode("animacePoKrivce",transform);
splineAnim->setSpeed(M_PI/10);
CrazyCubeWithBase::make("vlastni objekt",1.0f,splineAnim);
transform = new TransformNode("transform", w_B_TRANSFORM );
transform->translate(glm::vec3(-0.59f, -0.05f, -0.1f));
transform->scale(glm::vec3( 0.15f ));
transform->rotate(90.0f,glm::vec3(0.0f,1.0f,0.0f));
SplineAnimNode* splineAnim2 = new SplineAnimNode("fireballAnim", transform);
splineAnim2->setSpeed(M_PI/8);
BillboardNode * billboard = new BillboardNode( "dynamic texture", splineAnim2, BillboardNode::WORLD_ALIGNED );
billboard->initTextures( "../data/dynamic/flame/flame%i.tga", 1, 8 );
billboard->setBlendFunc( GL_ONE, GL_ONE);
update();
ROOT->dump();
}
示例2: copySelectedObjects
// Function to process the Copy menu command.
void copySelectedObjects()
{
if (!noAncestorDescendantSelections()) return;
for (set<TransformNode*>::const_iterator iter = selections.begin();
iter != selections.end();
++iter)
{
TransformNode* target = *iter;
if (target == sceneRoot)
{
sceneRoot = new TransformNode(NULL);
sceneRoot->addChild(target);
target->setParent(sceneRoot);
}
TransformNode* parent = target->getParent();
TransformNode* newThing = target->clone();
parent->addChild(newThing);
newThing->setParent(parent);
target->translate(COPY_OFF_X, COPY_OFF_Y);
}
glutPostRedisplay();
}