当前位置: 首页>>代码示例>>C++>>正文


C++ TransformNode::translate方法代码示例

本文整理汇总了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();
}
开发者ID:Nemrtvej,项目名称:CVUT-PGR,代码行数:63,代码来源:Dynamic1.cpp

示例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();
}
开发者ID:zuchermann,项目名称:GraphicsClass,代码行数:23,代码来源:drawing.cpp


注:本文中的TransformNode::translate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。