PDA

View Full Version : texture mapping onto a line?



popapez
04-22-2009, 12:36 PM
hi, i am very new to opengl, but i am trying to put a very abstractly-shaped image (a feather to be exact) onto a line. is it possible to map the center of the feather image to the coordinates of a line and have the parts of the image that dont lie on the line still show up?

is this achievable by using triangles or rectangles instead of a line?

when i try it, it just maps the part of the image that is contained in the lines dimensions, but i would like the entire image to show up without having to define every single vertex in the feather.

thanks a lot guys

zeoverlord
04-22-2009, 02:11 PM
no, you have to use triangles or rectangles since you also need to define the width of the thing, including the texturecoordinates.

popapez
04-22-2009, 02:52 PM
well using a rectangle wont get me what i want either because it will stretch the feather in weird ways. do i really need to define tons of points in opengl to map corresponding points of the image to?

popapez
04-22-2009, 02:53 PM
here is my feather. its going to be repeated a ton of times on the back of a peacock.

http://i96.photobucket.com/albums/l181/popapez0rz/feather.png

popapez
04-22-2009, 02:56 PM
with lines:
http://i96.photobucket.com/albums/l181/popapez0rz/Picture4-1.png



and with triangles:

http://i96.photobucket.com/albums/l181/popapez0rz/Picture3-2.png

dletozeun
04-22-2009, 03:05 PM
Use alpha textures and map it on simple quad or more complicated shape to respect the feather curvature.

popapez
04-22-2009, 10:08 PM
alpha textures? like, opacity?

dletozeun
04-23-2009, 05:33 AM
Yes.