You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Curve3D's sample_baked_with_rotation returns strange rotation values near the first point and the last point of a curve.
Steps to reproduce
Construct a Curve3D with at least 3 points.
Give the middle point a non-zero in and out vector.
Sample the curve with rotation using sample_baked_with_rotation at regular intervals to see that the rotation value veers off in a weird direction as the first and the final points are approached.
The attached MRP is a 3D scene with a Camera3D, a Path3D, and a MeshInstance3D. The Path3D has a script attached to it that draws basis provided by sample_baked_with_rotation along the entire length of the Path3D. This is not a tool script, so the project must be ran to see the basis drawn. The Path3D script has some exported parameters to help the user investigate this issue: count is the number of samples of the curve taken and drawn in the 3D viewport as basis gizmos, size is the length of the vector that represents a basis in a gizmo, and cubic changes whether sample_baked_with_rotation is called with cubic = true or cubic = false (the issue behavior does not appear to change based on this).
Examples from MRP
The following is the 3D scene with only 50 samples taken so the basis gizmo can be more easily seen.
As the number of samples increases so does the number of problematic rotation samples near the first and last points.
When the middle point has zero in and out vectors, there are only straight lines and this issue does not occur.
The text was updated successfully, but these errors were encountered:
sample_baked_with_rotation unit tests are only ever performed with a straight line. My 3rd MRP example implies this issue cannot be caught by the existing tests.
Tested versions
Reproducible in
System information
Godot v4.3.stable - Ubuntu 22.04.5 LTS 22.04 - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3080 (nvidia; 550.120) - Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz (6 Threads)
Issue description
Curve3D's
sample_baked_with_rotation
returns strange rotation values near the first point and the last point of a curve.Steps to reproduce
sample_baked_with_rotation
at regular intervals to see that the rotation value veers off in a weird direction as the first and the final points are approached.Minimal reproduction project (MRP)
mrp_curve3d-edge-rotation.zip
The attached MRP is a 3D scene with a Camera3D, a Path3D, and a MeshInstance3D. The Path3D has a script attached to it that draws basis provided by
sample_baked_with_rotation
along the entire length of the Path3D. This is not a tool script, so the project must be ran to see the basis drawn. The Path3D script has some exported parameters to help the user investigate this issue:count
is the number of samples of the curve taken and drawn in the 3D viewport as basis gizmos,size
is the length of the vector that represents a basis in a gizmo, andcubic
changes whethersample_baked_with_rotation
is called withcubic = true
orcubic = false
(the issue behavior does not appear to change based on this).Examples from MRP
The following is the 3D scene with only 50 samples taken so the basis gizmo can be more easily seen.
As the number of samples increases so does the number of problematic rotation samples near the first and last points.
When the middle point has zero in and out vectors, there are only straight lines and this issue does not occur.
The text was updated successfully, but these errors were encountered: