20 decimal focalFactor = focalLength/vector.
x;
22 decimal yPixel = vector.
y*focalFactor;
23 decimal zPixel = vector.
z*focalFactor;
25 return { -yPixel + xCenter, -zPixel + yCenter };
40 decimal xPixel = -vector.
x + xCenter;
41 decimal yPixel = -vector.
y + yCenter;
54 return vector.
x >= 0 && vector.
x <= xResolution
55 && vector.
y >= 0 && vector.
y <= yResolution;
63 return DECIMAL_ATAN(xResolution/2 * pixelSize / focalLength) * 2;
Vec2 SpatialToCamera(const Vec3 &) const
Converts from a 3D point in space to a 2D point on the camera sensor.
bool InSensor(const Vec2 &vector) const
Returns whether a given pixel is actually in the camera's field of view.
decimal Fov() const
Horizontal field of view in radians.
Vec3 CameraToSpatial(const Vec2 &) const
Gives a point in 3d space that could correspond to the given vector, using the same coordinate system...
Three dimensional vector with decimaling point components.
decimal FovToFocalLength(decimal xFov, decimal xResolution)
decimal FocalLengthToFov(decimal focalLength, decimal xResolution, decimal pixelSize)
A two dimensional vector with decimaling point components.