OpenGL texturing

Started by
20 comments, last by zedzeek 19 years, 5 months ago
I know you dont usually use the vertex coords for texture coords, but the thing is, i want the program to texture each poly as if they were sort of a mask, like tile the texture over the whole window, and then everywhere that isnt a poly draw black, everywhere that is, draw an undeformed texture.
Advertisement
if im guessing right what u want to do a better way is clear the screen to black. enable automatic texture coordinate generation (thus u dont use glTexCoord..(..) ) and then draw the polygons for texgen i think u need GL_EYE_LINEAR (or is that perhaps OBJECT LINEAR)
newbie question guys :
how can i "wrap" an object (made up from vertices from a data file) with a texture, but without providing the texture coordinates (not provided from a data file)? use glTexGen?

and if so how ? in the drawing function what coordinate do i give it ? glTexCoord2f(?,?); ?

I have tried giving it the same with the vertices but no luck.
I have tried providing a set of texture coordinates for each vertice but no luck.

I think that Texture generator is the way to go , but i do not know how to use it.

All in all i'm after an automatic texture generation procedure/tutorial/example.

cheers

P.S. Thanks for your time.
guys?
with texgen u dont use texture coordinates, u can set it so it automatically generate texture coordinates depending on where on the screen the vertice is, check out the redbook + the opengl spec etc for info on how to use texture generation (btw u can also do this with a shader without using texture generation)
how can i use a shader? any good tutorial around?
Dont hijack threads
Start your own
Really guys , any good link or tutorial for shaders (something for begginers though), I am too interested in this.

thx
there will be some shader stuff here

http://www.humus.ca/
http://www.delphi3d.net/
http://www.gametutorials.com/
http://www.ultimategameprogramming.com/
http://developer.nvidia.com/page/home
guys i'm trying to apply a texture to an object consisting of many points. how can I treat this object (that consists of many points) as a whole, as a single unit, so that I can apply a texture to it?

I am loading the object from a data file. So I want something generic thus no usage of specific texture coordinates is possible.

After reading the file for point coordinates , i use this to show the points:
glVertex3f(x, y, z);

I can't use a glTexCoord2f() function to assign texture coordinates because i am after something that will load any object from a file and apply to it a specific texture.

any ideas on how to implement such a thing ? or suggestion for something better?

cheers

This topic is closed to new replies.

Advertisement