| 259 | /////////////////////////////////////////////////////////////////////////////////////////// |
| 260 | |
| 261 | M33f ImagePrimitive::objectToUVMatrix() const |
| 262 | { |
| 263 | M33f result; |
| 264 | const Box2i &displayWindow = getDisplayWindow(); |
| 265 | V2i size = displayWindow.size() + V2i( 1 ); |
| 266 | result.translate( V2f( 0.5f ) ); |
| 267 | result.scale( V2f( 1.0f ) / V2f( size.x, -size.y ) ); |
| 268 | return result; |
| 269 | } |
| 270 | |
| 271 | M33f ImagePrimitive::uvToObjectMatrix() const |
| 272 | { |