Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Corner Angle Revisited
#10
(12-29-2023, 10:26 PM)_Aka_ Wrote:
(12-28-2023, 12:10 PM)SAMYTHEBIGJUICY Wrote: The problem arises when you have nested splines and their relative positions in the game world versus the control points underneath them. What I have discovered is that it is important where you place your spline's parent object, I can either position it close to where I expect the control points to be or I can use the automatic placing of 0,0,0.

This is easiest illustrated with an example.
See below I have two splines with almost identical first control point positions in the game world.

Currently, we are on curvy spline 16, positioned close to the player's world position, which gives us tangent differences as expected (the blue and red lines coming out of my player)


If I switch to spline 17 - which has a world position of 0,0,0, the tangents show the erroneous result, because the children have very high values for their local coordinates, which means the relative values of the control points have a max tolerance for accurate calculations. Or this is a floating point error issue as the values get larger. 

Hi

I tried to reproduce this with two splines having exactly the same shape (superposing), the only difference being the coordinates of the spline game object. I saw no difference. I attached the test data for you to try on your side. This makes me think that the coordinate of the spline GO is not issue, at least not in such value ranges.

The screenshots you attached to your post show two splines that are not superposed. I get that this is to make the screenshots easiest to understand, but I am curious in the result of tests where the two splines are exactly superposing.

If you open the attached scene, you will find a GO named TangentTester. You can see that whatever the spline you assign as an input for the test the tangent is the same.

Let me know if you manage to reproduce the issue with superposing splines.

Have a nice weekend, and happy new year.

Thanks so much for the example it was tremendously helpful - based on your code I cleaned up:

Code:
Vector3 mvector = Spline.GetNearestPoint(mRigidBody.transform.position, Space.World);
Vector3 p;
BikeTF = Spline.GetNearestPointTF(mvector,
    out p
);

to:
             
Code:
  Vector3 p;

float BikeTF = Spline.GetNearestPointTF(transform.position, out p, Space.World);

and it fixed everything! Thanks! Happy new year!!! ^0^
Reply


Messages In This Thread
Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-21-2023, 04:54 AM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-21-2023, 12:21 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-22-2023, 05:40 PM
RE: Corner Angle Revisited - by _Aka_ - 12-23-2023, 01:39 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-27-2023, 09:59 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-28-2023, 12:10 PM
RE: Corner Angle Revisited - by _Aka_ - 12-29-2023, 10:26 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 01-01-2024, 04:01 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-28-2023, 10:59 PM
RE: Corner Angle Revisited - by _Aka_ - 12-29-2023, 08:22 PM
RE: Corner Angle Revisited - by _Aka_ - 01-02-2024, 10:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I find the point on the spline after applying with offset angle+radius? Chanon 1 5 10-01-2022, 11:50 AM
Last Post: _Aka_
  Make hard angle cll3m 5 1,402 07-01-2021, 04:06 PM
Last Post: _Aka_
Wink How to generate right angle road oscar.ken 6 4,687 04-30-2020, 05:38 PM
Last Post: ThomasTheTank
  Twisted mesh at corner on linear path JLeonard 0 2,176 02-24-2017, 04:42 PM
Last Post: JLeonard

Forum Jump: