本文整理汇总了C++中Transforms::getTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Transforms::getTransform方法的具体用法?C++ Transforms::getTransform怎么用?C++ Transforms::getTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transforms
的用法示例。
在下文中一共展示了Transforms::getTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawParticlesVAO
/**
* You need to fill this in!
*
* Draws each of the particles by making a call to glDrawArrays()
* for each particle with a different ModelViewProjection matrix.
*/
void ParticleEmitter::drawParticlesVAO(Transforms transform, GLuint mvpLocation, GLuint colorLocation){
if (!m_isInitialized){
std::cout << "You must call initGL() before you can draw!" << std::endl;
} else{
// Bind the VAO
glBindVertexArray(m_vao);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glDepthMask(GL_FALSE);
glEnable(GL_BLEND);
GLfloat* color = new GLfloat[4];
color[0] = 1;
color[1] = 1;
color[2] = 1;
color[3] = 1;
// @TODO: Render each particle
for(int i = 0; i < m_maxParticles; ++i)
{
Particle &particle = m_particles[i];
transform.model = glm::translate(glm::mat4(1.f), particle.pos);
glUniformMatrix4fv(mvpLocation, 1, GL_FALSE, glm::value_ptr(transform.getTransform()));
glUniform4f(colorLocation, particle.color.x, particle.color.y, particle.color.z, 2*sqrt(particle.life)/*1.f/glm::length(particle.pos)*/);
glDrawArrays(GL_TRIANGLES, 0, 6);
}
glAccum(GL_MULT, 0.5);
glAccum(GL_ACCUM, 1);
glAccum(GL_RETURN, 1);
// Unbind the VAO
glBindVertexArray(0);
delete[] color;
color = NULL;
glDepthMask(GL_TRUE);
glDisable(GL_BLEND);
}
}