简体   繁体   English

如何在DirectX中的网络摄像头框架上渲染3D场景?

[英]How to render 3d scene over webcam frame in DirectX?

I'm capturing webcam using AForge so I've every frame as a bitmap. 我正在使用AForge捕获网络摄像头,因此每个帧都作为位图。 I would like to render some scene over it. 我想在上面渲染一些场景。 Currently I am rendering DirectX (SlimDX) scene over C# Panel control. 目前,我正在通过C#Panel控件渲染DirectX(SlimDX)场景。

Is there a possibility to put bitmap to ZBuffer or maybe some other way to achieve it? 是否可以将位图放置到ZBuffer或其他实现方法?

To do this you need to insert a transform filter into the DirectShow graph. 为此,您需要在DirectShow图形中插入一个转换过滤器。 Basically You take in the video frame you convert it to a texture, render the video texture to the back of the frame buffer and then do whatever 3D rendering you wish to do over the top. 基本上,您需要将视频帧转换为纹理,然后将视频纹理渲染到帧缓冲区的背面,然后在顶部进行任何3D渲染。

Its, by no means, a simple process. 这绝不是一个简单的过程。 Directshow can get quite involved. Directshow可以参与其中。 The helper classes in the windows SDK help a lot, however. 但是,Windows SDK中的帮助程序类有很大帮助。 Alas though I'm not sure how you would then insert your filter into the graph in AForge ... las,虽然我不确定您如何将过滤器插入AForge的图形中...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM