View Full Version : Texture Mapping
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 ?
Make an empty texture with the power of two dimensions enclosing the original texture:
Then call glTexSubImage2D(..., bitmapdata)
and calculate the texcoords as Eric suggested to render the bitmap.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.