Shift set of points in 3d

偶尔善良 提交于 2019-11-29 18:26:34

look here: ECEF <-> ENU coordinates this might help

I rather use NEH local North,East,Height(or altitude) coordinate system

  • it is similar to compass + altimeter
  • if you are not looking in rotation axis direction (ECEF Z-axis) ... on poles
  • then North vector is just (0,0,6356754.7)-viewer_position (all in ECEF)
  • East,West vectors can be obtained as North x (0,0,6356754.7)
  • don`t remember if it is east or west (depends on your coordinate system and cross multiplicants order)
  • just check it visually and if wrong reverse the order or negate result
  • Up vector (Height or Altitude) is easy from this just Up=North x East or Up=North x West
  • again if wrong direction reverse order or negate result ...

[Notes]

  • 6356754.7 [m] is earths polar radius
  • if you viewing from poles (ECEF Z-axis)
  • then North vector and Up vector lies on the same axis (in opposite direction)
  • which means there is no east or west (singularity)
  • on south hemisphere is usually used South instead of North
  • in that case South = (0,0,-6356754.7)-viewer_position

If you three points are A, B and C. Then the three point define a plane. In general the points will not lie on a (straight) line. If they do then it becomes ambiguous what "right" means. If everything is on a sphere, then the three points will define a curve formed by the intersection of the sphere and the plane. You could form another line my finding the intersection of the sphere with a parallel plane.

I'm not quite sure what you want but I'm guessing you want the second line to lie in a parallel plane. You can find the normal to the plane by taking the cross product N=(A-B) X (C-B). It looks like you are doing something like this but you need the ^ operator. See https://www8.cs.umu.se/kurser/TDBD12/VT04/lab/osg/html/doc++/osg/Vec3.html#DOC.2.224.21

upVec = line1 ^ line2;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!