Lots Of Bitmap Texture Questions:
Bitmap textures are pretty important to learn if you want to make simple 2D games and such. Even after reading NeHe's tutorial, I still am having a little trouble with them...I don't think they dumbed it down enough for me.
You can answer as few or as many as you want.
Code:
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
Few Questions:
1.) Is glTexCoord2f() needed to be placed before each vertex in order for the texture to appear on the shape?
2.) How exactly do the two parameters in glTexCoord2f() work? Is the first parameter for width, and the second for height or something?
Code:
glGenTextures(1, &texture[0]);
3.) What exactly does that mean?
4.) What's filtering mean? (<- Really dumb question)
5.) Do you have to #include <stdio.h> to have bitmap textures?
6.)GLuint texture[1]; ...
- If this holds textures, does this mean I can only hold one texture unless I change the array?
- Does it hafta be GLUint, or can it just be int?
- What does the "u" stand for in "GLuint"? unsigned?
I apprechiate any help you can give me...I know these questions are pretty stupid.
Re: Lots Of Bitmap Texture Questions:
>>1.) Is glTexCoord2f() needed to be placed before each vertex in order for the texture to appear on the shape?
Yes you must specify texture coordinates for each vertex for the texture to display properly.
>>2.) How exactly do the two parameters in glTexCoord2f() work? Is the first parameter for width, and the second for height or something?
They are real values between 0 and 1. [0,1] inclusive. They are basically what part of the texture will be used for that vertex. Think of the cartesian coords Quad I. Usually these are called UV coords. U goes right V goes up on the graph.
Code:
glGenTextures(1, &texture[0]);
>>3.) What exactly does that mean?
It generates a texture name for one texture.
>>4.) What's filtering mean? (<- Really dumb question)
Its how the texture will be filtered :) There are a bunch of different methods, bi-linear filtering, antrioscopic. They have different performance/quality costs associated with them. Basically, how will the textures look when you are near and far.
>>5.) Do you have to #include <stdio.h> to have bitmap textures?
Nope.
>>6.)GLuint texture[1]; ...
>>- If this holds textures, does this mean I can only hold one texture unless I change the array?
Yeah, it can only store one like that. You would need to change it to accomdate more textures.
>>- Does it hafta be GLUint, or can it just be int?
You should stick with OpenGL's convention.
>>- What does the "u" stand for in "GLuint"? unsigned?
Yes.
>>I apprechiate any help you can give me...I know these questions are pretty stupid.
There are no stupid questions.
Re: Re: Lots Of Bitmap Texture Questions:
Quote:
Originally posted by MrWizard
There are no stupid questions.
....except for the ones you dont ask.