Fixed the coordinate offset problem when converting osgb to 3dtiles that can occur when the tiles are too far from the origin #249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复了当瓦片与原点距离过远时,可能会出现的坐标偏移问题。也许需要更多的测试数据。引入了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.