Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Odd behavior when drawing spline
#5
I understand what you're saying.  I think part of the answer for what I'm seeing might be the scale of the camera for my scene.  I'm using an orthographic camera targeting a 16:9 ratio (1920 x 1080 resolution) with a size of 540.  I took the route of treating one unit like a pixel in the space, so the coordinates of my objects in the scene would track to a 1920 x 1080 size.  The way I'm using Curvy in my game, I'm creating paths that span the screen bounds, so the origin point is usually off one edge a bit and the ending point is off one of the other edges... could be top to bottom, left to right, top to left, etc.

To test out the camera size, I created a new scene with a much smaller orthographic camera with a size of 5.  The results were much less pronounced, but I noticed something similar in each scene. I set the zoom so I could see the edges of the camera and a bit of space around it.  I drew a spline with three control points that look the same size on the screen, one with no object selected and another with an empty game object selected positioned at 0, 0, 0.

When comparing the splines, the one created with no object selected has a length less than half the size of the spline created in the empty object and less cache points as well (I assume they're relative to the length of the spline).  I attached a picture to show the visual for both below... here's the difference in sizes:

  • Root object spline - 3 control points, 2 segments - 9.704916 length, 20 cache points
  • Empty object spline - 3 control points, 2 segments - 23.09117 length, 46 cache points


With my original scene with a larger camera, the difference is greater:

  • Root object spline - 3 control points, 2 segments - 16.28189 length, 33 cache points
  • Empty object spline - 3 control points, 2 segments - 1341.862 length, 2623 cache points

In both scenes, the empty object spline maintains relative size to the camera where the root object spline doesn't appear to maintain it's size.  I haven't given Curvy 7 a try yet, I don't remember running into this before... I'll fire up a test project with it and see if it's the same.

I can work with the empty object method, the only thing that's a little bummer is the root object spline origin point is set as the game object transform start location but the empty object spline has the spline centered with the control points offset.  I can fix that by putting down the first control point, moving it to 0,0,0, and then draw the rest of the spline to get the same result, just a bit more work.


Attached Files Thumbnail(s)
       
Reply


Messages In This Thread
Odd behavior when drawing spline - by ricke - 11-24-2022, 05:53 AM
RE: Odd behavior when drawing spline - by _Aka_ - 11-24-2022, 09:00 AM
RE: Odd behavior when drawing spline - by ricke - 11-24-2022, 03:11 PM
RE: Odd behavior when drawing spline - by _Aka_ - 11-24-2022, 06:37 PM
RE: Odd behavior when drawing spline - by ricke - 11-25-2022, 01:54 AM
RE: Odd behavior when drawing spline - by _Aka_ - 11-25-2022, 09:14 AM
RE: Odd behavior when drawing spline - by _Aka_ - 11-25-2022, 08:56 AM
RE: Odd behavior when drawing spline - by _Aka_ - 11-25-2022, 09:13 AM
RE: Odd behavior when drawing spline - by ricke - 11-25-2022, 02:35 PM
RE: Odd behavior when drawing spline - by _Aka_ - 11-28-2022, 10:34 AM
RE: Odd behavior when drawing spline - by ricke - 05-14-2023, 04:22 AM
RE: Odd behavior when drawing spline - by _Aka_ - 05-15-2023, 12:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: