Skip to content
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

Curve 3D up vectors are pre-calculated and hard to control #47445

Closed
TheUltimateAbsol opened this issue Mar 28, 2021 · 6 comments
Closed

Curve 3D up vectors are pre-calculated and hard to control #47445

TheUltimateAbsol opened this issue Mar 28, 2021 · 6 comments

Comments

@TheUltimateAbsol
Copy link

TheUltimateAbsol commented Mar 28, 2021

Related Issues: #27137

Godot version: 3.2.3

OS/device including version: Windows 10, GLES3, Intel Integrated Graphics

Issue description:

What I expect: I can edit a Curve 3d and manually adjust how it twists using the "tilt" property of the curve points.
What I get: Not only am I unable to set the "tilt" property through an editor gizmo, but the editor already is tilting the path when calculating up vectors.
Checking the up_vector_enabled property of Curve3D is required for using up vectors (such as setting the PathFollower3D rotation mode to ORIENTED, which as per this is the ONLY working rotation mode right now...). However, When checking the up_vector_enabled property on the Curve3D, it will automatically create a set of up vectors for the curve using an algorithm from line 1238-1278 of curve.cpp in the source code.

This hidden behind-the-scenes nature of precomputing the up-vectors makes it impossible for a user to accurately build a
twisting curve to his or her specifications.
If a user wanted to change the way the path twists, they would be adding in tilt values to attempt to correct for the algorithm (which can get messy very fast, especially considering how tilts are not visible in editor).

Steps to reproduce:
Make a Path 3D
Make sure up_vector_enabled is enabled
Add some points with bezier curves
Add a Pathfollower 3D in Oriented Rotation mode and observe its wacky rotations. Adding a camera to the Pathfollower will help highlight this.
Scream in pain as the path twists for you and you can't do anything about it.

Minimal reproduction project:

Here's a generic example of how it works. Notice that the algorithm leaves me slanted in the end without correcting it.
The main issue is that tilt was made without my input and I would have to add "tilt" values to correct it - not to form it.
curve2
test_rail.zip

Edit: It looks like this is "intended" behavior as per the docs, but with tilts and up_vectors being invisible in editor, it's difficult to control.

@TheUltimateAbsol TheUltimateAbsol changed the title Curve 3D up vectors are pre-calculated and uncontrollable Curve 3D up vectors are pre-calculated and hard to control Mar 28, 2021
@eon-s
Copy link
Contributor

eon-s commented Sep 13, 2021

I have experienced this recently on 3.4b4, and even forcing tilt to zero does not make any difference (plus, path visual controls and curve resource structure do not help in anything to solve it).

@jitspoe
Copy link
Contributor

jitspoe commented Mar 1, 2023

I was trying to figure out if I was missing some thing with curves and defining up vectors and found this. Being able to specify the up vector at each control point would be great! My hacky workaround is to add another curve, then get the closest point on that other curve from the point on the main curve and use that as my up vector.

@Calinou
Copy link
Member

Calinou commented Mar 1, 2023

@jitspoe Can you test #68873 locally and see if it works well for your use cases?

@jitspoe
Copy link
Contributor

jitspoe commented Mar 4, 2023

Tested locally and it seems to do what I need!

@fire
Copy link
Member

fire commented Jul 21, 2024

I believe #80329 has fixed this?

@Calinou
Copy link
Member

Calinou commented Jul 21, 2024

Closing per @fire's comment.

@Calinou Calinou closed this as completed Jul 21, 2024
@Calinou Calinou added this to the 4.2 milestone Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants