#MrOverload spline issue
1 messages · Page 1 of 1 (latest)
The vector tangent itself is only the bottom part: (Connection 2 cp - connection 1 cp).GetNormal * Connection 1 tangent length.
But you debugging node is ok
How do you mean that?
In the Set Tangent node, you should use the result of the "+" node, but you should only use the result of the bottom part (Connection 2 cp - connection 1 cp).Normalize * (Connection 1 tangent length)
You used Connection 1 CP + (Connection 2 cp - connection 1 cp).Normalize * (Connection 1 tangent length)
This results in this, more accurate but still not it
Still results in some wierd loops too
I think you should set the leave and arrive tangents separately. This same tangent should go into the arrive tangent of the second spline point
But what about index 0 then?
first point doesn't get an arrive tangent
or if it's a loop, you use the segment from last to first
Still loops somehow
please show code, and show arrive tangents in blue
Will do
(arrive tangents should be debugged as a line from CP2 - tangent to CP2)
I think the debug for the arrive tangent is wrong, it should be from CP2 - saved, to CP2
Oh and saved should use the Connection 2 tangent length
(so it's not exactly the same tangent, only the same tangent direction)
There we go
red lines are strange, can you show your nodes again please?
do you need to do this for many splines? if only one it would be quicker to redraw it 😄
there's something wrong with the red lines, they should just go from one control point to the next
Here’s the game plan: I want to create a road network that follows my landscape spline. I have already developed a complete traffic system, which operates based on splines and intersections. To ensure that traffic the traffic is accurate, it’s really necessary that the splines are accurate
I fear I might need to wait fro the developer to help me out, which can take a week or two...
is there draw debug arrow so that we can get the direction? make them even ticker/larger if possible
Yea, I will be gone for a quick 15min break and then I'll be back. I gotta quickly feed the cat
OH I GOT 1 TANGENT RIGHT
Its just not applied to the spline correcly
Okay so the tangent is correct, but the spline messes it up
what did you change?
Rewrote it to use the plugin itself and divide by 2
But now the problem is it doesnt get applied to the landscape correctly
*spline
the plugin itself?
I used part of the documentation and ignored all the worldspace etc
can you show the new nodes please?
why is the top one going right instead of left?
its a flipped one apparently
I can fix that later
but for now its only that the tanget doesnt get applied correctly
you're again using the output of the "+" to go into the tangent, but you should only use the part that is added to CP1
Oh I got the tangent right
For debugging its * 0.5 but the tanget should be scaled to * -1,0
god why does unreal do that lol
okay time to do arrive and exit tangent too now
Cool so you removed the "+" from the Set Tangent node?
Yea
Now I correctly get all tangents, only applying them to the spline is another problem
can I see screenshot and nodes?
All tangents are correct
But the spline wants both tangents to be the same length in the editor
WAIT THERE IS A CHECKBOX
?
Check #ue5-general
Nice, so is it working? I find it weird that you use the CP1 to CP2 direction for the "arrive tangent" of CP1
Red goes from CP1 to CP2, so I think it should go to the "Leave tangent"
Nono, thats correct
And I think blue should go into the arrive tangent of the next point (as you did before?), potentially flipped
Tried that, it has no real difference
I checked with my landscape spline, this way is the right way
Alright, sorry I have to go, looks like you've got this
Hey, I saw your new message, and I still think you have an off-by-one problem, creating this kind of mismatch. The green arrow is a tangent of control point 2, but you're setting it on control point 1. One way to debug this is to add a int param (or two ints for a range), and show the debug lines only for this index (or for any index in the range)
Hey, just want to make sure you saw this last message
Ah thanks, didnt see. I solves it a few hours ago
the leave tangent is calculated by getting getting the forward vector of the previous splinepoint and multiplying that with the tangent length of the current splinepoint