Class StereoHelper
- Namespace
- HelixToolkit.Wpf
- Assembly
- HelixToolkit.Wpf.dll
Contains helper methods for stereoscopic views.
public static class StereoHelper
- Inheritance
-
StereoHelper
- Inherited Members
Methods
CalculateStereoBase(double, double, double, double)
Calculate the stereo base using the full Bercovitz formula B = P(LN/(L-N)) (1/F - (L+N)/2LN) http://nzphoto.tripod.com/stereo/3dtake/fbercowitz.htm
public static double CalculateStereoBase(double P, double L, double N, double F)
Parameters
PdoubleParallax aimed for, in mm on the film
LdoubleLargest distance from the camera lens, mm
NdoubleNearest distance from the camera lens, mm
FdoubleFocal length of the lens, mm
Returns
- double
The stereo base
CalculateStereoBase(double, double, double, double, double)
Calculate the stereo base using the full Bercovitz formula
public static double CalculateStereoBase(double L, double N, double screenWidth, double depthRatio, double hfov)
Parameters
LdoubleLargest distance from the camera lens
NdoubleNearest distance from the camera lens
screenWidthdoubleWidth of screen
depthRatiodoubledepth ratio 1/30
hfovdoubleHorizontal field of view
Returns
- double
The stereo base
CreateClone(Visual3D)
Create a clone of a Visual3D
public static Visual3D? CreateClone(Visual3D v)
Parameters
vVisual3Da Visual3D
Returns
- Visual3D
the clone
FindFocalLength(double, double)
Find the focal length given the field of view and the format http://en.wikipedia.org/wiki/Angle_of_view
public static double FindFocalLength(double fov, double format)
Parameters
Returns
- double
The focal length in the same unit as the format
UpdateStereoCameras(PerspectiveCamera?, PerspectiveCamera?, PerspectiveCamera?, double, bool, bool, bool)
Updates the left and right camera based on a center camera.
public static void UpdateStereoCameras(PerspectiveCamera? centerCamera, PerspectiveCamera? leftCamera, PerspectiveCamera? rightCamera, double stereoBase, bool crossViewing = false, bool sameUpDirection = true, bool sameDirection = true)
Parameters
centerCameraPerspectiveCameraCenter camera (input)
leftCameraPerspectiveCameraLeft camera (is updated)
rightCameraPerspectiveCameraRight camera (is updated)
stereoBasedoubleStereo base
crossViewingbooltrue for cross-viewing, false for parallel-viewing (default is
false)sameUpDirectionbooluse the same UpDirection for both cameras (default is
true)sameDirectionbooluse the same LookDirection for both cameras (default is
true)