PDA

View Full Version : Texture on triangle - sphere



Leyder Dylan
08-02-2000, 11:34 AM
Hi,

How can I apply a texture on a triangle or on a sphere, like a ball ?

nikopol0
08-02-2000, 06:35 PM
hum, for a triangle, just put 3 points on the map http://www.opengl.org/discussion_boards/ubb/wink.gif
but for a sphere, there are a lot of projections available, just take a look at a geography book to check all this...
but the most simple should be to use a cylindrical projection, also there will be a lot of distortion on the poles...

[This message has been edited by nikopol0 (edited 08-02-2000).]

nikopol0
08-02-2000, 09:43 PM
this article explains how to make a spherical map using photoshop [to avoid distortion]: http://www.smythe.nbcc.nb.ca/Class96/Peters/tutorial-a.html
usefull http://www.opengl.org/discussion_boards/ubb/wink.gif

MikeC
08-03-2000, 01:20 AM
Originally posted by nikopol0:

but the most simple should be to use a cylindrical projection, also there will be a lot of distortion on the poles...
]

With cylindrical projection you don't just get distortion at the poles, you'll probably get gaps in your texture as well. If you're using something like a gluSphere, the quads around each pole are degenerate - one of their triangles has 2 verts at the pole itself, and so has zero area, so the corresponding triangle on your texture just won't appear.