如何找到视点坐标? [英] How to find view point coordinates?

查看:214
本文介绍了如何找到视点坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有太阳的方位角,仰角和方向向量.我想在太阳光线的方向上放置一定距离的视点.谁能描述或提供指向资源的链接,以帮助我理解和实施所需的步骤?

I have azimuth , elevation and direction vector of the sun.. i want to place a view point on sun ray direction with some distance. Can anyone describe or provide a link to a resource that will help me understand and implement the required steps?

我使用笛卡尔坐标系从方位角和高程中查找方向矢量,然后进行查找 此问题的视口原点图像

I used cartesian coordinate system to find direction vector from azimuth and elevation.and then for find viewport origin.image for this question

x = distance
y = distance* tan azimuth
z = distance * tan elevation.

我想找到那个距离值...怎么办?

i want to find that distance value... how?

推荐答案

  1. 方位角坐标系参考的是NEH(北东北高(上))参考框架!!!

在您的图像链接中,它引用的是-Y轴,除非您不渲染世界,而是进行一些非线性图形绘制投影,那么它是哪一个?

in your link to image it is referencing to -Y axis which is not true unless you are not rendering the world but doing some nonlinear graph-plot projection so which one it is?

在此处 ECEF/WGS84和NEH ,您可以了解如何计算 NEH WGS84

btw here ECEF/WGS84 and NEH you can find out how to compute NEH for WGS84

正如我所看到的,坐标之间的计算很差,因此请清楚,这是这样的:

As I can see you have bad computation between coordinates so just to be clear this is how it looks like:

是全局地球视图,并为其位置(其原点)计算了一个 NEH .中间是与表面对齐的侧视图,右边是与表面对齐的俯视图.蓝色洋红色绿色是输入的方位坐标,棕色是x,y,z笛卡尔投影(坐标在其轴上),因此:

on the left is global Earth view and one NEH computed for its position (its origin). In the middle is surface aligned side view and on the right is surface aligned top view. Blue magenta green are input azimutal coordinates, Brown are x,y,z cartesian projections (where the coordinate is on its axis) so:

Dist'= Dist *cos(Elev  );
z    = Dist *sin(Elev  );
x    = Dist'*cos(Azimut);
y    =-Dist'*sin(Azimut);

如果您使用不同的参考系或轴方向,请相应地对其进行更改...

if you use different reference frame or axis orientations then change it accordingly ...

我怀疑您使用4x4均匀变换矩阵

用于表示坐标系并保持您的视口,因此请看这里:

for representing coordinate systems and also to hold your view-port so look here:

构建视口

您需要X,Y,Z轴矢量和O原点位置. O您已经拥有(至少您认为),并且Z轴是射线方向,因此您也应该拥有它.现在只需将X,Y计算为与某物对齐(否则视图将围绕射线旋转),我为此使用NEH:

You need X,Y,Z axis vectors and O origin position. O you already have (at least you think) and Z axis is the ray direction so you should have it too. Now just compute X,Y as alignment to something (else the view will rotate around the ray) I use NEH for that so:

view.Z=Ray.Dir // ray direction
view.Y=NEH.Z // NEH up vector
view.X=view.Y x view.Z // cross product make view.X axis perpendicular to Y ansd Z
view.Y=view.Z x view.X // just to make all three axises perpendicular to each other
view.O=ground position - (distance*Ray.Dir);

要使其成为有效的view_port,您必须:

To make it a valid view_port you have to:

view = inverse(view)*projection_matrix;

为此,您需要逆矩阵计算

如果您想要整个东西

然后,在这种情况下,您还想添加太阳/地球位置计算:

Then you also want to add the Sun/Earth position computation in that case look here:

距离

现在很明显,如果要将距离设置为Sun,那么您只需设置距离即可,它将是distance=1.0 AU;(天文单位),但是距离很大,如果您有远见,您的地球将是非常小,而是使用一些更近的​​距离以匹配您的视图尺寸,请看这里:

Now that is clear what is behind you just need to set the distance if you want to set it to Sun then it will be distance=1.0 AU; (astronomical unit) but that is huge distance and if you have perspective your earth will be very small instead use some closer distance to match your view size look here:

这篇关于如何找到视点坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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