MCPcopy Create free account
hub / github.com/Kitware/VTK / InterpolateTransform

Method InterpolateTransform

Rendering/Core/vtkTransformInterpolator.cxx:347–379  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

345
346//------------------------------------------------------------------------------
347void vtkTransformInterpolator::InterpolateTransform(double t, vtkTransform* xform)
348{
349 if (this->TransformList->empty())
350 {
351 return;
352 }
353
354 // Make sure the xform and this class are initialized properly
355 xform->Identity();
356 this->InitializeInterpolation();
357
358 // Evaluate the interpolators
359 if (t < this->TransformList->front().Time)
360 {
361 t = this->TransformList->front().Time;
362 }
363
364 else if (t > this->TransformList->back().Time)
365 {
366 t = this->TransformList->back().Time;
367 }
368
369 double P[3], S[3], Q[4];
370 vtkQuaterniond q;
371 this->PositionInterpolator->InterpolateTuple(t, P);
372 this->ScaleInterpolator->InterpolateTuple(t, S);
373 this->RotationInterpolator->InterpolateQuaternion(t, q);
374 Q[0] = vtkMath::DegreesFromRadians(q.GetRotationAngleAndAxis(Q + 1));
375
376 xform->Translate(P);
377 xform->RotateWXYZ(Q[0], Q + 1);
378 xform->Scale(S);
379}
380
381//------------------------------------------------------------------------------
382void vtkTransformInterpolator::PrintSelf(ostream& os, vtkIndent indent)

Callers 2

animateFunction · 0.80

Calls 10

backMethod · 0.80
InterpolateQuaternionMethod · 0.80
RotateWXYZMethod · 0.80
emptyMethod · 0.45
IdentityMethod · 0.45
frontMethod · 0.45
InterpolateTupleMethod · 0.45
TranslateMethod · 0.45
ScaleMethod · 0.45

Tested by 1

animateFunction · 0.64