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

Method WriteCamera

IO/Export/vtkRIBExporter.cxx:434–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432static void AimZ(FILE* filePtr, RtPoint);
433
434void vtkRIBExporter::WriteCamera(vtkCamera* aCamera)
435{
436 RtPoint direction;
437 double position[3], focalPoint[3];
438
439 aCamera->GetPosition(position);
440 aCamera->GetFocalPoint(focalPoint);
441
442 direction[0] = focalPoint[0] - position[0];
443 direction[1] = focalPoint[1] - position[1];
444 direction[2] = focalPoint[2] - position[2];
445 vtkMath::Normalize(direction);
446
447 RtFloat angle = aCamera->GetViewAngle();
448 vtk::print(this->FilePtr, "Projection \"perspective\" \"fov\" [{:f}]\n", angle);
449 PlaceCamera(this->FilePtr, position, direction, aCamera->GetRoll());
450
451 vtk::print(this->FilePtr, "Orientation \"rh\"\n");
452}
453
454/*
455 * PlaceCamera(): establish a viewpoint, viewing direction and orientation

Callers 1

WriteDataMethod · 0.95

Calls 5

PlaceCameraFunction · 0.85
GetRollMethod · 0.80
NormalizeFunction · 0.50
printFunction · 0.50
GetPositionMethod · 0.45

Tested by

no test coverage detected