# Some part of mesh would disappear when I rotate it

**URL:** https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149
**Category:** Support
**Created:** [January 26, 2024, 2:33am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149 "2024-01-26T02:33:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [January 26, 2024, 2:33am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/1 "2024-01-26T02:33:59Z")

</div>

I want to show a mesh:

![image](https://discourse.vtk.org/uploads/default/original/2X/f/fc7a45ee0592162ae30acb9194e4e45b727b26d3.png)

However, when I rotate it, some part would disappear:

![image](https://discourse.vtk.org/uploads/default/original/2X/7/758cdddea0644c908017c6576e7c04223d7bbab8.png)

I want it show all mesh when I rotate camera.

I try to reset the clipping range in the `mouseMoveEvent` :

```auto
m_renderer->ResetCameraClippingRange();
m_renWin->Render();

```

But it still do not work.

What causes this phenomenon? How can I fix it?

---

<div class="post-metadata">

### Author: ![jie\_baoer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jie_baoer/32/7202_2.png) [@jie\_baoer](https://discourse.vtk.org/u/jie_baoer)
#### Post date: [January 26, 2024, 3:30am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/2 "2024-01-26T03:30:41Z")

</div>

需要获取模型最大外包边界，确保相机的位置和相机焦点大于最大外包的半径

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [January 26, 2024, 5:16am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/4 "2024-01-26T05:16:56Z")

</div>

> [@jie\_baoer](#):
>
> 需要获取模型最大外包边界，确保相机的位置和相机焦点大于最大外包的半径

您说的这种做法，跟缩放是不是一个意思？缩放的时候，调整的就是相机位置和焦点的距离。

但实际上，我缩放后，还是有一部分mesh会消失。

---

<div class="post-metadata">

### Author: ![jie\_baoer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jie_baoer/32/7202_2.png) [@jie\_baoer](https://discourse.vtk.org/u/jie_baoer)
#### Post date: [January 26, 2024, 5:42am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/5 "2024-01-26T05:42:20Z")

</div>

![image](https://discourse.vtk.org/uploads/default/original/2X/f/f4029fb0b41712b8f6eec35b6abd3d1cb1770462.png)  
好像也对，调这个函数的时候，设置一下相机范围

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [January 27, 2024, 3:56am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/6 "2024-01-27T03:56:48Z")

</div>

> [@jie\_baoer](#):
>
> 好像也对，调这个函数的时候，设置一下相机范围

这个也试过了。

在 `mouseMoveEvent` 中，调用了：

```auto
m_renderer->ResetCameraClippingRange();
m_renWin->Render();

```

但还是没用

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [January 28, 2024, 1:31pm UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/7 "2024-01-28T13:31:40Z")

</div>

Hello,

Please, use English so other non-Chinese-speakers with the same problem can:

1. contribute;
2. benefit from the solution.

thank you,

PC

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [January 29, 2024, 1:36am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/8 "2024-01-29T01:36:13Z")

</div>

I am apologized for using Chinese in communication. And English would be used in other communication.

@Paulo_Carvalho Do you have any suggestion for the invisible part?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [January 29, 2024, 8:18am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/9 "2024-01-29T08:18:59Z")

</div>

@jie_baoer @zhang-qiang-github

Moderator here.

I confirm that public topic should be discussed in english here. Use private communication if ever needed.

---

<div class="post-metadata">

### Author: ![jie\_baoer](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jie_baoer/32/7202_2.png) [@jie\_baoer](https://discourse.vtk.org/u/jie_baoer)
#### Post date: [January 30, 2024, 5:43am UTC](https://discourse.vtk.org/t/some-part-of-mesh-would-disappear-when-i-rotate-it/13149/10 "2024-01-30T05:43:53Z")

</div>

Sorry, I’ll pay attention next time
