本文整理汇总了C++中ModelObject::SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelObject::SetPosition方法的具体用法?C++ ModelObject::SetPosition怎么用?C++ ModelObject::SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelObject
的用法示例。
在下文中一共展示了ModelObject::SetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateObject
void Application::CreateObject(UINT id)
{
DestroyObjects();
if ( id == 1)
m_ModelObjects.push_back(new Triangle());
else if ( id == 2)
m_ModelObjects.push_back(new Pyramid());
else if ( id == 3)
m_ModelObjects.push_back(new SierpinskiTriangle(2));
else if ( id == 4)
m_ModelObjects.push_back(new SierpinskiPyramid(1));
else if ( id == 5)
m_ModelObjects.push_back(new Cylinder(1, 0.5, 1, 4, 2));
else if ( id == 6)
m_ModelObjects.push_back(new Geosphere(1,4));
else if ( id == 7)
m_ModelObjects.push_back(new Grid(1,1, 50,50));
else if ( id == 8)
m_ModelObjects.push_back(new Wave(1,1, 50,50));
else if ( id == 9)
m_ModelObjects.push_back(new TestObject("Models/skull.txt"));
else if (id == 0)
{
ModelObject* ground = new Grid(100, 100, 10, 10);
ground->SetPosition(0, -1, 0);
ground->GetMaterial()->Ambient = DirectX::XMFLOAT4(0.3f, 0.3f, 0.3f, 1.0f);
ground->GetMaterial()->Diffuse = DirectX::XMFLOAT4(1.0f, 0.0f, 0.0f, 1.0f);
ground->GetMaterial()->Specular = DirectX::XMFLOAT4(0.2f, 0.2f, 0.2f, 100.0f);
m_ModelObjects.push_back(ground);
ModelObject* skull = new TestObject("Models/skull.txt");
skull->GetMaterial()->Ambient = DirectX::XMFLOAT4(0.f, 0.f, 0.f, 1.0f);
skull->GetMaterial()->Diffuse = DirectX::XMFLOAT4(.3f, 0.3f, 0.3f, 1.0f);
skull->GetMaterial()->Specular = DirectX::XMFLOAT4(0.2f, 0.2f, 0.2f, 100.0f);
m_ModelObjects.push_back(skull);
}
std::shared_ptr<MeshData> data = std::make_shared<MeshData>();
for each (auto model in m_ModelObjects)
{
model->Initialize(data);
}