当前位置: 首页>>代码示例>>C++>>正文


C++ ModelObject::scale方法代码示例

本文整理汇总了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));
}
开发者ID:FredrickV,项目名称:Basic-OpenGL-Template,代码行数:58,代码来源:rendererbase.cpp


注:本文中的ModelObject::scale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。