# Visualization of a Multidimensional Point Cloud as a 3D Swarm of Avatars
## 3 Methodology
### Implementation
#### 3.2.2 Filtering Matrix  
The first step, corresponding to Equation (1), is to create the filtering matrix, which in the implementation has the following form:  
Eigen::MatrixXd F(k + m, n); F.setZero();  
To simplify later operations, we assume that the first \(k\) rows of this matrix correspond to spatial features (in our implementation: X, Y, Z, T), and the following \(m\) rows correspond to visual features (e.g., avatar appearance details). This separation is formally described by Equations (2) and (3). The matrix \(F\) is initially filled with zeros and then completed based on the feature assignments: \begin{table}
\begin{tabular}{l l l} \hline \hline
**Category** & **Feature** & **Description** \\ \hline \hline \multicolumn{3}{l}{User-defined spatial features} \\ \hline spatial & X & X coordinate in 4D space \\ spatial & Y & Y coordinate in 4D space \\ spatial & Z & Z coordinate in 4D space \\ spatial & T & T coordinate in 4D space \\ \hline \multicolumn{3}{l}{User-defined avatar facial attributes} \\ \hline visual & Skin\_C & avatar’s skin color \\ visual & Hair\_C & avatar’s hair color \\ visual & Eye\_S & distance between the avatar’s eyes \\ visual & Nose\_L & avatar’s nose length \\ visual & Mouth\_W & avatar’s mouth width \\ visual & Smile & degree of curvature of the avatar’s smile \\ visual & From & level of frowning expression \\ visual & Hair\_L & avatar’s hair length \\ visual & Face\_Elong & avatar’s face proportions \\ visual & Iris\_C & avatar’s iris color \\ \hline \multicolumn{3}{l}{features not defined by the user} \\ \hline \hline \multicolumn{3}{l}{anonymous} & used for principal component analysis (PCA) \\ \hline \multicolumn{3}{l}{Features selected by the user to skip} \\ \hline \hline \multicolumn{3}{l}{skipped} & excluded from further processing \\ \hline \end{tabular}
\end{table} 
Table 2: List of features used in the implementation. Figure 3: Dialog window for assigning input dimensions to feature categories: spatial, visual, unnamed, or skipped. For spatial and visual categories, a specific output feature label can be selected. First, for each of the \(h_{S}\) spatial features and \(h_{V}\) visual features selected by the user, one is set at the intersection of the row for that feature and the column of the original input dimension. Then, if there are still unused rows in \(F\), and the user has selected anonymous features (\(h_{A}>0\)), a PCA is performed on the input dimensions assigned to those anonymous features. The \((k+m)-(h_{S}+h_{V})\) strongest components are selected, and their coefficient vectors are inserted into the remaining empty rows of \(F\). The transformed data is calculated as the product of the filtering matrix and the input matrix, followed by normalization. The procedure for creating the filtering matrix and transforming the input data is shown in Algorithm 1. Input: data matrix \(X\); assignment list (spatial, visual, anonymous, or ignored)  
Output: projected data \(X_{\text{filtered}}\)  
```
1:Initialize \(F\) (zero matrix)
2:for each feature index \(j\)do
3:if assignment of feature \(j\) is ignored then
4: Skip
5:else if assignment of feature \(j\) is spatial then
6: Set corresponding spatial row in \(F\)
7:else if assignment of feature \(j\) is visual then
8: Set corresponding visual row in \(F\)
9:else if assignment of feature \(j\) is anonymous then
10: Store index of feature \(j\) for PCA
11:endif
12:endfor
13:if number of mapped features \((h_{S}+h_{V})<(k+m)\)then
14: Perform SVD on anonymous features
15: Select \((k+m)-(h_{S}+h_{V})\) top components
16: Insert principal directions into empty rows in \(F\)
17:endif
18:\(X_{\text{filtered}}=F\times X\)
19:for each row in \(X_{\text{filtered}}\)do
20: Center and scale (standardize)
21:if row corresponds to spatial dimension then
22: Shift by \(+0.5\)
23:endif
24:endfor
```  
**Algorithm 1** Semantic filtering and data projection. In this way, we obtain a table of \(N\) points, each with \((k+m)\) dimensions.