本文整理汇总了C++中DiCullNode::CreateChild方法的典型用法代码示例。如果您正苦于以下问题:C++ DiCullNode::CreateChild方法的具体用法?C++ DiCullNode::CreateChild怎么用?C++ DiCullNode::CreateChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiCullNode
的用法示例。
在下文中一共展示了DiCullNode::CreateChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitScene
void InitScene()
{
DiSceneManager* sm = DiBase::Driver->GetSceneManager();
mat = DiMaterial::QuickCreate("lambert_v", "lambert_p");
mat->SetDiffuse(DiColor::White);
sm->SetAmbientColor(DiColor(0.1f, 0.1f, 0.1f, 0.1f));
DiDirLightPtr dirlight = make_shared<DiDirLight>();
sm->AttachObject(dirlight);
dirlight->SetColor(DiColor());
dirlight->SetDirection(DiVec3(-1, -1, -2).normalisedCopy());
int amount = 2;
DiCullNode* parent = sm->GetRootNode();
for (int i = 0; i < amount; i++)
{
DiSimpleShapePtr model = make_shared<DiSimpleShape>();
model->CreateBox(10);
model->SetMaterial(mat);
DiCullNode* node = parent->CreateChild();
node->AttachObject(model);
node->Translate(10, 0, 0);
nodes.push_back(node);
parent = node;
}
parent = sm->GetRootNode();
for (int i = 0; i < amount; i++)
{
DiSimpleShapePtr model = make_shared<DiSimpleShape>();
model->CreateBox(10);
model->SetMaterial(mat);
DiCullNode* node = parent->CreateChild();
node->AttachObject(model);
node->Translate(-10, 0, 0);
nodes.push_back(node);
parent = node;
}
parent = sm->GetRootNode();
for (int i = 0; i < amount; i++)
{
DiSimpleShapePtr model = make_shared<DiSimpleShape>();
model->CreateBox(10);
model->SetMaterial(mat);
DiCullNode* node = parent->CreateChild();
node->AttachObject(model);
node->Translate(0, 10, 0);
nodes.push_back(node);
parent = node;
}
parent = sm->GetRootNode();
for (int i = 0; i < amount; i++)
{
DiSimpleShapePtr model = make_shared<DiSimpleShape>();
model->CreateBox(10);
model->SetMaterial(mat);
DiCullNode* node = parent->CreateChild();
node->AttachObject(model);
node->Translate(0, -10, 0);
nodes.push_back(node);
parent = node;
}
parent = sm->GetRootNode();
for (int i = 0; i < amount; i++)
{
DiSimpleShapePtr model = make_shared<DiSimpleShape>();
model->CreateBox(10);
model->SetMaterial(mat);
DiCullNode* node = parent->CreateChild();
node->AttachObject(model);
node->Translate(0, 0, 10);
nodes.push_back(node);
parent = node;
}
parent = sm->GetRootNode();
for (int i = 0; i < amount; i++)
{
DiSimpleShapePtr model = make_shared<DiSimpleShape>();
model->CreateBox(10);
model->SetMaterial(mat);
DiCullNode* node = parent->CreateChild();
node->AttachObject(model);
node->Translate(0, 0, -10);
nodes.push_back(node);
parent = node;
}
//.........这里部分代码省略.........