如何在WPF中将多个摄像机添加到viewport3D [英] How to Add multiple cameras to viewport3D in WPF

查看:353
本文介绍了如何在WPF中将多个摄像机添加到viewport3D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用透视和正交摄影机以四个不同的角度在屏幕上查看我的3D对象.我正在考虑为一个摄像机分别创建四个单选按钮,然后检查将切换到该特定视图.如何在WPF中执行此操作?我已经在Google中搜索过,但是没有找到一个令人信服的答案.任何帮助将非常感激.谢谢

PS:我尝试使用< viewport3d.camera>四次,但出现错误,表明该方法已定义或其他内容.

另外,请让我知道如何在运行时通过拖动鼠标在3D屏幕上移动相机.我想从不同角度查看对象而不旋转它.

谢谢

I want to view my 3D object on the screen in four different angles using a perspective and orthographic camera. I am thinking of creating four radio buttons each for one camera, checking on which will switch over to that particular view. How to do this in WPF ? I have searched in google, but have not found a convincing answer for a betginner. Any help would be much appreciated. Thanks

PS: I tried using <viewport3d.camera> four times, but I get an error that the method is already defined or something.

Also, Please let me know how to move the camera on 3D screen by dragging the mouse during run-time. I would like to view an object from different angles without rotating it.

Thanks

推荐答案

我想以四个不同的角度在屏幕上查看我的3D对象
任何一个3d场景(Viewport3D)只能具有一台摄像机.如果要使用4个不同的视图,则必须有4个Viewport3D并为每个视图复制3d世界.

PS:我尝试使用过四次,但出现错误,表明该方法已定义或其他内容.
您应该向我们展示了您尝试过的内容和确切的错误.

请让我知道如何在运行时通过拖动鼠标在3D屏幕上移动相机
这是Q& A,而不是给我写文章",涉及的数学和很好的代码量不容易理解,尤其是当我们不了解您的水平时.关于该主题的文章已经很多.例如
WPF 3D入门 [
I want to view my 3D object on the screen in four different angles
Any one 3d scene (Viewport3D) can only have one camera. if you want 4 different views then you have to have four Viewport3D and replicate your 3d world for each of them.

PS: I tried using four times, but I get an error that the method is already defined or something.
You should have shown us what you had tried and the exact error.

Please let me know how to move the camera on 3D screen by dragging the mouse during run-time
This is a Q&A not a "write me an article", the math involved in this and the amount of code well is not easy to understand, especially not when we do not know your level. And there is already tons of articles out there on that subject. E.g.
WPF 3D Primer[^]


这篇关于如何在WPF中将多个摄像机添加到viewport3D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆