Hello! Subject titles says it all! I have Ron Fosner's book
"OpenGl: Programming for Win95", and I have even read
many online FAQs, but I'm still not grasping "texture
coordinates".
I understand how to read and select bitmap files for the
texture. My biggest problem is understanding the
"glTexCoord..()" routine. Can anybody help me to
understand the meaning of the 1's and 0's??
For example :
glTexCoord (0.0, 0.0); // hmmm 0 and 0??
glVertex (....)
glTexCoord (1.0, 0.0); // hmmm 1 and 0??
glVertex (....)
Ron Fosner's book says the arguments of glTexCoord
are "attached" to the next vertex. Can anybody clarify
texture coords a bit?
Thanks!
-------
S
|
|
0
|
|
|
|
Reply
|
Shizuka
|
5/3/2004 5:11:21 AM |
|
Shizuka wrote:
> Ron Fosner's book says the arguments of glTexCoord
> are "attached" to the next vertex. Can anybody clarify
> texture coords a bit?
A texture is practically picture which is a function over n dimenstions,
mapping every coordinate in a nD coordinate system to a colour. Most common
are 2D pictures but also 1D, 3D are common.
The texture coordinate assigns a position on a picture to the vertices that
are specified.
Wolfgang
|
|
0
|
|
|
|
Reply
|
Wolfgang
|
5/3/2004 7:14:54 AM
|
|
Wolfgang Draxinger <wdraxinger@darkstargames.de> wrote in
news:c74rhh$ek4$1@svr7.m-online.net:
> The texture coordinate assigns a position on a picture to the vertices
> that are specified.
The thing all people new to textures need to remember is that ALL are in
the range of 0 to 1 in both directions, no matter how many pixels there
are. So if you had two textures that showed the same thing except one was
much bigger, and of a higher quality, saying a coordinate is at .5 in the x
direction means its at half the width of x, whether the width is 256 pixels
or 2048. Say you had a quad with texture coordinates at (0,0) (0,.5)
(.5,.5) & (.5,0). Thats the upper left, upper middle, lower middle, and
lower right. That quad will be textured with the upper left quadrant of
the texture. Draw this out on a piece of paper and you will see.
Check out tutorials at gamedev.net or gametutorials.com for more detailed
explanations.
|
|
0
|
|
|
|
Reply
|
Theo
|
5/3/2004 7:38:50 AM
|
|
There's some info here, but it's not been updated in a very long time
and there are probably better ways to do it. :)
http://home.clara.net/paulyg/uv.htm
paul
On Sun, 2 May 2004 22:11:21 -0700, "Shizuka" <rman@goodnet.com> wrote:
>Hello! Subject titles says it all! I have Ron Fosner's book
>"OpenGl: Programming for Win95", and I have even read
>many online FAQs, but I'm still not grasping "texture
>coordinates".
>
>I understand how to read and select bitmap files for the
>texture. My biggest problem is understanding the
>"glTexCoord..()" routine. Can anybody help me to
>understand the meaning of the 1's and 0's??
>
>For example :
>
> glTexCoord (0.0, 0.0); // hmmm 0 and 0??
> glVertex (....)
>
> glTexCoord (1.0, 0.0); // hmmm 1 and 0??
> glVertex (....)
>
>Ron Fosner's book says the arguments of glTexCoord
>are "attached" to the next vertex. Can anybody clarify
>texture coords a bit?
>
>Thanks!
>
>-------
>S
>
>
>
paul's opengl page - http://home.clara.net/paulyg
paul's pgp public key - http://home.clara.net/paulyg/PaulGroves.asc
|
|
0
|
|
|
|
Reply
|
paul
|
5/12/2004 1:11:23 AM
|
|
|
3 Replies
278 Views
(page loaded in 0.069 seconds)
Similiar Articles: Generating texture coordinates - comp.graphics.api.opengl ...Does anyone know how to generate texture coordinates for a given mesh ? I wouldn't use glTexGen function and the mesh hasn't any texture coords. The... GLSL - screen coordinate & texture width - comp.graphics.api ...3D Texture Constraints - comp.graphics.api.opengl... raycasting application that uses GLSL. I understand that 3D textures ... My texture coordinates are all in [0,1] and ... GL_POINTS & Textures - comp.graphics.api.openglHowever it uses some kind of weird "point texture coordinate space" which I don't quite understand, so I don't use this feature... But it's kinda interesting ! 3D Texture Constraints - comp.graphics.api.openglI know the texture is correct on my side of memory because I can view it another ... 1] and I'm using > GL_CLAMP_TO_EDGE, so I don't believe I have a texture coordinate ... Cylindrical Texture Co-ordinates - comp.graphics.api.opengl ...Generating texture coordinates - comp.graphics.api.opengl ... Scrolling Background Texture ... texture co-ordinates for a planar projection ... the major axis and I know ... glDrawElements with different texture indices - comp.graphics.api ...... and an array of indices to these vertices, plus i have an array of texture coordinate and an ... (i know i can "manually" draw each array with glArrayElement) thanx, noam. 3D Camera-Space Coordinates out of gl_FragCoord - comp.graphics ...... inverse of the Projection-Matrix to it? Is it already in there, only i dont ... line stippling beyond glLineStipple() - comp.graphics.api ... the texture coordinate being ... glDrawPixel - what is missing here? - comp.graphics.api.opengl ...You've just to know > the way, how OpenGL maps texture coordinates to pixels. Some > time ago I wrote a small example application, that renders a > full screen quad with ... real-time object tracking using optical flow / XY coordinates ...... only in the environment,,now i want to know their coordinates on ... first columns. the matrices are 2x80 i dont know ... matching, object recognition as well as texture ... Scrolling Background Texture - comp.graphics.api.openglDont forget to change the matrix mode back to GL ... It may work for the extensions, I don't know. It ... do ordinary glTranslate calls to translate the texture coordinates ... Crydev.net • View topic - "Node's mesh has some degenerate ..."Node's mesh has some degenerate texture coordinates do you still want to export this node?" I dont know what tha heck is with my model, its yust a simple mesh, material ... OpenGL texture matrix rotation - LinuxQuestions.orghopefully we're talking about 2d textures cos i dont know anything 3d textures. so we have our texture coordinates (a, b, c, d) i assume that your not trying freaky ... 7/25/2012 9:36:34 PM
|