Find Corner?

Hi, so i made another post but i feel like i was missing some information.

How would i go about finding “P” location from two vector where P is the corner im trying to find in 3D World space
The rotation of “A” is forward, thats where im trying to find the corner based on where “B” is

Image 1 is where “A” has 0, 0, 0 in rotaiton and Image 2 is where “A” has a rotation of “45”.
Let me know if you need any other information, i have also included an image for visual.

2 Likes

I figured out how to do it with an existing node:

I used random point in space, but you use your own. Explanation:

1. The first two inputs are vector start and end. In your case you get the origin as start, and origin + forward vector multiplied by a generous float, because it must go far to actually intersect the plain.

2. This is a bit trickier since we don’t use the second vector, but we construct a plane from it. Plane origin may be either start or end of the second vector, and the subtraction order doesn’t matter; what matters is the vector you use for Cross Product. If it’s top-down view, it should be (0,0,1); if it’s side view, like in my case, it’s (0,1,0). So it depends.

3. So basically it constructs a virtual plane and calculates where your vector intersects it. Profit!

2 Likes

Hi thanks for the feedback, appricate it!
Another method, wouldn’t it be easier and more performance friendly by using colliders? with a trigger event on overlap etc?

There should be another easier approch, must be right?
Let me know if anyone has another method?

1 Like

I don’t think using colliders can be more performance-friendly than simple vector math.

1 Like

This is the way according to Pythagoras:

• Red corner = Point0
• Blue corner = Point1

4 Likes

Wow! looks exactly like what i need, any chance that you can uncollapse all of the nodes? i seem to get a bit different result tho?

I can’t… Cool thing about Math Expression node is that all you have to do is type and it will create / connect the nodes by itself:

… but, here you go:

2 Likes

Thank you! it worked

2 Likes

@pezzott1 Any chance that you might have a look at my other post Smooth Corner?

Thank you

1 Like

I don’t know if you know blueprintUE.com, you can copy and paste the nodes there and it should keep all the nodes info and it saves you a lot of time if compared to taking screenshots

1 Like

Hopefully what I share is useful and helps someone learn something new to expand upon, not copy / paste.

1 Like

Absolutely, I find it really useful! It’s not about copy-paste, it’s just better in terms of readability.

I really care about learning and not just copying stuff, I don’t think that having to rewrite each step watching a small picture improves my understanding, personally I like to study and rearrange blueprint nodes directly from the editor (especially when I don’t have a second monitor available, in fact i bookmarked your post to better look at it later)

2 Likes

I’ve been watching it since it was created, even have it marked to receive notifications. Truth is it’s a lot of work to create the round corner logic just for the sake of it lol.

At least how I would approach it, you’ll need:

1. Trigonometry to build base square + vector math for the offsets:

2. For rounding it will depend:
2.1. Bezier Curve math if corners will not be 90 degrees:

2.2. Complex numbers if it will always have 90 degree corners:

2 Likes