Direct3d Texture Coordinates

Started by
4 comments, last by zerwit 23 years, 10 months ago
I have a cone and I want to wrap a texture around the body of it only, not the cap. But when I do this it turns out distorted because the top point is always 0,0. Is the only way to get it currect by creating multiple vertices in that same spot. That would be a waste of memory, so if it can be avoided I would like to know how. Thanks for your time. *** Triality ***
*** Triality ***
Advertisement
I''m not sure I undertstande what you meen but to me it seems like you have one vertice for the top and then draw indexed.
Is that correct?

The very top should have the texture coord (0.5;0.0)
That is the middle and top of the texture and I guess that is what you wan''t. The top should have the same texture coord for all sides of the cone.
You can use a triangle fan. I don'';t know how to make one myself using D3D code, but all the tri''s share a common vertex (the point you speak of).
Assassin, aka RedBeard. andyc.org
zerwit, I know what you mean. Mr Cucumber''s method probably turns out distorted like you mentioned. I dunno how to do this either, but maybe it''s similar to how spheres are texture-mapped. Try looking into the the different texture wrap modes, address modes, and coordinate dimensions. Or here''s another idea: draw your texture bitmap as if looking straight down on your cone from above, and then assign your vertex texture coords accordingly, i.e., the top of the cone would be (0.5,0.5), and around the bottom of the cone you would have like (1.0,0.0), (0.707,0.707), (0.0,1.0), (-0.707,0.707), etc..
Eric, that is a good idea and I think I will use it. Also I have texture mapped a sphere but at the very top and bottom it is distorted, could that be fixed by messing with the wrap states and stuff?

*** Triality ***
*** Triality ***
For spheres, again, I don't have any actual experience. I know that you can texture them, distortion-free, and I think it involves using a "perfectly sphere-wrappable texture". I read a little about it in a recent thread here at GameDev, but I couldn't find the thread just now...

Edited by - Eric on June 18, 2000 9:53:38 PM

This topic is closed to new replies.

Advertisement