本文整理汇总了C++中createMesh函数的典型用法代码示例。如果您正苦于以下问题:C++ createMesh函数的具体用法?C++ createMesh怎么用?C++ createMesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createMesh函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: createInnerWalls
void createInnerWalls(){
// create large room walls
scale.x = 5.0f; scale.y = 4.0f; scale.z = 0.5f;
trans.x = 11.0f; trans.y = 0.0f; trans.z = 0.0f;
innerWalls[0] = createMesh(scale, trans, wallHeight, 1); // left wall
scale.x = 5.0f; scale.y = 4.0f; scale.z = 0.5f;
trans.x = 1.0f; trans.y = 0.0f; trans.z = 0.0f;
innerWalls[1] = createMesh(scale, trans, wallHeight, 1); // left wall
scale.x = 3.0f; scale.y = 4.0f; scale.z = 0.5f;
trans.x = -13.0f; trans.y = 0.0f; trans.z = 0.0f;
innerWalls[2] = createMesh(scale, trans, wallHeight, 1); // front wall
// create small room walls
scale.x = 0.5f; scale.y = 4.0f; scale.z = 3.0f;
trans.x = 0.0f; trans.y = 0.0f; trans.z = -13.0f;
innerWalls[3] = createMesh(scale, trans, wallHeight, 1); // right wall
scale.x = 0.5f; scale.y = 4.0f; scale.z = 3.0f;
trans.x = 0.0f; trans.y = 0.0f; trans.z = -3.0f;
innerWalls[4] = createMesh(scale, trans, wallHeight, 1); // right wall
numInnerWalls = 5;
}
开发者ID:ssy001,项目名称:CodeArchive,代码行数:25,代码来源:CityBuilder(AutoDoorOpening).cpp
示例2: createMesh
void fj::SurfaceConstruction::execute(const fj::Scalar ×tep, fj::ParticleSystem *particleSystem)
{
for (auto& isosurface : m_surfaces)
{
isosurface.Mesh = createMesh(timestep, particleSystem, isosurface.getLevel());
}
}
开发者ID:dearshuto,项目名称:ParticleSystem,代码行数:7,代码来源:surface_construction.cpp
示例3: McheckErr
MStatus animCube::compute(const MPlug& plug, MDataBlock& data)
{
MStatus returnStatus;
if (plug == outputMesh) {
/* Get time */
MDataHandle timeData = data.inputValue( time, &returnStatus );
McheckErr(returnStatus, "Error getting time data handle\n");
MTime time = timeData.asTime();
/* Get output object */
MDataHandle outputHandle = data.outputValue(outputMesh, &returnStatus);
McheckErr(returnStatus, "ERROR getting polygon data handle\n");
MFnMeshData dataCreator;
MObject newOutputData = dataCreator.create(&returnStatus);
McheckErr(returnStatus, "ERROR creating outputData");
createMesh(time, newOutputData, returnStatus);
McheckErr(returnStatus, "ERROR creating new Cube");
outputHandle.set(newOutputData);
data.setClean( plug );
} else
return MS::kUnknownParameter;
return MS::kSuccess;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:30,代码来源:animCubeNode.cpp
示例4: createMesh
const Mesh* MeshManager::createIcosahedron(std::string id)
{
if(exists(id))
{
Logger::getInstance()->logWarning("MeshManager:: Mesh with id \"" + id + "\" already exists!");
return nullptr;
}
// Code from OpenGL Programming Guide, Version 3
const float x = 0.525731112119133606;
const float z = 0.850650808352039932;
glm::vec3 vertices[12] = {
{-x, 0.0, z}, {x, 0.0, z}, {-x, 0.0, -z}, {x, 0.0, -z},
{0.0, z, x}, {0.0, z, -x}, {0.0, -z, x}, {0.0, -z, -x},
{z, x, 0.0}, {-z, x, 0.0}, {z, -x, 0.0}, {-z, -x, 0.0}
};
GLuint indices[20][3] = {
{1, 4, 0}, {4, 9, 0}, {4, 5, 9}, {8, 5, 4}, {1, 8, 4},
{1, 10, 8}, {10, 3, 8}, {8, 3, 5}, {3, 2, 5}, {3, 7, 2},
{3, 10, 7}, {10, 6, 7}, {6, 11, 7}, {6, 0, 11}, {6, 1, 0},
{10, 1, 6}, {11, 0, 9}, {2, 11, 9}, {5, 2, 9}, {11, 2, 7},
};
// Create the mesh
const Mesh* mesh = createMesh(id, 12, vertices, 60, &indices[0][0]);
return mesh;
}
开发者ID:namelessvoid,项目名称:nparticles,代码行数:30,代码来源:meshmanager.cpp
示例5: LOG_ERROR
ResourceId CResourceManager::loadMesh(const std::string& file)
{
auto entry = m_meshFiles.find(file);
if (entry != m_meshFiles.end())
{
return entry->second;
}
// Load mesh
SMesh mesh;
if (!load(file, mesh))
{
LOG_ERROR("Failed to load mesh from file %s.", file.c_str());
return invalidResource;
}
// Create mesh resource
ResourceId meshId = createMesh(mesh.m_vertices, mesh.m_indices, mesh.m_normals, mesh.m_uvs, mesh.m_type);
if (meshId == invalidResource)
{
LOG_ERROR("Failed to create mesh resource id from file %s.", file.c_str());
return invalidResource;
}
m_meshFiles[file] = meshId;
return meshId;
}
开发者ID:whztt07,项目名称:CG2015,代码行数:26,代码来源:CResourceManager.cpp
示例6: createMesh
Mesh* HUDImageRenderer::getMesh(const G3MRenderContext* rc) {
if (_mesh == NULL) {
if (!_creatingMesh) {
if (_image == NULL) {
_creatingMesh = true;
const Camera* camera = rc->getCurrentCamera();
const int width = camera->getWidth();
const int height = camera->getHeight();
_imageFactory->create(rc,
width, height,
new HUDImageRenderer::ImageListener(this),
true);
}
}
if (_image != NULL) {
_mesh = createMesh(rc);
}
}
return _mesh;
}
开发者ID:ccarducci,项目名称:Ushahidi_local,代码行数:25,代码来源:HUDImageRenderer.cpp
示例7: ofxUICanvas
void StCvOpDistort::setup(){
gui = new ofxUICanvas();
gui->init(212, 10, 200, 200);
gui->addSpacer();
gui->addLabel("OPTICAL PARTICLE");
gui->addSpacer();
gui->addSlider("PYR SCALE", 0, 0.99, 0.5);
gui->addIntSlider("LEVELS", 1, 10, 5);
gui->addIntSlider("WIN SIZE", 1, 100, 30);
gui->addIntSlider("ITERATION", 1, 20, 2);
gui->addToggle("GAUSS", false);
gui->addSpacer();
gui->addSlider("THRESH", 0, 2.0, 1.0);
gui->addIntSlider("SKIP", 1, 10, 1);
gui->addSlider("TOP SHIFT", 0, 100.0, 50.0);
gui->addSpacer();
gui->addSlider("HUE", 0, 2.0, 1.0);
gui->addSlider("SAT", 0, 2.0, 1.0);
gui->addSlider("BR", 0, 2.0, 1.0);
gui->addSpacer();
gui->addButton("SAVE SETTINGS", false);
gui->loadSettings("StCvOpDistort.xml");
gui->autoSizeToFitWidgets();
gui->setVisible(false);
ofAddListener(gui->newGUIEvent,this,&StCvOpDistort::guiEvent);
app = ((ofApp*)ofGetAppPtr());
createMesh();
}
开发者ID:mcanthony,项目名称:FM14,代码行数:30,代码来源:StCvOpDistort.cpp
示例8: myInit
//initialise the display settings
void myInit()
{
createMesh();
generateWinterMesh();
generateFallMesh();
generateSummerMesh();
generateSpringMesh();
produceTrees_spring();
produceTrees_summer();
produceTrees_autumn();
produceTrees_winter();
generateCloud();
drawTrees();
GLfloat lightIntensity[] = { 0.8, 0.8, 0.8, 1.0f};
GLfloat lightIntensity2[] = { 0.8, 0.8, 0.8, 1.0f };
GLfloat lightPosition[] = {0.0f, 1.0f, 0.0f, 0.0f};
GLfloat lightPosition2[] = { 0.0f, -1.0f, 0.0f, 0.0f };
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
glLightfv(GL_LIGHT0, GL_AMBIENT, lightIntensity);
glLightfv(GL_LIGHT1, GL_POSITION, lightPosition2);
glLightfv(GL_LIGHT1, GL_AMBIENT, lightIntensity2);
Point3 eye, look;
Vector3 up;
eye.set(1,1,1); //set the eye location
look.set(0,0,0); //set the look at coord
up.set(0,1,0); //specify the up vector
cam.set(eye, look, up); // make the initial camera
cam.slide(0,0, 1.5);
cam.setShape(30.0f, 1.0f, 0.5f, 50.0f);
}
开发者ID:fastnick94,项目名称:FractalLandscape,代码行数:31,代码来源:FractalLandscape.cpp
示例9: hapticsLoop
void hapticsLoop(void* a_pUserData)
{
if (create_mesh_flag == 1)
{
createMesh();
create_mesh_flag = 0;
}
syncPoses();
cursor->computeGlobalPositions(1);
// read the position of the haptic device
cursor->updatePose();
// compute forces between the cursor and the environment
cursor->computeForces();
// send forces to haptic device
cursor->applyForces();
inContact = -1;
for (unsigned int i=0; i<cursor->m_pointForceAlgos.size(); i++)
{
cProxyPointForceAlgo* cur_proxy = dynamic_cast<cProxyPointForceAlgo*>(cursor->m_pointForceAlgos[i]);
if ((cur_proxy != NULL) && (cur_proxy->getContactObject() != NULL))
{
lastContactPoint = cur_proxy->getContactPoint();
lastForce = cursor->m_lastComputedGlobalForce;
inContact = i;
break;
}
}
}
开发者ID:DanGrise,项目名称:HugMe,代码行数:34,代码来源:main.cpp
示例10: createMesh
void Shape2D::update()
{
if (_isMeshDirty)
{
createMesh();
}
}
开发者ID:ofZach,项目名称:funkyForms,代码行数:7,代码来源:Shape2D.cpp
示例11: ofxUICanvas
void StFftSphereRibbon::setup(){
gui = new ofxUICanvas();
gui->init(212, 10, 200, 200);
gui->addSpacer();
gui->addLabel("STRIPE SPHERE");
gui->addSpacer();
gui->addSlider("NOISE SCALE", 0.0, 5.0, 1.0);
gui->addSlider("SHIFT SPEED", 0.0, 2.0, 1.0);
gui->addSlider("INTERPORATION", 0.0, 1.0, 0.2);
gui->addSlider("RIBBON WIDTH", 0.0, 10.0, 4.0);
gui->addSlider("ZOOM", 0.0, 3.0, 1.0);
gui->addSpacer();
gui->addSlider("HUE", 0, 2.0, 1.0);
gui->addSlider("SAT", 0, 2.0, 1.0);
gui->addSlider("BR", 0, 2.0, 1.0);
gui->addSpacer();
gui->addButton("SAVE SETTINGS", false);
gui->loadSettings("StFftSphereRibbon.xml");
gui->autoSizeToFitWidgets();
gui->setVisible(false);
ofAddListener(gui->newGUIEvent,this,&StFftSphereRibbon::guiEvent);
app = ((ofApp*)ofGetAppPtr());
post.init(app->drawFbo->width, app->drawFbo->height);
post.createPass<BloomPass>()->setEnabled(true);
createMesh();
}
开发者ID:mcanthony,项目名称:FM14,代码行数:28,代码来源:StFftSphereRibbon.cpp
示例12: clearObject
void Object::create()
{
clearObject();
scale_.x = bounding_box_lwh_.x;
scale_.y = bounding_box_lwh_.y;
scale_.z = bounding_box_lwh_.z;
object_.header.frame_id = frame_id_;
object_.name = name_;
//object_.description = description_;
object_.pose = pose_;
object_.scale = maxScale(scale_);
createMesh();
control_.name = "object_control";
control_.interaction_mode = InteractiveMarkerControl::BUTTON;
control_.always_visible = true;
control_.markers.push_back(mesh_);
object_.controls.clear();
object_.controls.push_back(control_);
if (scale_.x != 0.0f && scale_.y != 0.0f && scale_.z != 0.0f)
BoundingBox::createBoundingBoxControl(0.0f, 0.0f, 0.0f);
createMenu();
}
开发者ID:ipa-fxm,项目名称:srs_public,代码行数:29,代码来源:object.cpp
示例13: strMat
// -------------------------------------------------------------------
// Set a new material definition as the current material.
void ObjFileParser::getNewMaterial()
{
m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
m_DataIt = getNextWord<DataArrayIt>(m_DataIt, m_DataItEnd);
if( m_DataIt == m_DataItEnd ) {
return;
}
char *pStart = &(*m_DataIt);
std::string strMat( pStart, *m_DataIt );
while( m_DataIt != m_DataItEnd && isSeparator( *m_DataIt ) ) {
++m_DataIt;
}
std::map<std::string, ObjFile::Material*>::iterator it = m_pModel->m_MaterialMap.find( strMat );
if ( it == m_pModel->m_MaterialMap.end() )
{
// Show a warning, if material was not found
DefaultLogger::get()->warn("OBJ: Unsupported material requested: " + strMat);
m_pModel->m_pCurrentMaterial = m_pModel->m_pDefaultMaterial;
}
else
{
// Set new material
if ( needsNewMesh( strMat ) )
{
createMesh();
}
m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strMat );
}
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
}
开发者ID:NevilX,项目名称:assimp,代码行数:34,代码来源:ObjFileParser.cpp
示例14: createMesh
void AwarenessVisualizer::buildVisualizationForAllTiles()
{
std::function<void(unsigned int, dtTileCachePolyMesh&, float* origin, float cellsize, float cellheight, dtTileCacheLayer& layer)> processor = [this](unsigned int tileRef, dtTileCachePolyMesh& pmesh, float* origin, float cellsize, float cellheight, dtTileCacheLayer& layer) {
createMesh(tileRef, pmesh, origin, cellsize, cellheight, layer);
};
mAwareness.processAllTiles(processor);
}
开发者ID:Chimangoo,项目名称:ember,代码行数:8,代码来源:AwarenessVisualizer.cpp
示例15: createMesh
Icosahedron::Icosahedron( string iName, real ir, const Material& mat )
{
r = ir ;
name = iName ;
material = mat ;
createMesh( defaultMeshType, defaultVertexType ) ;
}
开发者ID:sdp0et,项目名称:gtp,代码行数:8,代码来源:Icosahedron.cpp
示例16: createMesh
const GLC_BoundingBox& GLC_Sphere::boundingBox()
{
if ( GLC_Mesh::isEmpty() )
{
createMesh();
}
return GLC_Mesh::boundingBox();
}
开发者ID:MorS25,项目名称:OpenPilot,代码行数:8,代码来源:glc_sphere.cpp
示例17: createMesh
RigidSphere::RigidSphere()
{
m_radius = 0.38f;
m_radius2 = m_radius * m_radius;
createMesh(m_radius, 18, 18);
m_pShader = new ModelViewProjectionShader("resource/shaders/ball.vert", "resource/shaders/ball.frag");
reset(false);
}
开发者ID:marcushultman,项目名称:interactive-secondary-motion,代码行数:8,代码来源:RigidSphere.cpp
示例18: main
void main()
{
try {
// ビューアーを作成する
pcl::visualization::PCLVisualizer viewer( "Point Cloud Viewer" );
// 点群
pcl::PointCloud<PointType>::Ptr cloud1( new pcl::PointCloud<PointType> );
pcl::PointCloud<PointType>::Ptr cloud2( new pcl::PointCloud<PointType> );
// PLYファイルを読み込む
pcl::PLYReader reader;
reader.read( "model1.ply", *cloud1 );
reader.read( "model2.ply", *cloud2 );
// ビューアーに追加して更新(Qキーで次の処理へ)
viewer.addPointCloud( cloud1, "cloud1" );
viewer.addPointCloud( cloud2, "cloud2" );
viewer.spin();
// VoxelGrid Filter
voxelGridFilter( cloud1 );
voxelGridFilter( cloud2 );
// 位置合わせ
iterativeClosestPoint( cloud1, cloud2 );
// ビューアーを更新する(Qキーで次の処理へ)
viewer.updatePointCloud( cloud1, "cloud1" );
viewer.updatePointCloud( cloud2, "cloud2" );
viewer.spin();
// 点群をマージして重複を削除する
*cloud1 += *cloud2;
voxelGridFilter( cloud1 );
// PLYファイルとして書き出す
pcl::PLYWriter writer;
writer.write( "output.ply", *cloud1 );
// ビューアーを更新する(Qキーで次の処理へ)
viewer.updatePointCloud( cloud1, "cloud1" );
viewer.removePointCloud( "cloud2" );
viewer.spin();
// メッシュ化してファイルに出力
auto triangles = createMesh( cloud1 );
pcl::io::savePLYFile( "output-mesh.ply", triangles );
// 表示を更新(Qキーで次の処理へ)
viewer.removeAllPointClouds();
viewer.addPolygonMesh( triangles );
viewer.spin();
}
catch ( std::exception& ex ){
std::cout << ex.what() << std::endl;
}
}
开发者ID:K4W2-Book,项目名称:K4W2-Book,代码行数:58,代码来源:main.cpp
示例19: createMesh
//------------------------------------------------------------
void ofxPolyline::draw(int begin, int end) {
if (begin >= end) {
return;
}
// Create a mesh of polyline
ofMesh mesh;
createMesh(mesh, begin, end);
// Draw
for (int i=0; i<2; i++) {
// For statement for ofNoFill() and ofFill()
if (i == 0) {
// No fill for antialias
ofNoFill();
mesh.drawWireframe();
} else if (i == 1) {
// Fill
ofFill();
mesh.draw();
}
// Draw ends of line
if (strokeLinecap == OFXSVG_STROKE_LINECAP_BUTT) {
;
} else if (strokeLinecap == OFXSVG_STROKE_LINECAP_ROUND) {
ofCircle((*this)[begin], width/2);
ofCircle((*this)[end], width/2);
} else if (strokeLinecap == OFXSVG_STROKE_LINECAP_SQUARE) {
ofPushStyle();
ofSetRectMode(OF_RECTMODE_CENTER);
for (int j=0; j<2; j++) {
int index;
float capXOffset;
if (j == 0) {
index = begin;
capXOffset = -width/4.0;
} else if (j == 1) {
index = end;
capXOffset = width/4.0;
}
ofVec3f rotation3 = getNormalAtIndex(index);
ofVec2f rotation = ofVec2f(rotation3);
rotation.rotate(90); // Normal to line direction
float angle = ofVec2f(1.0, 0.0).angle(rotation);
ofPushMatrix();
ofTranslate((*this)[index].x, (*this)[index].y);
ofRotate(angle);
ofRect(capXOffset, 0, width/2, width);
ofPopMatrix();
}
ofPopStyle();
}
}
ofNoFill();
}
开发者ID:kokinomura,项目名称:SvgLineAnimation,代码行数:58,代码来源:ofxPath.cpp
示例20: createChunk
Chunk * createChunk(int x, int y, int z) {
Chunk *chunk = calloc(1, sizeof(Chunk));
chunk->x = x;
chunk->y = y;
chunk->z = z;
chunk->mesh = createMesh();
return chunk;
}
开发者ID:kyle1320,项目名称:voxels,代码行数:11,代码来源:voxels.c
注:本文中的createMesh函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论