Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello, everyone. I tried to assemble the components with a matrix through the function "ProAsmcompAssemble()". I found that some matrices could be assembled successfully, some matrices could not, and the matrices themselves were correct.
For example <matrix_1> cannot be assembled, it will return "PRO_TK_BAD_INPUTS".
ProMatrix matrix_1 = { { 0.707107, 0.707107, 0.0, 0.0 },
{-0.707107, 0.707107, 0.0, 0.0},
{0.0, 0.0, 1.0, 0.0},
{33.2321, 64.3448, -130.0, 1.0} };
The following matrix <matrix_2> can be assembled successfully,
ProMatrix matrix_2 = { {1.0, 0.0, 0.0, 0.0},
{0.0, 1.0, 0.0, 0.0},
{0.0, 0.0, 1.0, 0.0},
{0.0, 0.0, 0.0, 1.0} };
I don't understand why this is, how to solve this problem, can someone tell me? Thanks!
Hello, you define the values like this? I think the values are not precise enough.
If the transform matrix passed as the initial position of the component is incorrect and non-orthonormal, the function ProAsmcompAssemble() returns the error PRO_TK_BAD_INPUTS. In such scenario, you can use the function ProMatrixMakeOrthonormal() to convert this non-orthonormal matrix to an orthonormal matrix.
You can check the matrix, the length of a colum vector (without the translation) has to be 1:
sqrt(0.707107*0.707107 + (-0.707107) + (-0.707107) = 1.00000030944
I hope this helps...
Converting to an orthogonal matrix might change the orientation of the elements, right?
to add to previous post - C idiom for PI is acos(-1.0) and for PI/4 is atan(1.0).
hard coded "0.707107" value should be:
double v = sin(atan(1.0));
First:
Model matrices are 4x3 with the vectors horizontal and
View matrices are 4x4 with the vectors vertical, as far I know.
You should normalize a manual given vector before usage, to get the Len 1.0
All 3 must be normal, v1 to v2, v1 to v3 and v2 to v3 and right handed.