Skip to main content
gamedev.net
🔒 Locked

Problem texturing

Started by Ivanch0 Dec 25, 2004 at 8:47 AM 1 replies 500+ views
Original Post
Ivanch0
Ivanch0
Hi to all my problem its that i have try to follow the tutorial of texture a cube i cant use the auxDIBImageLoadA and i have tried with another way... int dimx, dimy, n=0; TColor tcolor; unsigned char *color = (unsigned char *) &tcolor bitmap = new Graphics::TBitmap; bitmap->LoadFromFile(ArchivoTextura); dimx = bitmap->Width; dimy = bitmap->Height; arrayTexturas[CuentaTexturas]=(unsigned char *) malloc (dimx*dimy*3); for (int j=0; jCanvas->Pixels[j]; arrayTexturas[CuentaTexturas][n++]=color[0]; arrayTexturas[CuentaTexturas][n++]=color[1]; arrayTexturas[CuentaTexturas][n++]=color[2]; The problem not its here(i think), whene i show the texture doing like in the tutorial i only can see my texture tiled in the face of the cube a lot of times. glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glBindTexture(GL_TEXTURE_2D, (GLuint)this->arrayTexturas[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glBegin(GL_QUADS); glTexCoord2f(1.0f, 0.0f); glVertex3f(-100.0f, -100.0f, -100.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(-100.0f, 100.0f, -100.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 100.0f, 100.0f, -100.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 100.0f, -100.0f, -100.0f); ...... before this i enable de gl2dtexture...any idea i have read a lot of turorials and i cant found the answer. thanks a lot and happy new year for all ;)
Khaosifix
Khaosifix
The problem not its here(i think), whene i show the texture doing like in the tutorial i only can see my texture tiled in the face of the cube a lot of times.

....So what is the problem? You don't want the texture to be tiled?
---http://www.michaelbolton.comI constantly dream about Michael Bolton.
Ivanch0
Ivanch0
Hi thnks for read my question i have resolved it i didnt wanna the tilin and the error was a line that generate the coords of the texture automatic y comment this line and all its right ;) thnks again

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.