Hi friends.
I have hit a block that I don’t know how to get around sadly. I am trying to do texture mapping with the new bind command built into 006 on the iphone, and Shape3D, and not coming up with anything.
The buttonsOff.draw(0, 320, 320, 320); command works just fine, so I am pretty sure my texture is ok. I am wondering if there are any commands that I am overlooking that will get my opengl in the right state for doing this kind of drawing.
thanks so much for the help everyone.
void testApp::setup(){
ofBackground(50, 50, 50);
ofSetBackgroundAuto(false);
glEnableClientState( GL_VERTEX_ARRAY ); // this should be in OF somewhere.
glPointSize(60);
glEnable(GL_POINT_SMOOTH);
buttonsOff.loadImage("allBtnsOffW.png");
myTexture = buttonsOff.getTextureReference();
// touch events will be sent to myTouchListener
ofxMultiTouch.addListener(this);
}
//--------------------------------------------------------------
void testApp::draw(){
myShape.begin(GL_TRIANGLE_STRIP);
myTexture.bind();
myShape.setNormal(0, 0, 1);
myShape.setColor(1, 0, 0);
myShape.setTexCoord(0, 0);
myShape.addVertex(0, 0, 0);
myShape.setColor(1, 0, 0);
myShape.setTexCoord(1, 0);
myShape.addVertex(320, 0, 0);
myShape.setColor(1, 0, 1);
myShape.setTexCoord(0, 1);
myShape.addVertex(0, 320, 0);
myShape.setColor(0, 1, 1);
myShape.setTexCoord(1, 1);
myShape.addVertex(320, 320, 0);
myShape.setColor(1, 1, 1);
myTexture.unbind();
myShape.end();
buttonsOff.draw(0, 320, 320, 320);
}