-
Hello, I am aiming to achieve a flood simulation effect using iTwin.js, similar to the ocean effect in three.js: https://threejs.org/examples/?q=water#webgl_shaders_ocean. My initial approach was to add a blue rectangular box to the model and control its height to simulate rising and falling water levels. However, after adding the blue box to my model, I noticed that when I rotate the model, the box is not fully visible. I want it to be visible from any angle, just like my model. Is this due to the camera settings? Here is the reference code I used to add the box: https://www.itwinjs.org/sandboxes/iTwinPlatform/Simple%203d Do you have any alternative approaches or suggestions? I appreciate your help and advice. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
The view's near and far planes are computed from the bounding boxes of the geometry in the view, but this doesn't currently include decorators. So your decoration geometry can get clipped when it extends outside of the iModel's bounding box. If you were drawing your geometry as a tile tree instead of a decorator, its bounding box would be included in the computation of the view frustum. And IMO the kind of geometry you are trying to draw (something that's supposed to be part of the scene, instead of just "decorating" it) should be drawn as a tile tree. You can very easily create a tile tree from a graphic and add it to the scene using TileTreeReference.createFromRenderGraphic. |
Beta Was this translation helpful? Give feedback.
-
@pmconne Whenever I zoom in, it causes the display to be incomplete. I suspect this might be related to the frustum, so I made some modifications, but I failed.
"This is the problematic image. Could you help me analyze what is causing this issue? Thank you." |
Beta Was this translation helpful? Give feedback.
Fixed by #6876.