-
Notifications
You must be signed in to change notification settings - Fork 59
Add View Cube to the screen #1134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add View Cube to the screen #1134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good. Is there any way I can request that the view cube can also be draggable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀🧊 lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make it scale based on the size of the screen? On my big monitor it's very small and hard to click, and it makes the click+drag movement really sensitive. Would it also be possible to make it not spin all the way back around when the angle wraps around?
Also, it looks like the highlight doesn't update unless you move your mouse even if you're hovering over another part of the cube.
Screen.Recording.2025-06-20.at.4.52.11.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good. I have a few suggestions though
Could the view cube axises extend all the way to the corner? Here's the diff you'll need to apply. diff --git a/fission/src/ui/components/ViewCube.tsx b/fission/src/ui/components/ViewCube.tsx
index 22e0f1460..840fa6d7c 100644
--- a/fission/src/ui/components/ViewCube.tsx
+++ b/fission/src/ui/components/ViewCube.tsx
@@ -443,7 +443,7 @@ const ViewCube: React.FC<ViewCubeProps> = ({
) => {
const group = new THREE.Group()
- const lineLength = 0.6
+ const lineLength = 2.5
const lineRadius = 0.025
const lineGeometry = new THREE.CylinderGeometry(lineRadius, lineRadius, lineLength)
@@ -488,16 +488,12 @@ const ViewCube: React.FC<ViewCubeProps> = ({
const xAxis = createAxisLine(
0xff0000,
new THREE.Vector3(-1, 0, 0),
- new THREE.Vector3(-1.3, -0.98, -0.98),
+ new THREE.Vector3(-.25, -0.98, -0.98),
"X"
)
- axisGroup.add(xAxis)
-
- const yAxis = createAxisLine(0x00ff00, new THREE.Vector3(0, 1, 0), new THREE.Vector3(0.98, 1.3, -0.98), "Y")
- axisGroup.add(yAxis)
-
- const zAxis = createAxisLine(0x0000ff, new THREE.Vector3(0, 0, 1), new THREE.Vector3(0.98, -0.98, 1.3), "Z")
- axisGroup.add(zAxis)
+ const yAxis = createAxisLine(0x00ff00, new THREE.Vector3(0, 1, 0), new THREE.Vector3(0.98, .25, -0.98), "Y")
+ const zAxis = createAxisLine(0x0000ff, new THREE.Vector3(0, 0, 1), new THREE.Vector3(0.98, -0.98, .25), "Z")
+ axisGroup.add(xAxis, yAxis, zAxis)
return axisGroup
}
@@ -734,7 +730,7 @@ const ViewCube: React.FC<ViewCubeProps> = ({
currentTarget: containerRef.current.children[0],
clientX: currentMousePos.x,
clientY: currentMousePos.y,
- preventDefault: () => {},
+ preventDefault: () => { },
} as React.MouseEvent
const element = getClickedElement(mockEvent) |
Hmm I disagree with this change; I don't think it actually looks better, and the way we currently have it matches the style that Fusion uses. LMK if you really want me to change this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting a small issue where if I move my cursor away from the view cube quickly after clicking on a face some highlightable section will say highlighted even when my mouse is no longer pressed down.
Screen.Recording.2025-06-24.at.14.34.53.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🧊
I also believe that @Dhruv-0-Arora's and @PepperLola's requested changes have been made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groovy
Added the View Cube element to the top right of the screen. The cube is clickable on its faces, edges, and corners, and will automatically reorient the camera to match the proposed perspective of the clicked element. An option is present in settings to enable or disable the cube entirely.