Cylindrically project 2d image
I want to project 2d flat image cylindrically on mesh object.
E.g., on cat or Dog face. I am using managed directX
Can anyone help me on this manner?
thnx
Here's how to do it though (hard without a diagram). Find the mid point of your mesh. Assume there is a 'vertical' ray that goes through this point (you have to decide what is vertical - that is the acis of the cylinder). Then iterate through each point on the mesh and project a ray from the vertical ray through that point perpendicular to the ray. You will get an angle from 0 to 360 (degrees). This maps the u coordinate from your texture fro 0.0 to 1.0
For the u texture you take how high up the 'vertical' ray and then scale to the 0.0 1.0 range.
If you assume the vertical is one of the major axis it makes the math a lot easier.
What you want to do is addressed in the Sample Browser's "Tutorial 5: Using Texture Maps" (unless I'm misunderstanding your question).
The MSDOn folks decide when it goes live not me and they've not given me a publish date yet.