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.

Rotate Volume issue

See original GitHub issue

Hi, I have a volume render, and I would like to rotate it in Desktop/VR, but I have issue in both of them, When I set myVolume.rotateX(interValue) volume is rotate but some of data is missing like this image:

bc78f543-e4f7-4ec6-8f57-599d89a16f83

the volume result in image after I rotateX 33 degree, I think this issue related to 858.

Any way, is rotate action a truth way to rotate volume? Since if I use camera view up nested of rotate, its work nice on desktop, but in VR not working truth since VR has left and right projection/view matrix and maybe I need to build a new matrix for that, Im not sure…

Additional Note: VTKJS Version: 11.1.0 Browser: Google Chrome 77.0 OS: Windows 10 64 bit.

Thanks for help.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
aneeshikmatcommented, Sep 18, 2019

Hi @jourdain

After trace rotate code, and take look at direction for input data, we can change the way for rotate data, we can build Orthogonal matrix from Rotation matrix and pass it to setDirection(), this way will make rotate work perfect with direction, I test it and implement it in my code, and all is good…

For example for my work (sample of code):

  publicAPI.customRotate = (degreeValue) => {
    var outPutMatrix = [[0,0,0],[0,0,0],[0,0,0]], outPutMatrixFinal = [[0,0,0],[0,0,0],[0,0,0]];
    var rotateX   = [[1, 0, 0], [0, Math.cos(degreeValue), -Math.sin(degreeValue)], [0, Math.sin(degreeValue), Math.cos(degreeValue)]];
    var rotateY   = [[Math.cos(degreeValue), 0, Math.sin(degreeValue)], [0, 1, 0], [-Math.sin(degreeValue), 0, Math.cos(degreeValue)]];
    var rotateZ   = [[Math.cos(degreeValue), -Math.sin(degreeValue), 0], [Math.sin(degreeValue), Math.cos(degreeValue), 0], [0, 0, 1]];
    vtkMath.multiplyMatrix(rotateX, rotateY, 3, 3, 3, 3, outPutMatrix);
    vtkMath.multiplyMatrix(outPutMatrix, rotateZ, 3, 3, 3, 3, outPutMatrixFinal);

    // return rotateX, or rotateY or rotateZ for single plan or outPutMatrixFinal for all plans;
  }

After I implement this way, Volume is rotate in Desktop/Vr without any issue, so that I share it, and no visual artifacts seen, I wish its be helpful too like your suggestions before.

Reference

1reaction
jourdaincommented, Sep 16, 2019

You can also adjust the VR camera as well. But since you want to rotate the volume at the representation level, that’s fine.

BTW, based on what I can understand from your explanations, the vtkImageData does exactly what you are looking for. But it is true, that you should also be able to define transform on Props so I’ll stop suggesting workarounds that will let you move forward.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Calculus I - Volumes of Solids of Revolution / Method of Rings
For purposes of this discussion let's rotate the curve about the x x -axis, although it could be any vertical or horizontal axis....
Read more >
Calculus Volume of Rotation Problem - YouTube
In this video, we find the area of a trapezoid geometrically and by integrating. Then we find a volume of rotation by rotating...
Read more >
Math Tutor: 4 Easy Steps to Volume Rotation Integration - CC
Here's a step by step guide to volume rotation integration programs. Plus more math goodies, from our math tutor in the MIT/Harvard neighborhood....
Read more >
Audio output changes with orientation - Apple Community
On my iPhone 7 while playing videos the volume will change depending on how the phone is rotated. In portrait orientation I will...
Read more >
Volumes of solids of revolution - Mathcentre
After reading this text, and/or viewing the video tutorial on this topic, ... The curve would then map out the surface 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