Swizzling (computer graphics)

Swizzling (computer graphics)

In computer graphics, swizzling means rearranging the elements of a vector [http://www.cs.uaf.edu/2005/fall/cs301/support/glfp/] . For example, if A = {1,2,3,4}, where the components are x, y, z, and w respectively, you could compute B = A.wwxy, whereupon B would equal {4,4,1,2}. This is common in GPGPU applications.

In terms of linear algebra, this is equivalent to multiplying by a matrix of zeros and ones such that each row has exactly one one. If A=(1,2,3,4)^T, then swizzling A as above looks like:A.wwxy = egin{bmatrix} 0&0&0&1 \ 0&0&0&1 \ 1&0&0&0 \ 0&1&0&0 end{bmatrix}egin{bmatrix} 1\ 2\ 3\ 4end{bmatrix} = egin{bmatrix} 4\ 4\ 1\ 2end{bmatrix}.

ee also

*Binary matrix

External links

* [http://www.opengl.org/registry/specs/NV/vertex_program.txt OpenGL Vertex Program documentation]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Swizzling — may refer to: * Pointer swizzling a computer science term. * Swizzling (computer graphics) a computer graphics term …   Wikipedia

  • Swizzle — may refer to: * The Rum Swizzle, a cocktail * A swizzle stick, a stick for stirring cocktails. * In acro dance, a movement in which a dancer rotates 360 degrees while swinging his partner almost to the floor and then back to upright. * In figure… …   Wikipedia

  • Integer overflow — In computer programming, an integer overflow occurs when an arithmetic operation attempts to create a numeric value that is larger than can be represented within the available storage space. For instance, adding 1 to the largest value that can be …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”