Texture Mapping Methods

Started by
4 comments, last by RelisH 22 years, 6 months ago
Could someone be so kind enough to point me to a resource where I can find out how to map textures to something, like say a sphere or a cube without using the default planar method. The tutorials in the sdk only discuss how to teture a cylinder.
-RelisH!
Advertisement
You can find all that you need here in GameDev ''Articles &
Resources'' under ''Graphics'' or on www.programmersheaven.com.

Hope it was of any help...
Hmm, I cant seem to find what Im looking for.
All I found was how to do multi texturing, but not how to texture something as simple as a cube.

I know I could simply load a cube from an X file, but I don''t want to use meshes for a simple cube as a project Im working on will require me to render tons and tons of cubes at the same time
-RelisH!
Let me know if you find a solution to this problem. Cause my problem is that I have an index buffer, yet I couldn''t figure out a way to texture a cube stored in the buffer using only planar maps.
I''ve figured it out:
There was a tutorial in here showing how to texture a cube with 24 vertices, but I certainly didn''t like that, since I felt using 24 was excessive.

For a non textured cube, I used only 8 vertices and indexed them all.
But for texture mapping, you can texture four of the faces, but the top and bottom faces become messed up.
What I did was use 12 vertices, used the original 8 for the side faces and then used the other 4 which were clone of vertices 1,2,3 and 4 but with different texture coordinates than the originals and then used the clone vertices as two of the vertices used by the top and bottom faces.

To get a better idea of what Im talking about, take out a piece of paper, draw out a cube, and start marking off the corners with texturing coordinates. You''ll notice that your texture coordinates will work for the faces around the sides, but with the top and bottom, you will end up with something like a pair of (1,1) paired with pair of (1,0)

-RelisH!
Cool, I never thought of doing it that way. Thanks for the help.

This topic is closed to new replies.

Advertisement