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

Bring back Frenet Frame as an Option for Curve3D Posturing #7462

Open
xiongyaohua opened this issue Aug 7, 2023 · 0 comments · May be fixed by godotengine/godot#80753
Open

Bring back Frenet Frame as an Option for Curve3D Posturing #7462

xiongyaohua opened this issue Aug 7, 2023 · 0 comments · May be fixed by godotengine/godot#80753

Comments

@xiongyaohua
Copy link

xiongyaohua commented Aug 7, 2023

Describe the project you are working on

Some road traffic game, in which roads are described by Curve3D.

Describe the problem or limitation you are having in your project

There are two common ways to evaluate posturing on a curve in 3D space:

  • Frenet Frame(or TNB frame),
  • Parallel Transport Frame.

They have different quirks (see this blog for detail), but Parallel Transport Frame becomes the favored one in recent years because it is easier to achieve smooth rotation before tweaking.

Godot was using the Frenet Frame before, then in an revamp effort I changed it into Parallel Transport Frame in this commit. However in my current work on the tilt handle for Path3D(see this PR), I realize Parallel Transport Frame has a problem if you want to tweak it with tilt. Which is that it is not globally stable, namely if a control point is moved, it will impact the posture frames of not only the neighboring points, but all following points(and all previous points if the curve is a loop).

This lack of global stability makes tweaking curve shape and tilt together very difficult. You have perfect up vectors by tweaking tilts, then you move one control point, every up vectors are changed...

Screen.Recording.2023-08-07.at.12.14.09.mov

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

The Frenet Frame, despite all its problems, is globally stable. The impact of moving a control point is limited between two neighboring control points. This makes it much easier to tweak tilts.

So I propose to bring back the Frenet Frame behind an option on Path3D. It is an option called Base Posture Frame, and it has two options:

  • PARALLEL TRANSPORT FRAME(Default)
  • FRENET(TNB) FRAME

User may choose depending on what they want

  • Better default behavior out of the box
  • Total control in tweaking

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

I will scrape the old Frenet code, refurbish it, put it back. Shouldn't be too much work.

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

No, it is performance sensitive, should be in C++.

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

No, Curve3D is core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants