#MrOverload spline issue

1 messages · Page 1 of 1 (latest)

wooden pewter
#

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

wooden pewter
#

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)

livid slate
#

This results in this, more accurate but still not it

#

Still results in some wierd loops too

wooden pewter
livid slate
#

But what about index 0 then?

wooden pewter
#

first point doesn't get an arrive tangent

#

or if it's a loop, you use the segment from last to first

livid slate
#

Still loops somehow

wooden pewter
#

please show code, and show arrive tangents in blue

livid slate
#

Will do

wooden pewter
#

(arrive tangents should be debugged as a line from CP2 - tangent to CP2)

livid slate
#

I marked where it saves the variable Saved with yellow

wooden pewter
#

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)

livid slate
#

There we go

wooden pewter
#

red lines are strange, can you show your nodes again please?

livid slate
#

Sure thing, one second

wooden pewter
#

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

livid slate
#

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...

wooden pewter
#

is there draw debug arrow so that we can get the direction? make them even ticker/larger if possible

livid slate
#

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

wooden pewter
#

what did you change?

livid slate
#

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

wooden pewter
#

the plugin itself?

livid slate
#

I used part of the documentation and ignored all the worldspace etc

wooden pewter
#

can you show the new nodes please?

livid slate
#

Tangents are correct, but the tangents arent applied to the spline correctly

wooden pewter
#

why is the top one going right instead of left?

livid slate
#

its a flipped one apparently

#

I can fix that later

#

but for now its only that the tanget doesnt get applied correctly

wooden pewter
#

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

livid slate
#

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

wooden pewter
#

Cool so you removed the "+" from the Set Tangent node?

livid slate
#

Yea

livid slate
#

Now I correctly get all tangents, only applying them to the spline is another problem

wooden pewter
#

can I see screenshot and nodes?

livid slate
#

All tangents are correct

#

But the spline wants both tangents to be the same length in the editor

#

WAIT THERE IS A CHECKBOX

wooden pewter
#

?

livid slate
wooden pewter
#

Nice, so is it working? I find it weird that you use the CP1 to CP2 direction for the "arrive tangent" of CP1

livid slate
#

I am still trying to fix the cp2

#

Blue is the leave tangent and its still wrong

wooden pewter
#

Red goes from CP1 to CP2, so I think it should go to the "Leave tangent"

livid slate
#

Nono, thats correct

wooden pewter
#

And I think blue should go into the arrive tangent of the next point (as you did before?), potentially flipped

livid slate
#

The length and rotation of the leave tangent is just not correct

#

the rest is right

livid slate
#

I checked with my landscape spline, this way is the right way

wooden pewter
#

Alright, sorry I have to go, looks like you've got this

livid slate
#

Okay okay

#

Cya and thanks!

wooden pewter
#

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)

wooden pewter
livid slate
#

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