x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to get the SURFACE normal from line trace hit location?

Hey guys.

So I'm trying to get the vector perpendicular to the surface of any object hit by a line trace. I don't want the impact normal, instead, I always want the result to be a right angle from the surface of the wall. As in the attached pic, how can I modify the line trace hit result so that I'm generating the vector of the white line?

As always, thank you!!!alt text

Product Version: Not Selected
Tags:
surfacenormal.gif (228.4 kB)
more ▼

asked Mar 01 '15 at 10:10 PM in Blueprint Scripting

avatar image

SVR33
160 14 17 30

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Sorry if I misinterpret the question.

To get a vector perpendicular to the surface (the normal) of a hit object, you just have to add the impact normal to the impact point. As far as I understand the reason why is because the impact normal is a direction vector, so it could describe any number of parallel surfaces.

Below I make a little blueprint showing how using the hit result of an initial trace, a second trace can be done parallel to the normal at the impact position.

alt text

The result: alt text

Hope this helps.

tracetest.png (219.7 kB)
bp_trace.png (74.1 kB)
more ▼

answered Mar 13 '15 at 07:34 AM

avatar image

Sandstrike
106 2 7 14

avatar image SVR33 Mar 13 '15 at 02:05 PM

Hey Sandstrike,

Thanks for the solution. I should have updated this a couple weeks ago when I finally sorted out the problem but this is helpful for others who might have the same confusion.

You are 100% correct. My error was ultimately related to two things... a misunderstanding of what the impact normal actually is and a rotator that wasn't working as I intended. I thought the impact normal vector result depended on the angle of the line trace it came from but, as you say, it doesn't. It will always be orthogonal to the surface it hits, no matter how it hits it.

Thanks! SVR33

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question