Error on changing plane position of slice
See original GitHub issueI am working on a feature that allows users to rotate the localizer helpers of quadview like this video. It is working fine, but after rotation of any 2D renderers, the translation of other renderers is not working fine. The slice of these other renderers is moving, but it should remain the same slice. Watch the video to understand what I am trying to explain. In the video, first I am rotating localizer helper on r2 renderer, and it worked fine. After I am translating the localizer helpers on r2, and observe the slice is not moving, it remains still, like I expected, but when I translate the localizer helper on r1, renderer r1’s slice is moving, but it should not be.
How I am rotating (angle is in radian)
axis = renderer.stackHelper.slice.planeDirection
planeDirection = renderer.stackHelper.slice.planeDirection.clone()
planeDirection.applyAxisAngle(axis,angle)
renderer.stackHelper.slice.planeDirection = planeDirection
renderer.stackHelper.border.helpersSlice = renderer.stackHelper.slice
How I am translating
renderer.stackHelper.slice.planePosition = point
renderer.stackHelper.border.helpersSlice = renderer.stackHelper.slice
I guess there is some error on rounding (Math.ceil or Math.floor) the point that I am setting the planePosition, because it is not coplanar with planePosition and I don’t have a clue how to solve this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Oh I see now thanks -
How do you get the new plane position? By raycasting the cursor position?
renderer.stackHelper.slice.planePosition = point
It does not work when I do the raycasting against
renderer.stackHelper.slice
, it just works when I do it againstrenderer.stackHelper.slice.children
. But the error remains 😦I checked the localizer helper and I am updating like this Rotating
Translating