Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

ofMesh issue in RPi 2

$
0
0

Hi All,

I'm having a bit of an issue getting a set of triangles in ofMesh to render correctly in the Raspberry Pi 2.

code:

void ofApp::setup(){

mesh.addVertex(ofVec3f(10, 10, 1));
mesh.addVertex(ofVec3f(200, 10, 1));
mesh.addVertex(ofVec3f(400, 10, 1));
mesh.addVertex(ofVec3f(800, 10, 1));

mesh.addVertex(ofVec3f(10, 600, 1));
mesh.addVertex(ofVec3f(200, 600, 1));
mesh.addVertex(ofVec3f(400, 600, 1));
mesh.addVertex(ofVec3f(800, 600, 1));

mesh.addIndex(0);
mesh.addIndex(1);
mesh.addIndex(4);
mesh.addIndex(1);
mesh.addIndex(5);
mesh.addIndex(4);
mesh.addIndex(1);
mesh.addIndex(2);
mesh.addIndex(5);
mesh.addIndex(2);
mesh.addIndex(6);
mesh.addIndex(5);
mesh.addIndex(2);
mesh.addIndex(3);
mesh.addIndex(6);
mesh.addIndex(3);
mesh.addIndex(7);
mesh.addIndex(6);

}
void ofApp::update(){

}

//--------------------------------------------------------------
void ofApp::draw(){

ofBackground(0);

ofSetColor(200);

mesh.drawWireframe();
}

The result on OS X is this:

But on the Pi is this:

Notice that none of the triangles are closed.

Am I misunderstanding something basic about the way ofMesh and the indices work, or is there something funky with the way the Pi 2 renders meshes?

Thanks in advance!

c.


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>