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

Method InterpolateCamera

Rendering/Core/vtkCameraInterpolator.cxx:435–470  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

433
434//------------------------------------------------------------------------------
435void vtkCameraInterpolator::InterpolateCamera(double t, vtkCamera* camera)
436{
437 if (this->CameraList->empty())
438 {
439 return;
440 }
441
442 // Make sure the camera and this class are initialized properly
443 this->InitializeInterpolation();
444
445 // Evaluate the interpolators
446 if (t < this->CameraList->front().Time)
447 {
448 t = this->CameraList->front().Time;
449 }
450
451 else if (t > this->CameraList->back().Time)
452 {
453 t = this->CameraList->back().Time;
454 }
455
456 double P[3], FP[3], VUP[3], CR[2], VA[1], PS[1];
457 this->PositionInterpolator->InterpolateTuple(t, P);
458 this->FocalPointInterpolator->InterpolateTuple(t, FP);
459 this->ViewUpInterpolator->InterpolateTuple(t, VUP);
460 this->ClippingRangeInterpolator->InterpolateTuple(t, CR);
461 this->ViewAngleInterpolator->InterpolateTuple(t, VA);
462 this->ParallelScaleInterpolator->InterpolateTuple(t, PS);
463
464 camera->SetPosition(P);
465 camera->SetFocalPoint(FP);
466 camera->SetViewUp(VUP);
467 camera->SetClippingRange(CR);
468 camera->SetViewAngle(VA[0]);
469 camera->SetParallelScale(PS[0]);
470}
471
472//------------------------------------------------------------------------------
473void vtkCameraInterpolator::PrintSelf(ostream& os, vtkIndent indent)

Callers 2

animateFunction · 0.45

Calls 11

backMethod · 0.80
SetViewUpMethod · 0.80
SetViewAngleMethod · 0.80
SetParallelScaleMethod · 0.80
emptyMethod · 0.45
frontMethod · 0.45
InterpolateTupleMethod · 0.45
SetPositionMethod · 0.45
SetFocalPointMethod · 0.45
SetClippingRangeMethod · 0.45

Tested by 1

animateFunction · 0.36