Sprite rendering
Computation of sprite position and size in JSR-184 with revised modelview matrix made with column vector lengths of original modelview matrix.
1. A method of image-based rendering, comprising:
(a) finding a first length of a first column vector of a first modelview matrix;
(b) finding a second length of a second column vector of said first modelview matrix;
(c) constructing a second modelview matrix with:
(i) a first column vector of said second modelview matrix having components all equal to 0 except the first component equal to the quotient of said first length divided by a fourth component of a fourth column vector of said first modelview matrix;
(ii) a second column vector of said second modelview matrix having components all equal to 0 except the second component equal to the quotient of said second length divided by said fourth component of said fourth column vector of said first modelview matrix;
(iii) a third column vector of said second modelview matrix having components all equal to 0; and
(iv) a fourth column vector of said second modelview matrix equal to said fourth column vector of said first modelview matrix;
(d) constructing an object space rectangle subject to said second modelview matrix; and
(e) rendering said rectangle;
(f) whereby an image associated with said rectangle can be rendered on the rectangle.
2. The method of claim 1 , wherein:
(a) after step (d) of claim 1 , restoring said first modelview matrix.
3. The method of claim 1 , wherein:
(a) said unit rectangle has vertices at the four points (±0.5, ±0.5, 0).
4. The method of claim 1 , wherein:
(a) said steps (a)–(d) are implemented as a vertex shader program for a graphics processing unit.
5. The method of claim 1 , wherein:
(a) said image of (f) of claim 1 is a texture.