What is the best way to get accurate texture allignment?

Discussion in 'Mapping Questions & Discussion' started by Shogun, May 20, 2014.

  1. Shogun

    Shogun L6: Sharp Member

    Messages:
    262
    Positive Ratings:
    228
    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:

    [​IMG]
    Texture is unrotated and unalligned with the brush

    [​IMG]
    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.
     
  2. Crash

    aa Crash func_nerd

    Messages:
    3,124
    Positive Ratings:
    4,693
    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.
     
    • Thanks Thanks x 7
  3. Egan

    aa Egan

    Messages:
    1,304
    Positive Ratings:
    1,485
    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):

    [​IMG]

    After holding ALT and Right Clicking the next side:

    [​IMG]

    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.
     
    • Thanks Thanks x 9
  4. Shogun

    Shogun L6: Sharp Member

    Messages:
    262
    Positive Ratings:
    228
    brb praising. Thank you so much!
     
  5. Shogun

    Shogun L6: Sharp Member

    Messages:
    262
    Positive Ratings:
    228
    I had no idea that hotkey page exisited until now. Thanks for this and your help.
     
  6. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
    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!
     
  7. Grizzly Berry

    aa Grizzly Berry

    Messages:
    431
    Positive Ratings:
    341
    This is what I usually do haha. I didn't know about the other method though. Goodbye trig!
     
  8. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,215
    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.
     
  9. wareya

    wareya L7: Fancy Member

    Messages:
    493
    Positive Ratings:
    172
    what you do is unstretch it by hand
     
  10. nightwatch

    aa nightwatch

    Messages:
    640
    Positive Ratings:
    446
    And here I was, rotating the texture in photoshop to the correct angle and then packing it into my maps.
     
    • Thanks Thanks x 3
  11. wareya

    wareya L7: Fancy Member

    Messages:
    493
    Positive Ratings:
    172