本文介绍了如何在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;



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

解决方案

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

解决方案


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

09-06 05:51