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



Answer this question

Cylindrically project 2d image

  • Medes

    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

  • sqlaviolette

    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.

  • Salva Madrid

    thnx a lot mr ZMan. i am highly grateful to you

  • v.iyer

  • Johan N

    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.

  • Sumit Mehta

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



  • Little_John

    I think he wants to project a texture cylidrically onto an arbitrary mesh, Tutorial5 puts it on a cylinder.

  • Cylindrically project 2d image