本文整理汇总了C++中Model3D::getPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Model3D::getPosition方法的具体用法?C++ Model3D::getPosition怎么用?C++ Model3D::getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model3D
的用法示例。
在下文中一共展示了Model3D::getPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderModelList
/**
Render the model list to the screen
*/
void ShadowableScene::renderModelList(const vector<Model3D*> &modelList)
{
Model3D *aModel;
for (int index = 0; index < modelList.size(); index++)
{
aModel = modelList[index];
glPushMatrix();
// Position the model
Vector3D position(aModel->getPosition());
glTranslatef(position.x, position.y, position.z);
// Orient the model
FTM rotations(aModel->getFTM());
float tempMatrix[] =
{
rotations._00,rotations._01,rotations._02,rotations._03,
rotations._10,rotations._11,rotations._12,rotations._13,
rotations._20,rotations._21,rotations._22,rotations._23,
rotations._30,rotations._31,rotations._32,rotations._33,
};
glMultMatrixf(tempMatrix);
if (!aModel->isLit())
{
// Set the color (for non lit scenes)
glColor3f(aModel->getRed(),aModel->getGreen(),aModel->getBlue());
glDisable(GL_LIGHTING);
}
else
{
// Set the material props (for lit scenes)
Material tempMaterial = aModel->getMaterial();
float matSpecular[] = {tempMaterial.specularRed, tempMaterial.specularGreen, tempMaterial.specularBlue, tempMaterial.specularAlpha};
glMaterialfv(GL_FRONT, GL_SPECULAR, matSpecular);
float matShininess[] = {tempMaterial.shininess};
glMaterialfv(GL_FRONT, GL_SHININESS, matShininess);
float matAmbDiff[] = { tempMaterial.ambientDiffuseRed, tempMaterial.ambientDiffuseGreen, tempMaterial.ambientDiffuseBlue, tempMaterial.ambientDiffuseAlpha };
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, matAmbDiff);
glEnable(GL_LIGHTING);
}
// draw the model
glCallList(aModel->getCallListId());
glPopMatrix();
}
}