本文整理汇总了C++中ModelObject::scale方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelObject::scale方法的具体用法?C++ ModelObject::scale怎么用?C++ ModelObject::scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelObject
的用法示例。
在下文中一共展示了ModelObject::scale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadScene
void RendererBase::loadScene()
{
m_camera->setPosDir(glm::vec3(0.0f, 5.0f, 0.0f), glm::vec2(TO_RADIANS(175.0f), 0.0f));
ModelObject *ground = new ModelObject(&m_modelCube);
ground->scale(glm::vec3(200.0f, 1.0f, 200.0f));
ground->pos(glm::vec3(0.0f, 0.0f, 0.0f));
m_modelObjects.push_back(ground);
int index = 0;
for (int x = 0; x < 8; x++) {
for (int y = 0; y < 8; y++) {
LightPoint *lp = new LightPoint;
lp->position = glm::vec3(-10.0f + (x* 12 ), 5.0f, -20.0f + (y* 12 ));
ModelObject *teapot = new ModelObject(&m_modelTeapot);
teapot->scale(glm::vec3(20.0f, 20.0f, 20.0f));
teapot->pos(glm::vec3(lp->position.x-1.0f,
0.5f,
lp->position.z));
m_pointLights.push_back(lp);
m_modelObjects.push_back(teapot);
}
}
// Textures
m_textureGround.load("Ground_SmoothRocks_1k_d.tga", 16);
m_textureGround.setTextTile(50.0f);
m_textureGround.setKd(glm::vec3(1.0f));
m_textureGround.setShininess(100.0f);
m_textureGround.setSpec(0.1f);
m_textureTeapot.load("Metal_WallPanel_1k_d.tga", 16);
m_textureTeapot.setTextTile(4.0f);
m_textureTeapot.setKd(glm::vec3(1.0f));
m_textureTeapot.setShininess(100.0f);
m_textureTeapot.setSpec(2.7f);
m_textureColorTerrain.setKd(glm::vec3(0.0f, 0.0f, 1.0f));
m_textureColorTerrain.setShininess(100.0f);
m_textureColorTerrain.setSpec(2.7f);
std::vector<glm::vec3> verticesList;
std::vector<glm::vec3> normalsList;
std::vector<glm::vec2> tcList;
std::vector<GLushort> indices;
CreateCube(1, verticesList, normalsList, tcList, indices);
m_terrainCube.fillVertecies(verticesList, normalsList, tcList, indices);
m_terrainCube.pos(glm::vec3(0.0f, 1.0f, 0.0f));
m_terrainCube.scale(glm::vec3(4.0f));
}