HOME

TheInfoList



OR:

In
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great deal ...
, swizzling is the ability to compose vectors by arbitrarily rearranging and combining components of other vectors. For example, if A = , where the components are x, y, z, and w respectively, you could compute B = A.wwxy, whereupon B would equal . Additionally, combining two two-component vectors can create a four-component vector, or any combination of vectors and swizzling. This is common in
GPGPU General-purpose computing on graphics processing units (GPGPU, or less often GPGP) is the use of a graphics processing unit (GPU), which typically handles computation only for computer graphics, to perform computation in applications traditiona ...
applications. In terms of
linear algebra Linear algebra is the branch of mathematics concerning linear equations such as: :a_1x_1+\cdots +a_nx_n=b, linear maps such as: :(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n, and their representations in vector spaces and through matric ...
, this is equivalent to multiplying by a matrix whose rows are
standard basis In mathematics, the standard basis (also called natural basis or canonical basis) of a coordinate vector space (such as \mathbb^n or \mathbb^n) is the set of vectors whose components are all zero, except one that equals 1. For example, in th ...
vectors. If A=(1,2,3,4)^T, then swizzling A as above looks like :A.wwxy = \begin 0&0&0&1 \\ 0&0&0&1 \\ 1&0&0&0 \\ 0&1&0&0 \end\begin 1\\ 2\\ 3\\ 4\end = \begin 4\\ 4\\ 1\\ 2\end


See also

*
Z-order curve In mathematical analysis and computer science, functions which are Z-order, Lebesgue curve, Morton space-filling curve, Morton order or Morton code map multidimensional data to one dimension while preserving locality of the data points. It ...


References


External links


OpenGL Vertex Program documentation
Swizzling {{Compu-graphics-stub