Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calPosition 和 geoPosition2World 逻辑重复 以及 worldPostion2Screen 运算坐标公式的疑惑 #18

Open
shownoso opened this issue Jun 21, 2020 · 0 comments

Comments

@shownoso
Copy link

这是一个疑惑。

  1. calPosition 和 geoPosition2World 逻辑重复了
  2. worldPostion2Screen 空间坐标转为屏幕坐标是不是可以理解为一种 scale 的关系?
var result = {
    x: Math.round((vector.x + 1) * window.innerWidth / 2 - window.innerWidth / 2),
    y: Math.round(window.innerHeight / 2 - (-vector.y + 1) * window.innerHeight / 2),
    z: 0
  };
// 代码中计算公式有点奇怪,简化后如下...
var result = {
    x: Math.round(vector.x * window.innerWidth / 2),
    y: Math.round(vector.y  * window.innerHeight / 2),
    z: 0
  };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant