Cylindrically project 2d image

HI
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
[173 byte] By [ursfriend] at [2008-2-8]
# 1
I have a future 'Ask the Zman' column on spherically projected textures which you can modify, but I can't preempt that by putting the code up here. I don't have the publish date but it may be this Friday.

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.

TheZMan at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2

What you want to do is addressed in the Sample Browser's "Tutorial 5: Using Texture Maps" (unless I'm misunderstanding your question).

DavidWeller at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 3
I think he wants to project a texture cylidrically onto an arbitrary mesh, Tutorial5 puts it on a cylinder.
TheZMan at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 4
Yes ZMAn, you are absolutely right....I want it on arbitrary mesh..plz let me know when u put your column on the web...thnx for ur reply
ursfriend at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 5
Watch this space... http://msdn.microsoft.com/coding4fun/gamedevelopment/default.aspx

The MSDOn folks decide when it goes live not me and they've not given me a publish date yet.

TheZMan at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 7
thnx a lot mr ZMan. i am highly grateful to you
ursfriend at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...