Commit a1815ca8 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #1758 from paroj:ovis_texup

parents 34f2e6e5 c64f925a
...@@ -204,10 +204,16 @@ public: ...@@ -204,10 +204,16 @@ public:
/** /**
* set intrinsics of the camera * set intrinsics of the camera
* @param K intrinsic matrix *
* @param K intrinsic matrix or noArray(). If noArray() is specified, imsize
* is ignored and zNear/ zFar can be set separately.
* @param imsize image size * @param imsize image size
* @param zNear near clip distance or -1 to keep the current
* @param zFar far clip distance or -1 to keep the current
*/ */
CV_WRAP virtual void setCameraIntrinsics(InputArray K, const Size& imsize) = 0; CV_WRAP virtual void setCameraIntrinsics(InputArray K, const Size& imsize,
float zNear = -1,
float zFar = -1) = 0;
}; };
/** /**
......
...@@ -641,10 +641,13 @@ public: ...@@ -641,10 +641,13 @@ public:
} }
} }
void setCameraIntrinsics(InputArray K, const Size& imsize) void setCameraIntrinsics(InputArray K, const Size& imsize, float zNear, float zFar)
{ {
Camera* cam = sceneMgr->getCamera(title); Camera* cam = sceneMgr->getCamera(title);
_setCameraIntrinsics(cam, K, imsize);
if(zNear >= 0) cam->setNearClipDistance(zNear);
if(zFar >= 0) cam->setFarClipDistance(zFar);
if(!K.empty()) _setCameraIntrinsics(cam, K, imsize);
} }
void setCameraLookAt(const String& target, InputArray offset) void setCameraLookAt(const String& target, InputArray offset)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment