Raised This Month: $12 Target: $400
 3% 

How do I find the normal vector of the brush face used to make a displacement?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sappykun
Member
Join Date: Nov 2019
Old 05-23-2021 , 02:50   How do I find the normal vector of the brush face used to make a displacement?
Reply With Quote #1

I want to find the orientation of a displacement based on the angle of the brush face that was used to create it. Without decompiling a map, is there a way to find that?

What I'm trying to accomplish is determine how a player's spray will appear on a given surface.
I've observed that a spray:
- points North on a brush with a vertical angle below 45 degrees and above 135 degrees (both inclusive)
- points upwards on a brush with a vertical angle between 45 and 135 degrees (both exclusive)
I can easily determine the angle of a given surface by using TR_GetPlaneNormal, so that's not an issue.

What I've found is that sprays on displacements seem to use the same rules as brushes, except their orientation is dependent on the original surface used to create it, regardless of what angle the displacement is currently at.

I'll replace these sketches with an example in Hammer soon, but for now:

Spoiler


In this example, I make a half-pipe out of a flat brush, making the west and east sides vertical. The sprays on the displacement point north, even if they're sprayed on the vertical parts of the pipe. This makes them point sideways when viewed from the center of the pipe.

Spoiler


In this example, I make the north and south sides vertical. The sprays keep pointing north, but now the left spray will be upside down and the right spray will be pointing up when viewed from the center.

I've tried using TR_GetDisplacementFlags which can determine if I'm looking at a displacement or not, but it doesn't give me information about its orientation.

Last edited by Sappykun; 05-23-2021 at 02:50.
Sappykun is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode