question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scaling a volume breaks rendering when the camera orbits around the volume

See original GitHub issue

Before solving #295, this issue did not exist. Now this is what happens when I scale my volume by a factor of 100. Pyvista has the very same problem.

When you click and hold the left mouse button, VTK switches to a low-fidelity rendering to go faster but it seems this part is not scaled and it’s far away close to the origin at a scale of 1 (that’s what I guess is happening). Screenshot 2021-01-17 at 11 58 42

Releasing left mouse button shows the volume correctly. Screenshot 2021-01-17 at 11 58 45

Another view of the same effect: Screenshot 2021-01-17 at 11 58 28

Screenshot 2021-01-17 at 11 58 33

Code to reproduce this:

import nrrd
import numpy as np
import vedo

volume_data, header = nrrd.read('./annotation_100.nrrd')
vol = Volume(volume_data, mapper='smart').shade(False)
vol.cmap('viridis').alpha([0,1]).addScalarBar()
vol.scale([100, 100, 100])
vol.show(axes=1)

Associated volume data can be found in #295.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nantillecommented, Jan 17, 2021

I can close this, thank you for your help!

1reaction
nantillecommented, Jan 17, 2021

Perfect if there’s no added computation and memory usage. Do you mean to say that alphaUnit should be also scaled to 100? Your guess was right, I used alphaUnit(100) and now the rendering looks like when the volume is not scaled (“spaced up”).

Screenshot 2021-01-17 at 14 09 11
Read more comments on GitHub >

github_iconTop Results From Across the Web

Volume Rendering for Developers - Scratchapixel
We will learn about volume rendering through a series of lessons: in this lesson, we will study the foundations of volume rendering and...
Read more >
Large scale volume lights - Blender Stack Exchange
An enlarged object set with volume scatter will seem denser, as the camera rays will need to traverse a larger space.
Read more >
Volumetrics in Octane: Overview and Volume Object - Behance
Scattering bounces light around within the object which creates a hazy, semi-translucent effect (think jade, skin, milk, and wax). The more ...
Read more >
Basic Lighting Exercise - Washington
Volume Lights only illuminate objects that are within the bounding volume of the light. As such, the scale and position of the light...
Read more >
Production Volume Rendering - Sony Pictures Imageworks
The course begins with a quick introduction to generating and rendering volumes. We then present some of the most fundamental parts of a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found