本文整理汇总了C++中Pipeline::GetWPTrans方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipeline::GetWPTrans方法的具体用法?C++ Pipeline::GetWPTrans怎么用?C++ Pipeline::GetWPTrans使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline::GetWPTrans方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderSceneCB
static void RenderSceneCB()
{
glClear(GL_COLOR_BUFFER_BIT);
static float Scale = 0.0f;
Scale += 0.1f;
Pipeline p;
p.Rotate(0.0f, Scale, 0.0f);
p.WorldPos(0.0f, 0.0f, 5.0f);
p.SetPerspectiveProj(gPersProjInfo);
glUniformMatrix4fv(gWorldLocation, 1, GL_TRUE, (const GLfloat*)p.GetWPTrans());
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBO);
glDrawElements(GL_TRIANGLES, 12, GL_UNSIGNED_INT, 0);
glDisableVertexAttribArray(0);
glutSwapBuffers();
}
示例2: CameraPos
//.........这里部分代码省略.........
pipeLine.WorldPos(sinf(scale), 0.0f, 0.0f);
pipeLine.Rotate(sinf(scale) * 90.0f, sinf(scale) * 90.0f, sinf(scale) * 90.0f);
/// Load the matrix into the shader.
glUniformMatrix4fv(_gWorldLocation, 1, GL_TRUE, (const GLfloat*)pipeLine.GetWorldTrans());
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, _VBO);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _IBO);
glDrawElements(GL_TRIANGLES, 12, GL_UNSIGNED_INT, 0);
glDisableVertexAttribArray(0);
glutSwapBuffers();
};
case 12:
return [ & ]() {
glClear(GL_COLOR_BUFFER_BIT);
/// allocate a static variable scale
static float scale = 0.0f;
/// increment scale by 0.001.
scale += 0.01f;
Pipeline pipeLine;
pipeLine.Rotate(0.0f, scale, 0.0f);
pipeLine.WorldPos(0.0f, 0.0f, 5.0f);
pipeLine.SetPerspectiveProj(_gPersProjInfo);
/// Load the matrix into the shader.
glUniformMatrix4fv(_gWorldLocation, 1, GL_TRUE, (const GLfloat*)pipeLine.GetWPTrans());
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, _VBO);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _IBO);
glDrawElements(GL_TRIANGLES, 12, GL_UNSIGNED_INT, 0);
glDisableVertexAttribArray(0);
glutSwapBuffers();
// QThread::msleep(1);
};
case 13:
return [ & ]() {
glClear(GL_COLOR_BUFFER_BIT);
/// allocate a static variable scale
static float scale = 0.0f;
/// increment scale by 0.001.
scale += 0.01f;
Pipeline pipeLine;
pipeLine.Rotate(0.0f, scale, 0.0f);
pipeLine.WorldPos(0.0f, 0.0f, 3.0f);
Vector3f CameraPos(0.0f, 0.0f, -3.0f);
Vector3f CameraTarget(0.0f, 0.0f, 2.0f);
Vector3f CameraUp(0.0f, 1.0f, 0.0f);
pipeLine.SetCamera(CameraPos, CameraTarget, CameraUp);
pipeLine.SetPerspectiveProj(_gPersProjInfo);