-
in the ply file, each vertex has scaling and rotation. in your code, you first construct the covariance matrix out of those values, and then, in the shader, you project the 3d covariance matrix to 2d and then obtain the eigen vectors again as the 2D basis to construct a rectangle for rendering. But why don't you obtain 3D eigen vectors from scaling and rotation first and then just project the 3D eigen vectors to 2D? is it necessary to convert things to the covariance matrix to calculate the projection? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
nvm, on a secondary thought, if an eigen vector is perpendicular to the screen plane, the vector projection will become a point. does 2d covariance matrix projection work with perspective matrix? or only orthogonal matrix? Thank you |
Beta Was this translation helpful? Give feedback.
-
TBH, I also don't get the following code if (transform) {
transform3x3.setFromMatrix4(transform);
transform3x3Transpose.copy(transform3x3).transpose();
transformedCovariance.multiply(transform3x3Transpose);
transformedCovariance.premultiply(transform3x3);
} where you apply a transform to the covariance. The transform can contain translation, but when you construct a 3x3 matrix out of a 4x4 matrix, the translation will be thrown away? |
Beta Was this translation helpful? Give feedback.
-
I'm not very familiar with WebGPU, so I'm not entirely sure what is happening in your code -- Are you by any chance trying to apply to the covariance matrix to the 3D sphere? You should get the correct result if you just apply the original scale & rotation for the splat to the sphere instead, and then apply a uniform scale of roughly 2.0 * log10 of the splat's alpha. |
Beta Was this translation helpful? Give feedback.
right now, only a perspective projection will work -- The shader that renders the splat assumes a perspective projection and builds a Jacobian for one with the specified focal length to form a linear approximation of the projection transformation.