本文整理汇总了C++中Object3D::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Object3D::Draw方法的具体用法?C++ Object3D::Draw怎么用?C++ Object3D::Draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object3D
的用法示例。
在下文中一共展示了Object3D::Draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawObject3DAmbient
void DrawObject3DAmbient ( std::string name, vec2 centre, float scale, float angle, float bank )
{
Object3D* obj = GetObject3D(name);
EnableTexturing();
DisableBlending();
obj->BindTextures();
//glUniform3f(UniformLocation("Ambient"), ambient.red(), ambient.green(), ambient.blue());
SetShader("3DBase");
glUniform1f(UniformLocation("specularScale"), obj->SpecularScale());
glUniform1f(UniformLocation("shininess"), obj->Shininess());
Matrices::SetViewMatrix(matrix2x3::Translate(centre));
obj->Draw(scale, angle, bank);
}
示例2: playTrack
//.........这里部分代码省略.........
//Rotation pour la caméra
std::queue<std::pair<float,Uint32>> anglefile;
anglefile.push(std::pair<float,Uint32>(Karts[0]->getAngle(),0));
glUniform3f(uKd, 1, 1, 1);
glUniform3f(uKs, 1, 1, 1);
glUniform1f(uShininess, 2);
glUniform3f(uLightIntensity, 1, 1, 1);
timeElapsed=0;
while(!done) {
Uint32 tStart = SDL_GetTicks();
if(timeElapsed >= FPS && timeElapsed < 2*FPS)
std::cout << "3 ..." << std::endl;
if(timeElapsed >= 2*FPS && timeElapsed < 3*FPS)
std::cout << "2 ..." << std::endl;
if(timeElapsed >= 3*FPS && timeElapsed < 4*FPS)
std::cout << "1 ..." << std::endl;
if(timeElapsed >= 4*FPS && timeElapsed < 5*FPS){
std::cout << "PINAAAAAAAAAAGE !!!" << std::endl;
ready=true;
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
prog2D.use();
//affichage des pouvoirs
powerquad.initDraw();
if (Players[0]->getPower()==NULL){
powerquad.bindTex(texturepower[6]);
}
else{
switch(Players[0]->getPower()->getType()){
case BOOST:
powerquad.bindTex(texturepower[0]);
break;
case ATK_FRONT:
powerquad.bindTex(texturepower[1]);
break;
case ATK_BACK:
powerquad.bindTex(texturepower[2]);
break;
case ATK_ALL:
powerquad.bindTex(texturepower[3]);
break;
case SHIELD:
powerquad.bindTex(texturepower[4]);
break;
case TRAP:
powerquad.bindTex(texturepower[5]);
break;
}
}
powerquad.Draw(locVarTexture);
//Gestion du classement
if( !raceFinished ){
ranking(Karts);
positionQuad.initDraw();
positionQuad.bindTex(textureRank[Karts[0]->getRank()-1]);