Jump to content


- - - - -

Affine matrix for screen to texture mapping


  • You cannot reply to this topic
2 replies to this topic

#1 allemensen

    New Member

  • Members
  • Pip
  • 8 posts

Posted 03 July 2008 - 01:27 PM

Hello,

I'm planning to use an affine matrix to map the texture pixels to the screen pixels. I use this format:
[ a b c ] [ sx ] [ u ]
[ d e f ] x [ sy ] = [ v ]
[ 0 0 1 ] [ 1 ] [ 1 ]

Where sx and sy are the screen coordinates of x and y. I want to know how to calculate the values a u/i f. I know the values of sx, sy, u and v for 3 points.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 03 July 2008 - 04:22 PM

Read up on linear equations - solving them is quite simple using matrix algebra.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 allemensen

    New Member

  • Members
  • Pip
  • 8 posts

Posted 03 July 2008 - 05:27 PM

Thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users