feat/vtk-3d-view #7

Merged
gaozheng merged 301 commits from feat/vtk-3d-view into main 2026-06-27 18:43:52 +08:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit 692ee057ab - Show all commits

View File

@ -223,9 +223,11 @@ void TileBasemap::refineTile(int z, int x, int y, std::set<long long>& out, int&
const auto sw = frame_->toLocal(b.south, b.west);
const auto ne = frame_->toLocal(b.north, b.east);
// 视锥剔除:瓦片 AABB 全在某视锥面外侧 → 不在视野内,直接丢弃(否则会在屏幕外乱细分耗尽预算)。
// 视锥剔除:瓦片 AABB 全在某侧面外侧 → 不在视野内,丢弃(否则屏幕外乱细分耗尽预算)。
// 只用 4 个侧面(左右上下),不用近/远裁剪面——远裁剪面随已加载几何变化,
// 首帧底图未齐时远面贴得近会误剔除远处可见瓦片(等多久都不出、微动才出)。
const double zmin = -1000.0, zmax = 1000.0; // 地形起伏远小于瓦片尺度,给宽松 z 带
for (int p = 0; p < 6; ++p) {
for (int p = 0; p < 4; ++p) {
const double* pl = &frustum_[p * 4]; // 内法向:内侧 a·x+b·y+c·z+d ≥ 0
const double vx = pl[0] >= 0 ? ne.x : sw.x; // 取最朝法向的角点(p-vertex)
const double vy = pl[1] >= 0 ? ne.y : sw.y;