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

Fixed the coordinate offset problem when converting osgb to 3dtiles that can occur when the tiles are too far from the origin #249

Merged
merged 2 commits into from
May 31, 2023

Conversation

Steelwall2014
Copy link
Contributor

修复了当瓦片与原点距离过远时,可能会出现的坐标偏移问题。也许需要更多的测试数据。引入了glm和Eigen库。一开始我尝试了逐点变换,但是发现会导致纹理变形,所以后来尝试了下面这个方法:1、把瓦片包围盒的8个顶点转到地理坐标系,再转到Cesium ECEF坐标系,再转回原始osgb瓦片的投影坐标系,计算出消除偏移后的包围盒;2、用这8个顶点前后的变化计算出一个变换矩阵;3、把这个变换矩阵应用到瓦片的所有顶点上。
Fixed a possible coordinate offset issue when the tile is too far from the origin. Maybe more test data is needed. The glm and Eigen libraries are introduced. At first I tried point-by-point transformations, but found that it would distort the texture, so I tried the following method: 1. Transfer the 8 vertices of the tile bounding box to the geographic coordinate system, then to the Cesium ECEF coordinate system, and then transform back to the projected coordinate system of the original osgb tileset; 2. Calculate a transformation matrix is by the change of these 8 vertices; 3. Apply this transformation matrix to all vertices of the tile.

@fanvanzh
Copy link
Owner

有测试验证过吗

@Steelwall2014
Copy link
Contributor Author

这个是用改之前的工具转的,可以看出来和cesium提供的地形水平位置对不上
image
这个是用改之后的工具转的。
image
不过我手上出现了明显的坐标偏移的数据只有这一份。。。。。所以还需要更多的测试数据,我看有几个人提的issue是和这个有关的

@fanvanzh
Copy link
Owner

感谢你的PR,效果看上去很棒

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

Successfully merging this pull request may close these issues.

2 participants