Use ofMesh development butterfly effect. the problem with blending and depth test! I need help! I am a beninner!

SourceCode:sourceCode download

ScreenShot:flashquake.cn/myshow/bug.jpg

testApp.app:

#include “testApp.h”
void testApp::setup(){
ofSetVerticalSync(true);
ofEnableDepthTest();
ofEnableAntiAliasing();
ofLoadImage(texture, “butterfly.png”);
butterfly.init();
}

//--------------------------------------------------------------
void testApp::update()
{
butterfly.update();
}

//--------------------------------------------------------------
void testApp::draw()
{
cam.begin();
ofDrawAxis(100);
texture.bind();
butterfly.draw();
texture.unbind();
cam.end();
}

Butterfly.cpp:

#include “Butterfly.h”
Butterfly::Butterfly()
{

};

void Butterfly::init()
{

mesh.setMode(OF_PRIMITIVE_TRIANGLE_STRIP);
ofPoint v0(0,0,0);
ofPoint v1(-0.5,0,0);
ofPoint v2(-0.5,0,1);
ofPoint v3(0,0,1);
ofPoint v4(0.5,0,1);
ofPoint v5(0.5,0,0);

mesh.addVertex(v0);
mesh.addTexCoord(ofPoint( 256, 0 ));

mesh.addVertex(v1);
mesh.addTexCoord(ofPoint( 0, 0 ));

mesh.addVertex(v2);
mesh.addTexCoord(ofPoint( 0,512 ));

mesh.addVertex(v3);
mesh.addTexCoord(ofPoint( 256,512 ));

mesh.addVertex(v4);
mesh.addTexCoord(ofPoint( 512,512 ));

mesh.addVertex(v5);
mesh.addTexCoord(ofPoint( 512,0 ));

//leftwing
mesh.addTriangle(2, 1, 3);
mesh.addTriangle(1, 0, 3);

//rightwing
mesh.addTriangle(0, 5, 3);
mesh.addTriangle(5, 4, 3);

int numVerts = mesh.getNumVertices();
for (int i=0; i<numVerts; ++i)
{
    ofVec3f vert = mesh.getVertex(i);
    vert*=scale;
    mesh.setVertex(i, vert);
};

};

void Butterfly::update()
{
wingStartAngle+=flySpeed;
if(wingStartAngle>45)
{
wingStartAngle=45;
flySpeed=-abs(flySpeed);
}
if(wingStartAngle<-45)
{
wingStartAngle=-45;
flySpeed=abs(flySpeed);
}

ofVec3f v1 = mesh.getVertex(1);
v1.rotate(0, 0, flySpeed);
mesh.setVertex(1, v1);
ofVec3f v2 = mesh.getVertex(2);
v2.rotate(0, 0, flySpeed);
mesh.setVertex(2, v2);

ofVec3f v4 = mesh.getVertex(4);
v4.rotate(0, 0, -flySpeed);
mesh.setVertex(4, v4);
ofVec3f v5 = mesh.getVertex(5);
v5.rotate(0, 0, -flySpeed);
mesh.setVertex(5, v5);

};

void Butterfly::draw()
{
ofSetColor(255, 255,255);
mesh.draw();
};

There are some easy solution?