-
-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Make rotation gizmo white outline a 4th handle that rotates around the camera's view-axis #108608
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
base: master
Are you sure you want to change the base?
Make rotation gizmo white outline a 4th handle that rotates around the camera's view-axis #108608
Conversation
d76bc2e
to
2bf683f
Compare
db6f08a
to
9e6438c
Compare
9e6438c
to
c6bae67
Compare
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.
Tested locally, it works as expected.
Code looks good to me.
surftool->commit(axis_gizmo[i]); | ||
// Lines to visualize transforms locked to an axis/plane | ||
{ | ||
Ref<SurfaceTool> surftool = memnew(SurfaceTool); |
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.
Ref<SurfaceTool> surftool = memnew(SurfaceTool); | |
Ref<SurfaceTool> surftool; | |
surftool.instantiate(); |
Preferred syntax
surftool->add_vertex(points[2]); | ||
surftool->add_vertex(points[3]); | ||
|
||
Ref<StandardMaterial3D> plane_mat = memnew(StandardMaterial3D); |
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.
Ref<StandardMaterial3D> plane_mat = memnew(StandardMaterial3D); | |
Ref<StandardMaterial3D> plane_mat; | |
plane_mat.instantiate(); |
vec[i] = 1; | ||
// Plane Scale | ||
{ | ||
Ref<SurfaceTool> surftool = memnew(SurfaceTool); |
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.
Ref<SurfaceTool> surftool = memnew(SurfaceTool); | |
Ref<SurfaceTool> surftool; | |
surftool.instantiate(); |
if (i < 3) { | ||
// Scale | ||
{ | ||
Ref<SurfaceTool> surftool = memnew(SurfaceTool); |
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.
Ref<SurfaceTool> surftool = memnew(SurfaceTool); | |
Ref<SurfaceTool> surftool; | |
surftool.instantiate(); |
{ | ||
Ref<SurfaceTool> surftool = memnew(SurfaceTool); | ||
surftool->begin(Mesh::PRIMITIVE_TRIANGLES); | ||
Ref<ShaderMaterial> rotate_mat = memnew(ShaderMaterial); |
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.
Ref<ShaderMaterial> rotate_mat = memnew(ShaderMaterial); | |
Ref<ShaderMaterial> rotate_mat; | |
rotate_mat.instantiate(); |
surftool->add_vertex(points[2]); | ||
surftool->add_vertex(points[3]); | ||
|
||
Ref<StandardMaterial3D> plane_mat = memnew(StandardMaterial3D); |
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.
Ref<StandardMaterial3D> plane_mat = memnew(StandardMaterial3D); | |
Ref<StandardMaterial3D> plane_mat; | |
plane_mat.instantiate(); |
surftool->commit(move_gizmo[i]); | ||
// Plane Translation | ||
{ | ||
Ref<SurfaceTool> surftool = memnew(SurfaceTool); |
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.
Ref<SurfaceTool> surftool = memnew(SurfaceTool); | |
Ref<SurfaceTool> surftool; | |
surftool.instantiate(); |
if (i < 3) { | ||
//translate | ||
{ | ||
Ref<SurfaceTool> surftool = memnew(SurfaceTool); |
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.
Ref<SurfaceTool> surftool = memnew(SurfaceTool); | |
Ref<SurfaceTool> surftool; | |
surftool.instantiate(); |
|
||
if (i < 3) { | ||
// Only create standard materials for X, Y, Z axes (move/scale gizmos) | ||
mat = memnew(StandardMaterial3D); |
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.
mat = memnew(StandardMaterial3D); | |
mat.instantiate(); |
…e camera's view-axis
c6bae67
to
cc1389a
Compare
Requires and includes: #108576
Common functionality in other 3D software that increases the usability of the rotation gizmo.
Made the white outline slightly larger so it's more distinct and easier to select.
Everything else should work as expected or at least how #108576 works.
2025-07-15.15-36-41.mp4