Closed aoyaZY closed 3 years ago
@aoyaZY , thanks for your issue.
Changing the camera's near plane won't work, because we have a special class which takes care of computing the correct near / far plane.
get clipPlanesEvaluator(): ClipPlanesEvaluator
in MapView
. Which defaults to TiltViewClipPlanesEvaluator
.
If you want to control this yourself directly, you can use a FixedClipPlanesEvaluator
and pass it to the MapView
during construction and set the near / far plane as you want.
Please let me know what you think.
@nzjony , thanks for your answer.
I've tried to pass a new FixedClipPlanesEvaluator(1, 10)
to the MapView
during construction,but the map goes wrong without reporting error.
By the way, I've checked the MapView's near plane, default TiltViewClipPlanesEvaluator.near
is 1, camera.near
is 1500, camera.near
seems to be the one that's working
the one that's working
@aoyaZY The FixedClipPlanesEvaluator wont work for most cases, as for the tilted map the frustum needs adjustments depending on the tilt angle, to get an acceptable view of the map. The TiltViewClipPlanesEvaluator(which is the default) will do this adjustments, so if you move the camera tilt angle, it will most probably show you different near and far plane values, unfortunately it assumes the world to be flat and probably therefor cuts your buildings You can try to set ClipPlanesEvaluator.maxElevation to a value that works for you.
@nzjony , thanks for your explanation.
I just found that vue maybe the key.
I initialized map and added model both on vue project and single html page by the same way,
in single html page, TiltViewClipPlanesEvaluator
works well, but vue not
Maybe you can test it on vue
Hi @aoyaZY,
@FraukeF is correct, setting the maxElevation
is the best way to fix this issue, and the FixedClipPlanesEvaluator
shouldn't be used. Sorry, I should have asked what your use case is.
@nzjony , @FraukeF , I tried to set maxElevation
to different value ,but nothing change
@aoyaZY yes, you are right, sorrry for the wrong information, I checked and the maxElevation is actually overridden by a calculation based on the DataSource.maxGeometryHight and some scale factor, see https://github.com/heremaps/harp.gl/blob/master/%40here/harp-mapview/lib/MapView.ts#L3210 , please try to modify the `maxGeometryHeight' property of your datasource (or the VectorTileDataSource) instead
@FraukeF , the building is not base on VectorTileDataSource
, it's a .fbx
model.
And the datasource is WebTileDataSource
, the problem will show up
@aoyaZY, unfortunately we have no other way at the moment to achieve this behaviour with the default ClipPlaneEvaluator... If you use some other DataSource as a baselayer, you could still modify the maxGeometryHeight of that one in the mean time to match the height of your fbx models.... I ll create an internal task to support the geometryHeight independent of DataSources, I ll let you know when we have some other solution for it.
@FraukeF , thanks a lot ! Now I get what you really mean, and work it out. This problem is indeed difficult to solve, thank you bro! Hope you guys are all healthy, good luck!
I tried to change camera frustum near plane, I set
map.camera.near = 200; map.camera.updateProjectionMatrix(); but it dosen't work. What is the default value of the camera frustum near plane? How can I set it or change it?