Position and Orientation Based Cosserat Rods

Please don't post Bullet support questions here, use the above forums instead.
korzen303
Posts: 28
Joined: Thu Dec 19, 2013 12:13 pm

Position and Orientation Based Cosserat Rods

Hi Guys,

I am trying to implement this paper:
http://www.cg.informatik.uni-mainz.de/f ... t-Rods.pdf

I have got the position based rod simulation framework implemented but I got stuck on the constraints.

In eq. 37 for the correction of q there is qe_3 but I don't know how to implement this in terms of operations.
I am not sure what e_3 is. I know that the dash is quaternion conjugate (i.e. inverse). The bold e_3 is the world frame 3rd (z) basis vector, which is [0,0,1].

Thanks for your help!

EDIT: OK, earlier the paper states "The non-bold notation of p denotes that the vector is embedded into a quaternion with vector part p and scalar part 0."
So does e_3 simply equals quat[0, 0, 1, 0]?
Plus I am still not sure how to multiply the expression (the left side is Vec3f and the right is Quat4f)

Code: Select all

``````public static void ProjectStretchAndShearConstraint(ref Vector3 pA, ref Vector3 pB, ref Quaternion q, float wA, float wB, float wQ, float restLength, float kS)
{
Vector3 dir = pB - pA;
float len = Vector3.Magnitude(dir);
if (len <= EPSILON)
return;

float wSum = wA + wB + (4 * wQ * len * len);
if (wSum <= EPSILON)
return;

Vector3 d3 = q * Vector3.forward;
Vector3 dP = (1.0f / wSum) * (dir / len - d3);

pA += dP * wA * len * kS;
pB -= dP * wB * len * kS;

Vector4 dPQ = (1.0f / wSum) * (dir / len - d3) * // WHAT GOES HERE!?;

// q += dPQ * wQ * len * len;
}
``````

mobeen
Posts: 122
Joined: Thu May 05, 2011 11:47 am

Re: Position and Orientation Based Cosserat Rods

Hi Korzen,
I just read the paper superficially. For your question, in the term for correction of dq, (qe3) q is the quaternion representing the orientation of the current rod element and e3 is the material frame z axis quaternion with scalar part 0 i.e. (0,[e3.x,e3.y,e3.z]) assuming authors notation with the first element of q being scalar and the other three components as vector. Setting the scalar part as 0 removes the contribution of the first column of the quaternion matrix.

Now your question on how to go about it, check this image. By the whole thing, I mean the highlighted part. dq has to be 1x4
temp.jpg (41.88 KiB) Viewed 3580 times
See if this helps.