# Display strange lines(dashed) when I zoom in

**URL:** <https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176>\
**Category:** Development\
**Created:** [December 10, 2025, 3:00am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176 "2025-12-10T03:00:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)\
**Post date:** [December 10, 2025, 3:00am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/1 "2025-12-10T03:00:16Z")

</div>

Hello,

I have met one strange problem, I have the rendererd image in display area, when I zoom in with mouse, it gradually display some strange lines, more zoomed-in(closer), more clearer the dashed lines. But I have not set anything for such strange lines. I don’t know where these lines came from.

I attached some screenshots in this thread, please somebody help me diagnose from these images.

If you need the implementation code, I can add some c++ codes later.

the first image - very far.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/0/099fe7e1c99288b283eb6f5a4b81d31fb0520875.jpeg)

the second image - zoomed in a little bit. We can see some waves(or lines) now.

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

the third image - zoomed in again.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/4/499d7dd854ab5560ffff729c752ae88863488f62.jpeg)

the fourth image - zoomed in more.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/0/01e441fd15be9878e6dbd5fe5662e2450bba467b.jpeg)

the fifth image - zoomed in to be very close.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/5/511a15c2a326b9671172d7ebdd8bc5b04c040500.jpeg)

I don’t know why this happens. Can you analyze possible reasons based on these different images?

Thanks a lot.

---

<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:** [December 10, 2025, 3:36pm UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/2 "2025-12-10T15:36:18Z")

</div>

Can you share you data ?

---

<div class="post-metadata">

**Author:** ![whereismymoney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/whereismymoney/32/6859_2.png) [@whereismymoney](https://discourse.vtk.org/u/whereismymoney)\
**Post date:** [December 12, 2025, 3:33am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/3 "2025-12-12T03:33:37Z")

</div>

Are you using Parallel Projection or Perspective View? If Parallel Projection, there is a lot of existing discussion and workarounds, etc.

---

<div class="post-metadata">

**Author:** ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)\
**Post date:** [December 15, 2025, 1:41am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/4 "2025-12-15T01:41:06Z")

</div>

How to share with you? Upload under this thread ?

---

<div class="post-metadata">

**Author:** ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)\
**Post date:** [December 15, 2025, 1:55am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/5 "2025-12-15T01:55:30Z")

</div>

[vtk\_write\_multiblock.7z](https://discourse.vtk.org/uploads/short-url/s1M6gtPa9iE6QNi46TtESssAwJ4.7z) (1.1 MB) @mwestphal

---

<div class="post-metadata">

**Author:** ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)\
**Post date:** [December 15, 2025, 1:56am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/6 "2025-12-15T01:56:16Z")

</div>

Yes, we are using parallel projection.

---

<div class="post-metadata">

**Author:** ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)\
**Post date:** [December 15, 2025, 2:07am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/7 "2025-12-15T02:07:56Z")

</div>

> [@Problem with Parallel Projection after upgrading to VTK 9.1.0](https://discourse.vtk.org/t/problem-with-parallel-projection-after-upgrading-to-vtk-9-1-0/11169/21):
>
> Thanks for sharing VTK sample! I can reprod the issue. I believe we can fix it but I may not be able to get to it right now, so I’m documenting my findings to help me later or someone who can dig into it now. I can also reproduce the issue in paraview. There is definitely something off when the camera position gets very close to the geometry in orthographic projection mode. The issue did not appear when I checked the “Disable Lighting” box, which led me to suspect the shader’s normal computatio…

This is what I searched on parallel projection view issue, seems similar with what I met now.

---

<div class="post-metadata">

**Author:** ![whereismymoney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/whereismymoney/32/6859_2.png) [@whereismymoney](https://discourse.vtk.org/u/whereismymoney)\
**Post date:** [December 15, 2025, 11:06pm UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/8 "2025-12-15T23:06:26Z")

</div>

If you switch off parallel projection, what does it look like?

---

<div class="post-metadata">

**Author:** ![cmodel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@cmodel](https://discourse.vtk.org/u/cmodel)\
**Post date:** [December 16, 2025, 3:28am UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/9 "2025-12-16T03:28:29Z")

</div>

I used like this:

```cpp
camera->SetParallelProjection(false)

```

Looks like those lines are disappeared.

screenshot:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/1/150cb6f02b845b0d519cf6c7b2e345885995af14.jpeg)

But If I still want to use parallel on, how need I fix the issue?

Use the shader replacement code as the workaround ?

Thanks.

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [December 16, 2025, 3:22pm UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/10 "2025-12-16T15:22:50Z")

</div>

This effect seems strange to me, because there isn’t anything inherently different about the precision of parallel vs. perspective transformations. It makes me wonder if the problem is actually VTK’s interaction code rather than the shader code. Let me briefly explain:

When VTK implements perspective zoom by bringing the camera closer to the focal point, the geometry remains close to the “sweet spot” of the depth range, i.e. close to the camera.

But, if I’m not mistaken, the parallel projection zoom is implemented by simply narrowing the field of view in X and Y, but Z (i.e. the positions of the near and far clipping planes) is left unchanged. So when you zoom in really tight, the orthographic “box” for the projection becomes very long in the depth direction compared to the X, Y directions. This is not what we want. Ideally, when we zoom we want the near and far clipping planes to come closer together as the FOV becomes narrower. This should keep us from losing precision in the transformation to view coordinates.

There is a caveat, though: if we bring the near & far clipping planes closer to the focal point, then any geometry that isn’t close to the focal point (in the depth direction) will be clipped away.

---

<div class="post-metadata">

**Author:** ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)\
**Post date:** [December 16, 2025, 3:45pm UTC](https://discourse.vtk.org/t/display-strange-lines-dashed-when-i-zoom-in/16176/11 "2025-12-16T15:45:18Z")

</div>

> [@cmodel](#):
>
> don’t know

I believe this is a known problem with data that does not supply surface normals. The normals are estimated in the shader and as you zoom in the normals estimated near the boundaries of polygons are off.

A workaround is to compute cell normals on your dataset. If they are available, then the shader will use them instead of coming up with a bad normal estimation.
