连杆具有3个关节和9个自由度。每个关节关联3个自由度,即分别沿y,z,x轴的旋转角度
void Bone_Animation::setJacobian(int id)
{
goal = target - blue_position_end;
goalVector = { goal.x, goal.y, goal.z, 1.0f };
if (id == 0) {
v1 = cross(0,0,1), (blue_position_end - red_position_end));
v2 = cross(0,0,1), (blue_position_end - yellow_position_end));
v3 = cross(0,0,1), (blue_position_end - pink_position_end));
}
if (id == 1) {
v1 = cross(glm::vec3(1,0,0), (blue_position_end - red_position_end));
v2 = cross(glm::vec3(1,0,0), (blue_position_end - yellow_position_end));
v3 = cross(glm::vec3(1,0,0), (blue_position_end - pink_position_end));
}
jacobian_matrix[id] = { { v1.x, v2.x, v3.x,0.f },
{ v1.y, v2.y, v3.y,0.f } ,
{ v1.z, v2.z, v3.z,0.f } ,
{ 0.f, 0.f, 0.f ,1.f } };
}
我有两个单独的雅可比矩阵,一个用于z轴旋转,一个用于X轴旋转。 id = 0用于z轴旋转,而axis = 1用于x轴旋转。我没有得到期望的结果
有没有一种方法可以同时计算x和z轴的v1,v2,v3,并且仅维护一个雅可比矩阵。