godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Add Ruler Mode for 3D #8839

Open CsloudX opened 11 months ago

CsloudX commented 11 months ago

Describe the project you are working on

No-Game App

Describe the problem or limitation you are having in your project

I want calc how big my terrain, and I found there was no Ruler Mode in 3D.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a Ruler Mode for 3D like 2D (and only can use in Orthogonal).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

When select Ruler Mode, rule start when I press button, end when I release button. just like 2D's ruler mode.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Now, I'm add a meshinstance and set shape to a box mesh. then adjust it xyz then compare.

Is there a reason why this should be core and not an add-on in the asset library?

Maybe can implement in add-on, but I prefer can in core. just like 2D ruler mode

KoBeWi commented 11 months ago

When select Ruler Mode, rule start when I press button, end when I release button. just like 2D's ruler mode.

How does that work with depth though? What if you click in the void?

yosoyfreeman commented 11 months ago

When select Ruler Mode, rule start when I press button, end when I release button. just like 2D's ruler mode.

How does that work with depth though? What if you click in the void?

In that case tools like Blender or proGrid would work in screen space and the end the points always assume a constant distance from the camera, here is how it works in Blender: Ruler

CsloudX commented 11 months ago

When select Ruler Mode, rule start when I press button, end when I release button. just like 2D's ruler mode.

How does that work with depth though? What if you click in the void?

I think it should only can use in Orthogonal

yosoyfreeman commented 11 months ago

it would be the same case, because you would want to use this in perspective mode to measure from one point to an empty space for example. You have to determine the void case or otherwise it would work only node to node or vertex to vertex and such.

Calinou commented 11 months ago

It makes sense to be able to measure things in 3D for reasons similar as in 2D, so you can check whether the player is able to do things like jumping across certain gaps in advance.

ryevdokimov commented 2 months ago

I was able to get a proof of concept working using a combination of:

This PR: https://github.com/godotengine/godot/pull/96740

This Addon: https://github.com/aaronfranke/godot-measuring-tape

The 'View Transform Gizmo' option in the viewport checked off.

And a quickly thrown together supplementary tool script.

Something like this could serve is a foundation to getting this proposal implemented.

https://github.com/user-attachments/assets/00aeeb00-1c89-4a26-bde8-0f6d185900b4