Jump to content
  • Advertisement
Sign in to follow this  
merlin_1102

Perspective Transform of Image

This topic is 3731 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Its been sometime since I have done any graphics, but I recently took an interest in doing some again in my spare time. I am trying to make a small image manipulation program and one of things I would like to do is to create a perspective transform, where given 4 points (8 values for the x/y), I can manipulate the image into any quadrilateral shape I want. In the past I had implemented a perspective transform app that did just this (or so I thought). When I tried it out again today it did a shear instead (e.g. I added 200 to the topLeft x and it did it correctly, but subtracted 200 from the bottom right x as well). So I obviously did it wrong. Though, I think the LU decomposition algorithm I wrote is correct, I think I am building the matrix incorrectly. I tried looking online and I found lots of information on perspective transforms, but I could not find the link to doing something like 4 points on an image. Could someone point me in the right direction or to a tutorial on how to do this. I cannot recall how the near plane/far plane of the perspective transform relate in the case of manipulating a quadrilateral. In essence, in case I am not clear, I would like to be able to form a matrix to manipulate images similar to this: http://zrusin.blogspot.com/2006/09/perspective-transformations.html A library that forms this for me would be nice, but I am really interested in re-learning how it works. So if anyone could point me in the right direction. I did a quick search of the forums and found little relating specifically to quads. I apologize in advance if I missed something. Thanks EDIT: I thought I should add this in case what I want is not a perspective transform: I want to go from |-----| |-----| |-----| |-----| to |---| |---| |---| |-/ |/ not ||-|--| |-/ |/ which is what I could get rotating around the y-axis. So I am squishing on part of the image. [Edited by - merlin_1102 on June 30, 2008 5:31:34 PM]

Share this post


Link to post
Share on other sites
Advertisement
i think this link may help :

http://www.math.ubc.ca/~cass/graphics/manual/pdf/ch10.pdf

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!