如何在WPF 3D中旋转网格 [英] How can I rotate the grid in WPF 3D

查看:87
本文介绍了如何在WPF 3D中旋转网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在wpf 3D中创建了一个网格,并在前后顶部底部视图中手动设置了不同的摄像头位置。



并用鼠标旋转它。





问题是它在顶视图下完美运行所有旋转都非常精细但是当我应用另一个视图时它会反方向旋转



网格应该在原点查看(0,0,0)



什么我试过了:



这是底部视图的相机位置。



相机.Position = new Point3D(0,0,-5);

camera.LookDirection = new Vector3D(0,0,5);

camera.UpDirection = new Vector3D (0,1,0);



转换完成后使用

camera.transform = trackball.transform;



但在底视图中相机正在相反的方向旋转...请帮助

解决方案

你做了一个很好的尝试。我不是wpf 3d的专家。但我建议WPF Helix Toolkit - 是一个用于WPF的3D库,它具有3D视口,具有所有必要的功能,试一试

I have created a grid in wpf 3D and manually set different camera positions front back top bottom views.

and rotated it by the mouse.


the problem is that it is working perfectly fine with top view all rotations are perfectly fine but as i apply another another view it rotates in opposite direction

the grid is supposed to view at origin(0,0,0)

What I have tried:

Here is the camera positions for bottom view.

camera.Position = new Point3D(0, 0, -5);
camera.LookDirection = new Vector3D(0, 0, 5);
camera.UpDirection = new Vector3D(0, 1, 0);

the transformation is done with
camera.transform=trackball.transform;

but in bottom view camera is rotating in opposite directions...pls help

解决方案

You did a good try. I am not expert in wpf 3d. But I suggest WPF Helix Toolkit - is a 3D library for WPF, it has 3D viewport with all necessary functionalities, give it a try.


这篇关于如何在WPF 3D中旋转网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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