Hi There,
You can match the CineCamera view to the Editor Viewport by adjusting the values of FieldOfView, Filmback Sensor width and height and the Min and Max settings of the Lens Focal Length.
These values have a relationship to the viewport. For example if the viewport has an aspect ratio of 1.3, a CineCamera can approximate this view by setting :
- FOV to 90
- Filmback SensorWidth and SensorHeight to values having the same aspect ratio
- Lens Min and Max Focal length using the equation for focal length e.g. (Filmback.SensorWidth /2 ) / FMath::Tan(FMath::DegreesToRadians( FOV / 2.f));
`float EditorAspecRatio = (GCurrentLevelEditingViewportClient->Viewport->GetSizeXY().X * 1.0) / GCurrentLevelEditingViewportClient->Viewport->GetSizeXY().Y;
float EditorSensorHeight = 20;
GetCineCameraComponent()->Filmback.SensorWidth = editorSensorHeight * editorAspecRatio;
GetCineCameraComponent()->Filmback.SensorHeight = editorSensorHeight ;
float EditorCurrentFocalLength = (GetCineCameraComponent()->Filmback.SensorWidth /2 ) / FMath::Tan(FMath::DegreesToRadians(EditorCameraFieldOfView / 2.f));
GetCineCameraComponent()->LensSettings.MinFocalLength = EditorCurrentFocalLength;
GetCineCameraComponent()->LensSettings.MaxFocalLength = EditorCurrentFocalLength;
GetCineCameraComponent()->SetFieldOfView( EditorCameraFieldOfView );`Also, make sure to select appropriate values for ‘Constrain Aspect Ratio’ and FOV 'Aspect Ratio Axis Constraint '. These values will need adjusted for different viewport sizes as the effective field of view is affected by the viewport size.