本文整理汇总了C++中ofMesh::drawWireframe方法的典型用法代码示例。如果您正苦于以下问题:C++ ofMesh::drawWireframe方法的具体用法?C++ ofMesh::drawWireframe怎么用?C++ ofMesh::drawWireframe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofMesh
的用法示例。
在下文中一共展示了ofMesh::drawWireframe方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void draw() {
ofBackground(0);
cam.begin();
ofSetLineWidth(2);
ofSetColor(ofColor::red, 16);
mesh.drawWireframe();
glPointSize(4);
ofSetColor(ofColor::white);
controlPoints.draw();
cam.end();
}
示例2: drawMesh
void ofApp::drawMesh(ofMesh& m, ofFloatColor color){
if(showFilled){
ofSetColor(color);
ofEnableDepthTest();
ofEnableLighting();
m.draw();
}
if(showWireframe){
ofDisableLighting();
ofSetColor(0);
glDepthFunc(GL_LEQUAL);
m.drawWireframe();
}
glDepthFunc(GL_LESS);
ofDisableLighting();
}
示例3: ofxSphere
//----------------------------------------
void ofxSphere(float radius) {
if( sphereScratchMesh.getNumVertices() == 0 ||
!lastGeneratedSphereParams.equals( radius, currentSphereParams.numRings, currentSphereParams.numSegments ) ){
ofGenerateSphereMesh( sphereScratchMesh, radius, currentSphereParams.numRings, currentSphereParams.numSegments );
// Save the parameters of what we just generated
lastGeneratedSphereParams.radius = radius;
lastGeneratedSphereParams.numRings = currentSphereParams.numRings;
lastGeneratedSphereParams.numSegments = currentSphereParams.numSegments;
}
if(ofGetStyle().bFill) {
sphereScratchMesh.drawFaces();
} else {
sphereScratchMesh.drawWireframe(); // this won't really work, but leave it in for now.
}
}
示例4: drawMesh
//.........这里部分代码省略.........
float flowStartTime = .1;
float assimilateStartTime = .4;
float burstStartTime = .8;
if(mRevealParameter < flowStartTime) {
revealParam = 0.0;
winParam = -1;
}
else if(mRevealParameter < assimilateStartTime) {
float t = (mRevealParameter - flowStartTime) / (assimilateStartTime - flowStartTime);
revealParam = .5 - .5 * cos(t * M_PI);
winParam = - 1;
}
else if(mRevealParameter < burstStartTime) {
float t = (mRevealParameter - assimilateStartTime) / (burstStartTime - assimilateStartTime);
revealParam = 1.0;
winParam = -1 + t;
}
else {
float t = (mRevealParameter - burstStartTime) / (1. - burstStartTime);
revealParam = 1.0;
winParam = t;
}
float minOffset = 10.0;
float maxOffset = 20.0 + 20.0 * revealParam + 40.0 * (1. + winParam);
float recalcOffset = minOffset;
if(drawMode == 0) {
//glow:
recalcOffset = maxOffset;
}
//sheen effect:
float t = winParam;/// pow(winParam, 3.);// MAX(0.0f, MIN(1.0f, 1.0 * winParam + 0));
ofVec2f sheenSource((1-t) * -0.981 + t * 1.182, (1-t) * -0.138 + t * .441);
ofVec2f sheenEnd((1-t) * -0.234 + t * 1.929, (1-t) * 0.37 + t * 0.949);
//transform to fit 'networkBounds'
ofPoint center = networkBounds.getCenter();
sheenSource.x = center.x + (sheenSource.x - .5) * networkBounds.width;
sheenSource.y = center.y + (sheenSource.y - .5) * networkBounds.height;
sheenEnd.x = center.x + (sheenEnd.x - .5) * networkBounds.width;
sheenEnd.y = center.y + (sheenEnd.y - .5) * networkBounds.height;
ofVec2f sheenUnitVector(sheenEnd.x - sheenSource.x, sheenEnd.y - sheenSource.y);
float sheenLength = sqrtf(sheenUnitVector.x * sheenUnitVector.x + sheenUnitVector.y * sheenUnitVector.y);
sheenUnitVector.x /= sheenLength;
sheenUnitVector.y /= sheenLength;
ofColor darkColor = bgResources.getColorSetting(NetworkDarkColorKey)->value;
ofColor lightColor = bgResources.getColorSetting(NetworkLightColorKey)->value;
mNetworkShader.begin();
mNetworkShader.setUniform1f("uTime", mTime);
mNetworkShader.setUniform2f("uResolution", 1024, 768);
mNetworkShader.setUniform1f("uMaxDepth", maxDepth);
mNetworkShader.setUniform1f("uRevealParameter", revealParam);
mNetworkShader.setUniform1f("uBaseHue", 0.3); //RED: 0.1 GREEN: 0.3 //vec3(0,3, 0.7, .7);
mNetworkShader.setUniform3f("uBaseRGBDark", darkColor.r / 255.0, darkColor.g / 255.0, darkColor.b / 255.0);
mNetworkShader.setUniform3f("uBaseRGBLight", lightColor.r / 255.0, lightColor.g / 255.0, lightColor.b / 255.0);
mNetworkShader.setUniform1i("uDrawMode", drawMode);
mNetworkShader.setUniform1f("uBoundOffset", recalcOffset);// boundOffset);
mNetworkShader.setUniform1f("uDepthOffset", nodeDepth);
mNetworkShader.setUniform1i("uDeformNode", deform ? 1 : 0);
mNetworkShader.setUniform2f("uSurfaceNormal", surfaceNormal.x, surfaceNormal.y);
mNetworkShader.setUniform1f("uMinGlowRad", minOffset / maxOffset);
mNetworkShader.setUniform1f("uWinAnimParameter", winParam);
mNetworkShader.setUniform2f("uSheenFrom", sheenSource.x, sheenSource.y);
mNetworkShader.setUniform2f("uSheenUnitVector", sheenUnitVector.x, sheenUnitVector.y);
mNetworkShader.setUniform1f("uSheenLength", sheenLength);
/*
uniform float uWinAnimParameter;
uniform vec2 uSheenFrom;
uniform vec2 uSheenUnitVector;
uniform float uSheenLength;
*/
mNetworkShader.setUniform1f("uNodeRadius", nodeRadius);
mNetworkShader.setUniform1i("uNodeIsExternal", isExternal ? 1 : 0);
mNetworkShader.setUniform2f("uNodeCenter", nodeLocation.x, nodeLocation.y);
mesh.draw();
mNetworkShader.end();
ofDisableDepthTest();
if(renderWireframe)
mesh.drawWireframe();
}