本文整理汇总了C++中MeshPtr::GetGeometrySet方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::GetGeometrySet方法的具体用法?C++ MeshPtr::GetGeometrySet怎么用?C++ MeshPtr::GetGeometrySet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::GetGeometrySet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateCornellBox
MeshNode* SceneCreator::CreateCornellBox() {
MeshPtr box = MeshCreator::CreateCube(10, 1, Vector<3,float>(1.0f, 1.0f, 1.0f), true);
IDataBlockPtr color = Float4DataBlockPtr(new DataBlock<4, float>(box->GetGeometrySet()->GetSize()));
for (unsigned int i = 0; i < color->GetSize(); ++i)
color->SetElement(i, Vector<4, float>(1.0, 1.0, 1.0, 1.0));
box->GetGeometrySet()->AddAttributeList("color", color);
IDataBlockPtr colors = box->GetGeometrySet()->GetColors();
Vector<4,float> red(1.0f, 0.0f, 0.0f, 1.0f);
colors->SetElement(8, red);
colors->SetElement(9, red);
colors->SetElement(10, red);
colors->SetElement(11, red);
Vector<4,float> blue(0.0f, 0.0f, 0.8f, 1.0f);
colors->SetElement(12, blue);
colors->SetElement(13, blue);
colors->SetElement(14, blue);
colors->SetElement(15, blue);
// Vector<4,float> transparent(0.0f, 0.0f, 0.8f, 0.0f);
// colors->SetElement(16, transparent);
// colors->SetElement(17, transparent);
// colors->SetElement(18, transparent);
// colors->SetElement(19, transparent);
return new MeshNode(box);
}
示例2: CreateSmallBox
ISceneNode* SceneCreator::CreateSmallBox() {
MeshPtr box = MeshCreator::CreateCube(3, 1, Vector<3,float>(1.0f, 1.0f, 1.0f));
IDataBlockPtr color = Float4DataBlockPtr(new DataBlock<4, float>(box->GetGeometrySet()->GetSize()));
for (unsigned int i = 0; i < color->GetSize(); ++i)
color->SetElement(i, Vector<4, float>(1.0, 1.0, 1.0, 1.0));
box->GetGeometrySet()->AddAttributeList("color", color);
return new MeshNode(box);
}
示例3: Rotate
MeshPtr Rotate(MeshPtr mesh, Quaternion<float> rotate) {
GeometrySetPtr newGeom = Rotate(mesh->GetGeometrySet(), rotate);
return MeshPtr(new Mesh(mesh->GetIndices(),
mesh->GetType(),
newGeom,
mesh->GetMaterial(),
mesh->GetIndexOffset(),
mesh->GetDrawingRange()));
}
示例4: Translate
MeshPtr Translate(MeshPtr mesh, Vector<3, float> move) {
GeometrySetPtr newGeom = Translate(mesh->GetGeometrySet(), move);
return MeshPtr(new Mesh(mesh->GetIndices(),
mesh->GetType(),
newGeom,
mesh->GetMaterial(),
mesh->GetIndexOffset(),
mesh->GetDrawingRange()));
}