Velociraptor model for download

Go here: http://hendrik.itgo.com

Originally posted by HJ:
Go here: http://hendrik.itgo.com

Cool! However, when I tried it the texture would not work. Even when I converted to tga it would only work for my cube object. The velociraptor refused to be textured.

I’m using this for texture mapping:

bitmap = new Graphics::TBitmap;
bitmap->LoadFromFile(“texture.bmp”);
GLubyte bits[128][128][4];
for(int i = 0; i < 128; i++)
{
for(int j = 0; j < 128; j++)
{
bits[i][j][0]= (GLbyte)GetRValue(bitmap->Canvas->Pixels[i][j]);
bits[i][j][1]= (GLbyte)GetGValue(bitmap->Canvas->Pixels[i][j]);
bits[i][j][2]= (GLbyte)GetBValue(bitmap->Canvas->Pixels[i][j]);
bits[i][j][3]= (GLbyte)255;
}
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, bits);

and:

glPushMatrix();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_TRIANGLES);
etc…

Thanks

erm, … I will have to see if that code can be reworked into mine somehow. Plenty of time for that though. :wink:

Tina