使相机LookDirection看前脸 [英] Make Camera LookDirection look front face

查看:1055
本文介绍了使相机LookDirection看前脸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何看待 3D WPF

我很困惑,设置XYZ为LookDirection。

I am confused to set X Y Z for LookDirection.

我不知道当我设置XYZ,我不知道摄像头正在看会发生什么。我不知道同样的事情 UpDirection

I don't know what happens when I set xyz and I don't know where camera is looking at. I don't know the same thing for UpDirection.

下面是我的相机性能:

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

的问题是,照相机正在从背后。 模型显示如下图所示的立方体。

The problem is that camera is looking from behind. Model is shown like cube below.

如何让它看上去前脸?

此外,请解释如何设置XYZ。我知道是什么性质做,但我不能想象他们。

Also please explain how to set xyz. i know what properties do but i cant imagine them.

我认为X是由右至left.Y的深度。 Z是达到了。

I think X is from right to left.Y is depth. Z is up to down .

推荐答案

想象一下,而不是一个摄像头,你四处移动你的头在三维空间。那么 Camera.Position 的规定,你的头的位置, Camera.LookDirection 决定你在寻找方向, Camera.UpDirection 显示你的头的方向。下面的图片清楚的东西给你。

Imagine, instead of a camera, you're moving your head around in 3D space. then Camera.Position is specifying where your head is located, Camera.LookDirection determines the direction you're looking at and Camera.UpDirection shows the orientation of your head. the following pictures clear things up for you.

在第一幅图像,相机是集中在+ Z轴低头-Z轴和你的形状:

In the first Image, Camera is centered on the +Z axis looking down to -Z axis and to your shape:

当您设置 camera.Position 来,例如(X = 1,Y = 0,Z = 10),那么喜欢这款相机位置的变化:

When you set camera.Position to for example (x=1, y=0, z=10) then camera position changes like this:

结果,摄像机移动一点点的权利,因此,你会看到你的形状在视图的左侧。

as a result, camera moves a little to the right and therefore you will see your shape at the left side of the view.

现在,如果 camera.LookDirection 被改口说(X = 0,Y = 1,Z = -1),那么相机只是着眼于点(0, 1,-1)是这样的:

Now if camera.LookDirection gets changed to say (x=0, y=1, z=-1), then camera simply looks at the point (0,1,-1) like this:

camera.UpDirection 决定了你的摄像点的顶部。在下面的图片,设置 camera.UpDirection 来(-0.5,1,0)导致相机逆时针旋转:

camera.UpDirection determines where the top of your camera points at. In the following picture, setting camera.UpDirection to (-0.5,1,0) results in rotation of the camera counter clockwise:

我希望这些照片清楚的东西给你。

I hope these pictures clear things up for you.

这篇关于使相机LookDirection看前脸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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