View Full Version : Texture Mapping
Rajiv Mishra
11-23-2001, 02:23 AM
What i seen most of Texture mapping in opengl samples even in NeHe tutorial,use the bitmap having the pixel lenght 64,128,256.
Now please tell me how i map the bitmap other than this dimension ?
Once again, don't crosspost...
Now, to answer your question: without extensions, OpenGL wants dimensions that are a power of 2 so you HAVE to use bitmaps of dimensions 64,128,256,...
Now, if you want to use another dimension, find the rectangle that has dimensions as powers of 2 that encloses your bitmap. Then calculate the proper texture coordinates for your object...
Does that make sense ?
Regards.
Eric
Make an empty texture with the power of two dimensions enclosing the original texture:
glTexImage2D(....., 0);
Then call glTexSubImage2D(..., bitmapdata)
and calculate the texcoords as Eric suggested to render the bitmap.
kon
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.