# volume rendering frequency is very slow

**URL:** https://discourse.vtk.org/t/volume-rendering-frequency-is-very-slow/12941
**Category:** Support
**Tags:** rendering
**Created:** [December 20, 2023, 9:09am UTC](https://discourse.vtk.org/t/volume-rendering-frequency-is-very-slow/12941 "2023-12-20T09:09:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hedwig\_Huang](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hedwig_huang/32/7745_2.png) [@Hedwig\_Huang](https://discourse.vtk.org/u/Hedwig_Huang)
#### Post date: [December 20, 2023, 9:09am UTC](https://discourse.vtk.org/t/volume-rendering-frequency-is-very-slow/12941/1 "2023-12-20T09:09:04Z")

</div>

Hi there! I am working on volume rendering for MIP/MinIP, VR and VE for MRI. Now here I edited so many codes for renderer, renderwindow, actor and mapper, etc.  
But I found that it’s quite weried that when I tried to interacte with the renderwindow, I implemented with transporting the situation of mouse(here is the plan 1):

```auto
void MyClass::RotateMove(float fx, float fy)
{
	vtkCamera* camera = classRenderer->GetActiveCamera();

	double center[2];
	center[0] = classRenderWindow->GetSize()[0] / 2.0;
	center[1] = classRenderWindow->GetSize()[1] / 2.0;

	double dx = fx - center[0];
	double dy = fy - center[1];

	double angle = vtkMath::DegreesFromRadians(atan2(dy, dx));

	vtkSmartPointer<vtkTransform> RotateTrans = vtkSmartPointer<vtkTransform>::New();
	RotateTrans->PostMultiply();
	RotateTrans->RotateWXYZ(angle, 0, 0, 1);
	camera->ApplyTransform(RotateTrans);
	classRenderWindow->Render();
}

```

But I found that I can use a class named`vtkRenderInteractor` and defined a subclass based on ‘vtkInteractorStyle’. That’s the plan 2.

Now when I run code with plan 1. I found the updating frequency is TOO SLOW, when I tried to rotate the view, the VR image started blinking, too.

I suspect that because I reset lots of parameters and update render window each time, can plan2 of ‘vtkRenderInteractor’ make rendering faster? Or it’s not about the way I rendered(like some bugs I didn’t get it)

Could you give me some advice? Thanks a lot!

---

<div class="post-metadata">

### Author: ![Hedwig\_Huang](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hedwig_huang/32/7745_2.png) [@Hedwig\_Huang](https://discourse.vtk.org/u/Hedwig_Huang)
#### Post date: [December 26, 2023, 2:43am UTC](https://discourse.vtk.org/t/volume-rendering-frequency-is-very-slow/12941/2 "2023-12-26T02:43:10Z")

</div>

Hi there, let me just simplify the problem? Will it helps?  
Like, when I run `WindowInteractor->Start()`, will it tracks back to the final point with executing `WindowInteractor->Start()`? If so, I thought it might be the same with the situation that I pass the parameters manually instead of using `vtkWindowRenderInteractorTrackBall`.

GREAT THANKS!!!

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [December 26, 2023, 3:16pm UTC](https://discourse.vtk.org/t/volume-rendering-frequency-is-very-slow/12941/3 "2023-12-26T15:16:20Z")

</div>

@Hedwig_Huang I am afraid, I don’t follow the issue you’re facing. Are you trying to animate the rotation of a volume and it is slow to render. If so, try increasing the sample distance on the volume mapper. If not, could you please provide some code snippets and images/videos of the issue?
