本文整理汇总了C++中Matrix4x4::RotateY方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4x4::RotateY方法的具体用法?C++ Matrix4x4::RotateY怎么用?C++ Matrix4x4::RotateY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4x4
的用法示例。
在下文中一共展示了Matrix4x4::RotateY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
ProcessRotateY(Matrix4x4& aMatrix, const nsCSSValue::Array* aData)
{
NS_PRECONDITION(aData->Count() == 2, "Invalid array!");
double theta = aData->Item(1).GetAngleValueInRadians();
aMatrix.RotateY(theta);
}
示例2: MakeTore
Mesh MakeTore(unsigned int precision, std::shared_ptr<Texture> & texture)
{
Mesh::VertexBuffer vb;
vb.reserve((precision + 1)*(precision + 1));
float angle = (2 * 3.141592653589f) / precision;
Matrix4x4 big = Matrix4x4::Identity;
big.Translate(2.0f, 0.0f, 0.0f);
for (unsigned int bg = 0; bg <= precision; bg++)
{
Matrix4x4 small = Matrix4x4::Identity;
small.Translate(0.8f, 0.0f, 0.0f);
for (unsigned int sm = 0; sm <= precision; sm++)
{
vb.emplace_back(std::make_pair<>(Transform(Transform(Vec3f(), small), big),
Vec2f(texture->m_mipmaps[0].m_width*(float)bg / precision, texture->m_mipmaps[0].m_height*(float)sm / precision)));
small.RotateZ(angle);
}
big.RotateY(angle);
}
Mesh result(std::move(vb));
for (unsigned int bg = 0; bg<precision; bg++)
{
std::vector<unsigned int> ib;
ib.reserve((precision)* 2 + 2);
ib.emplace_back(bg *(precision + 1));
ib.emplace_back((bg + 1)*(precision + 1));
for (unsigned int i = 1; i <= precision; i++)
{
ib.emplace_back(bg *(precision + 1) + i);
ib.emplace_back((bg + 1)*(precision + 1) + i);
}
result.AddStrip(std::move<>(ib));
}
result.SetTexture(texture);
return result;
}