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


C++ Model::GetObjectList方法代码示例

本文整理汇总了C++中Model::GetObjectList方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::GetObjectList方法的具体用法?C++ Model::GetObjectList怎么用?C++ Model::GetObjectList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model的用法示例。


在下文中一共展示了Model::GetObjectList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrawScene

void UVViewWindow::DrawScene ()
{
	Model *mdl = editor->GetMdl ();
	glDisable (GL_CULL_FACE);
	glDisable (GL_DEPTH_TEST);
	glColor3ub (255,255,255);

	const float border=0.1f;
	const float scale=2.0f*(1.0f-border);

	glPushMatrix ();
	glScalef (scale, scale, 1.0f);
	glTranslatef (-0.5f,-0.5f,1.0f);

	if (SetupChannelMask ())
	{
		// draw texture on background
		glBegin (GL_QUADS);
			glTexCoord2f(-border, -border);
			glVertex2f  (-border, -border);
			glTexCoord2f (1.0f+border, -border);
			glVertex2f   (1.0f+border, -border);
			glTexCoord2f (1.0f+border,  1.0f+border);
			glVertex2f   (1.0f+border,  1.0f+border);
			glTexCoord2f(-border,  1.0f+border);
			glVertex2f  (-border,  1.0f+border);
		glEnd ();

		DisableChannelMask ();
	}

	// draw (0,0)-(1,1) texture box
	glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
	glBegin (GL_QUADS);
		glVertex2f (0.0f, 0.0f);
		glVertex2f (1.0f, 0.0f);
		glVertex2f (1.0f, 1.0f);
		glVertex2f (0.0f, 1.0f);
	glEnd ();

	// draw model vertices
	vector <MdlObject*> objs = mdl->GetObjectList ();
	for (unsigned int a=0;a<objs.size();a++) {
		MdlObject *obj = objs[a];
		for (PolyIterator pi(obj);!pi.End();pi.Next()) {
			if (!pi.verts())
				continue;

			glBegin(GL_POLYGON);
			for (unsigned int v=0;v<pi->verts.size();v++) {
				Vertex &vrt = (* pi.verts()) [pi->verts[v]];
				glVertex2f (vrt.tc[0].x, vrt.tc[0].y);
			}
			glEnd ();
		}
	}
	glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);

	glPopMatrix ();
}
开发者ID:Neoniet,项目名称:upspring,代码行数:60,代码来源:UVMappingUI.cpp

示例2: mirrorUVs

void MappingUI::mirrorUVs()
{
	Model* mdl = callback->GetMdl ();
	vector<MdlObject*> obj = mdl->GetObjectList ();

	for (unsigned int a=0;a<obj.size();a++)
	{
		MdlObject *o = obj[a];

		for (VertexIterator vi(o); !vi.End(); vi.Next())
			vi->tc[0].x = 1.0f - vi->tc[0].x;
	}
}
开发者ID:Neoniet,项目名称:upspring,代码行数:13,代码来源:UVMappingUI.cpp


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