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


C++ CC3Mesh类代码示例

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


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

示例1: cc3v

void CC3Billboard::populateAsBoundingRectangle()
{
	CC3Vector* vertices;		// Array of simple vertex location data

	// Start with default initial values
	GLfloat xMin = 0.0f;
	GLfloat xMax = 1.0f;
	GLfloat yMin = 0.0f;
	GLfloat yMax = 1.0f;
	int vCount = 4;
	
	CC3VertexLocations* locArray = CC3VertexLocations::vertexArray();
	locArray->setDrawingMode( GL_TRIANGLE_STRIP );			// Location array will do the drawing as a strip
	locArray->setVertexStride( 0 );							// Tightly packed locations only
	locArray->setElementOffset( 0 );							// Only locations
	locArray->setAllocatedVertexCapacity( vCount );
	vertices = (CC3Vector*)locArray->getVertices();
	
	// Populate vertex locations in the X-Y plane
	vertices[0] = cc3v(xMax, yMax, 0.0f);
	vertices[1] = cc3v(xMin, yMax, 0.0f);
	vertices[2] = cc3v(xMax, yMin, 0.0f);
	vertices[3] = cc3v(xMin, yMin, 0.0f);
	
	// Create mesh with vertex location array
	CC3Mesh* aMesh = CC3Mesh::mesh();
	aMesh->setVertexLocations( locArray );
	setMesh( aMesh );

	updateBoundingMesh();
}
开发者ID:HerdiandKun,项目名称:cocos3d-x,代码行数:31,代码来源:CC3Billboard.cpp

示例2: getShadowCaster

void CC3ShadowVolumeMeshNode::createShadowMesh()
{
	GLuint vertexCount = getShadowCaster()->getVertexCount();
	
	// Create vertexLocation array.
	CC3VertexLocations* locArray = CC3VertexLocations::vertexArray();
	locArray->setDrawingMode( GL_TRIANGLES );
	locArray->setElementSize( 4 );						// We're using homogeneous coordinates!
	locArray->setAllocatedVertexCapacity( vertexCount );
	locArray->setVertexCount( 0 );						// Will be populated dynamically
	locArray->setShouldReleaseRedundantContent( false );	// Shadow vertex data is dynamic
	
	CC3Mesh* aMesh = CC3Mesh::mesh();
	aMesh->setVertexLocations( locArray );
	setMesh( aMesh );
}
开发者ID:ClAndHHL,项目名称:cocos3d-x,代码行数:16,代码来源:CC3ShadowVolumes.cpp

示例3: prepareParametricMesh

void CC3TouchBox::populateBox( const CC3Box& aBox )
{
	CC3Mesh* mesh = prepareParametricMesh();
	
	// Now update the vertex locations with the box data
	GLuint vIdx = 0;
	CC3Vector bbMin = aBox.minimum;
	CC3Vector bbMax = aBox.maximum;
	mesh->setVertexLocation( cc3v(bbMin.x, bbMin.y, bbMin.z), vIdx++ );
	mesh->setVertexLocation( cc3v(bbMin.x, bbMin.y, bbMax.z), vIdx++ );
	mesh->setVertexLocation( cc3v(bbMin.x, bbMax.y, bbMin.z), vIdx++ );
	mesh->setVertexLocation( cc3v(bbMin.x, bbMax.y, bbMax.z), vIdx++ );
	mesh->setVertexLocation( cc3v(bbMax.x, bbMin.y, bbMin.z), vIdx++ );
	mesh->setVertexLocation( cc3v(bbMax.x, bbMin.y, bbMax.z), vIdx++ );
	mesh->setVertexLocation( cc3v(bbMax.x, bbMax.y, bbMin.z), vIdx++ );
	mesh->setVertexLocation( cc3v(bbMax.x, bbMax.y, bbMax.z), vIdx++ );
	
	mesh->updateVertexLocationsGLBuffer();
	markBoundingVolumeDirty();
}
开发者ID:HerdiandKun,项目名称:cocos3d-x,代码行数:20,代码来源:CC3UtilityMeshNodes.cpp

示例4: prepareParametricMesh

void CC3MeshNode::populateAsHollowConeWithRadius( GLfloat radius, GLfloat height, const CC3Tessellation& angleAndHeightDivs )
{
	CC3Mesh* pMesh = prepareParametricMesh();
	if ( pMesh )
		pMesh->populateAsHollowConeWithRadius( radius, height, angleAndHeightDivs );
}
开发者ID:ClAndHHL,项目名称:cocos3d-x,代码行数:6,代码来源:CC3MeshNode.cpp


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