What is the best way to get accurate texture allignment?

Shogun

L6: Sharp Member
Jan 31, 2014
260
220
Hi guys. A problem that's been bugging me ever since I picked up Hammer has been alligning textures on slanted surfaces, wether it be a support beam or in this case, metal trim on a ramp. I know how to rotate textures, and I know it's possible to put decimals into the rotation value, but is there a way to get a 100% accurate alligned texture?

Is there some sort of mathematical formula?

Is there an "auto allign" button I'm missing?

Or am I doing things completely wrong?

Here are some images to illustrate what I'm talking about if you haven't picked up by now:

TriSXgg.jpg

Texture is unrotated and unalligned with the brush

iGuAmS5.jpg

I rotated the texture to the best of my ability (without using decimals) to fit the brush, but it's still really noticeably off. How the heck can I make this perfectly alligned?

Thanks in advance to anyone who knows the answer to this problem. I'm sure it's a very easy fix, but I haven't found an answer on the Dev wiki or here, so I thought I'd ask.
 

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
About to blow your mind.

1. Select the face above that one that is lined up properly (the top of that brush.)

2. Alt-Right click the face you want aligned with it (the angled face you are trying to get right.)

3. Praise be the gods of Hammer.
 

Egan

aa
Feb 14, 2010
1,375
1,720
With one of the sides selected that is aligned already you can hold ALT and Right Click another face of the brush (or any brush actually) to apply the currently selected texture to that face aligned to your currently selected face.

Selecting an aligned face (rotated texture by 90, buffed texture scale by 2x):

ZsWeta5.png


After holding ALT and Right Clicking the next side:

5EyKRnA.png


You can find more hammer shortcut key combinations here: https://developer.valvesoftware.com/wiki/Hammer_Hotkey_Reference.

EDIT: Oh apparently Crash beat me to the punch, mine is prettier though.
 

Shogun

L6: Sharp Member
Jan 31, 2014
260
220
About to blow your mind.

1. Select the face above that one that is lined up properly (the top of that brush.)

2. Alt-Right click the face you want aligned with it (the angled face you are trying to get right.)

3. Praise be the gods of Hammer.

brb praising. Thank you so much!
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
In the case you want to be hardcore (or the rare occasion that method will not work), you can use trigonometry to find the correct angle. There is always math for everything!
 
Sep 19, 2010
475
499
In the case you want to be hardcore (or the rare occasion that method will not work), you can use trigonometry to find the correct angle. There is always math for everything!
This is what I usually do haha. I didn't know about the other method though. Goodbye trig!
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
With one of the sides selected that is aligned already you can hold ALT and Right Click another face of the brush (or any brush actually) to apply the currently selected texture to that face aligned to your currently selected face.

Selecting an aligned face (rotated texture by 90, buffed texture scale by 2x):

ZsWeta5.png


After holding ALT and Right Clicking the next side:

5EyKRnA.png
You forgot to align-to-face in between so that the texture won't be stretched.

In fact, there's another step you can take if you want to be really picky. After alt-right-clicking, hit the "Fit" button to make the texture perfectly stretch to the top and bottom edges. This also makes the texture stretch (or squash) to fit horizontally, which you won't want, so then change that scale back to .25 or .5 or whatever manually and reset the alignment to 0 if you like.