vincent
September 18, 2014, 1:14pm
#1
Im new to openframeworks and i
m learning mesh by following the tutorials on openframeworks.cc. But setMode(OF_PRIMITIVE_POINTS) seems not working. There is no point after running it…the code is just as same as the tutorial like:
void testApp::setup() {
mesh.setMode(OF_PRIMITIVE_POINTS);
ofVec3f top(100.0, 50.0, 0.0);
ofVec3f left(50.0, 150.0, 0.0);
ofVec3f right(150.0, 150.0, 0.0);
mesh.addVertex(top);
mesh.addVertex(left);
mesh.addVertex(right);
}
void testApp::draw() {
ofBackground(0);
mesh.draw();
}
Try moving ofBackground(0) to the setup function. and changing the draw function to
void testApp::setup() {
ofBackground(0)
mesh.setMode(OF_PRIMITIVE_POINTS);
....
}
void testApp::draw() {
ofSetColor( 255, 0, 255);
mesh.draw();
}
vincent
September 21, 2014, 4:06pm
#3
thx for answering me. it doesn`t work still.
In the draw function, can you try adding
cout << "mesh verts: " << mesh.getNumVertices() << endl;
And see what that prints out to make sure there are vertices in the mesh.
vincent
September 28, 2014, 1:26pm
#5
i found the resolve. i add glPointSize() before the ofMesh.draw() and i can see the point.Still thx for answering!