BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
BioImager.DCamera Class Reference

Public Member Functions

void SetPosition (float x, float y, float z)
 
void Render ()
 

Properties

Matrix ViewMatrix [get]
 

Detailed Description

Definition at line 5 of file DCamera.cs.

Constructor & Destructor Documentation

◆ DCamera()

BioImager.DCamera.DCamera ( )

Definition at line 17 of file DCamera.cs.

17{ }

Member Function Documentation

◆ Render()

void BioImager.DCamera.Render ( )

Definition at line 26 of file DCamera.cs.

27 {
28 // Setup the position of the camera in the world.
29 Vector3 position = new Vector3(PositionX, PositionY, PositionZ);
30
31 // Setup where the camera is looking by default.
32 Vector3 lookAt = new Vector3(0, 0, 1);
33
34 // Set the yaw (Y axis), pitch (X axis), and roll (Z axis) rotations in radians.
35 float pitch = RotationX * 0.0174532925f;
36 float yaw = RotationY * 0.0174532925f; ;
37 float roll = RotationZ * 0.0174532925f; ;
38
39 // Create the rotation matrix from the yaw, pitch, and roll values.
40 Matrix rotationMatrix = Matrix.RotationYawPitchRoll(yaw, pitch, roll);
41
42 // Transform the lookAt and up vector by the rotation matrix so the view is correctly rotated at the origin.
43 lookAt = Vector3.TransformCoordinate(lookAt, rotationMatrix);
44 Vector3 up = Vector3.TransformCoordinate(Vector3.UnitY, rotationMatrix);
45
46 // Translate the rotated camera position to the location of the viewer.
47 lookAt = position + lookAt;
48
49 // Finally create the view matrix from the three updated vectors.
50 ViewMatrix = Matrix.LookAtLH(position, lookAt, up);
51 }

◆ SetPosition()

void BioImager.DCamera.SetPosition ( float  x,
float  y,
float  z 
)

Definition at line 20 of file DCamera.cs.

21 {
22 PositionX = x;
23 PositionY = y;
24 PositionZ = z;
25 }

Property Documentation

◆ ViewMatrix

Matrix BioImager.DCamera.ViewMatrix
get

Definition at line 14 of file DCamera.cs.

14{ get; private set; }

The documentation for this class was generated from the following file: