[vtkusers] vtkQuaternionInterpolator

Gwenaël Guillard gwenaelguillard at hotmail.com
Wed Sep 20 12:02:57 EDT 2006


Hi all,
I am trying ti use vtkQuaternionInterpolator class and I get some strange 
result: Below a simple test example that give me unexepected results

-----------------------------
  double q[4];
  float i;
  float t;
  vtkQuaternionInterpolator* splineQuat = vtkQuaternionInterpolator::New();
  splineQuat->SetInterpolationTypeToSpline();

  q[0] = 1;
  q[1] = 0;
  q[2] = 0;
  q[3] = 0;
  i = 0.0;
  splineQuat->AddQuaternion( i, q );

  q[0] = 0;
  q[1] = 1;
  q[2] = 0;
  q[3] = 0;
  i = 1.0;
  splineQuat->AddQuaternion( i, q );

  q[0] = 0;
  q[1] = 0;
  q[2] = 1;
  q[3] = 0;
  i = 2.0;
  splineQuat->AddQuaternion( i, q );

  q[0] = 0;
  q[1] = 0;
  q[2] = 0;
  q[3] = 1;
  i = 3.0;
  splineQuat->AddQuaternion( i, q );

  double qRes[4];
  t= 1.0;
  splineQuat->InterpolateQuaternion( t, qRes );
  cout<<qRes[0]<<" "<<qRes[1]<<" "<<qRes[2]<<" "<<qRes[3]<<endl;
------------------------------
it returns to me
-1.#IND -1.#IND -1.#IND -1.#IND

May someone helps me.

Best
Gwenael





More information about the vtkusers mailing list