» codelab : http://codelab.fr/accueil » Forum : openFrameworks : http://codelab.fr/openframeworks » texturer une sphère : http://codelab.fr/4957 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : texturer une sphère |
caracteriel — 2014-04-23 15:12:02 |
Bonjour, |
nononononono — 2014-04-23 16:43:19 |
salut tu n'est pas loin. Code (C++) :ofVideoPlayer test; GLUquadricObj *quadric; int x; int y; unsigned char * video; ofTexture videoTexture; ofEasyCam cam; le testapp.cpp Code (C++) ://-------------------------------------------------------------- void testApp::setup(){ test.loadMovie("kolor.mp4"); test.play(); test.setSpeed(1.); //ofSetBackgroundAuto(false); ofSetFrameRate(30); glEnable(GL_DEPTH_TEST); ofDisableArbTex(); //needed for textures to work with gluSphere quadric = gluNewQuadric(); gluQuadricTexture(quadric, GL_TRUE); gluQuadricNormals(quadric, GLU_SMOOTH); x=test.getWidth(); y=test.getHeight(); cout<<" long"<< x<< endl; cout<<" haut"<< y<<endl; video = new unsigned char[x*y*3]; videoTexture.allocate(x,y, GL_RGB); } //-------------------------------------------------------------- void testApp::update(){ test.update(); } //-------------------------------------------------------------- void testApp::draw(){ ofTranslate(ofGetWidth()/2, ofGetHeight()/2, 0); if (test.isFrameNew()){ int totalPixels = x*y*3; video = test.getPixels(); videoTexture.loadData(video, x, y, GL_RGB); } cam.begin(); videoTexture.bind(); gluSphere(quadric, 200, 1000, 1000); videoTexture.unbind(); cam.end(); } |
caracteriel — 2014-04-23 17:02:06 |
Je te remercie nononononono ! |