How to obtain camera stream from cameras

Hi,

I want to stream a camera of a viewport in Rhino into Oculus, is there a way to get a stream of images from a camera? If it’s possible, which method should I use?

Thanks

The Display Pipeline has a method called GetFrameBuffer, which returns a const reference to a CRhinoUiDib whose contents are that of the current frame buffer for the given pipeline.

However, since there is no guarantee when a call to this method can be made, there is also no guarantee that the contents truly represent the “current” or “active” frame buffer (i.e. in many cases it will contain the contents of the previous frame).

Therefore, there needs to be a way to force the contents to get updated, which is what CaptureFrameBuffer method does. It basically copies the contents of the current back buffer into the pipeline’s frame buffer dib.

However, the capture method has a little smarts to it so that it’s not always capturing the same frame buffer over and over again due to consecutive calls.

So basically any plugin that wants to play around with the frame buffer contents would do the following:

if (dp.CaptureFrameBuffer(true))
{
  // Bitmap containing the current frame buffer for the given pipeline
  const CRhinoUiDib& dib = dp.GetFrameBuffer();
}

Not sure this helps, but its something to try.