Hammer Viewports

From Valve Developer Community
Jump to navigation Jump to search

Introduction

Before you can begin creating and placing solids and entities, you need to familiarize yourself with the Hammer interface. By default, your working area is divided into four sections, called views, or viewports. The first (upper left) window viewport is the 3D View, and the rest are the 2D views.

The active viewport

Certain operations, such as keyboard shortcuts, rely on which of the 2D or 3D views is the active viewport. The active viewport is set by placing the mouse cursor over the desired viewport. Pressing a keyboard shortcut will then use that viewport as a reference.

The 3D view

The 3D window is a dynamic 3D space where you can view your level from any angle. This is critical for checking textures and texture alignment, spotting leaks and just getting a sense of what your finished level will look like.

There are different rendering modes the 3D View can be switched between. See the View Menu for more information.

Using cameras

The Camera components shown in the 2D Views.

To take advantage of the 3D view, you need to be able to place cameras. Cameras determine your vantage point in the 3D view. Hammer provides you with precise control over the camera movements in your map.

A camera in Hammer (as displayed in the 2D views) consists of three parts: the eye, the target, and the viewing angle, which is represented by a line extending out from the eye. The length of the line that represents the viewing angle is not important, though it can help you aim the camera exactly at an object.

You can place multiple cameras in a map, you can cycle through them using the PageUp and PageDown keys. Only one camera is needed per map, but placing one in each larger part of the map may be helpful.

For everyday purpose, just use the Mouselook/NoClip style movement method described below.

Camera placement

Creating cameras in Hammer is extremely simple. First, switch to the Camera Tool by pressing Shift+C, then hold Shift and with the left mouse button, click-drag a line in one of the 2D views. This will create a thin red line with a large dot at one end. The dot is the camera's position, and this is where the 3D camera view will originate. The red line is the camera's viewing angle. The end of the red line is the camera's target. You can adjust either end of the line by dragging it with the left mouse button to change the view. Follow the above steps to create as many cameras in your level as you need. While in Camera mode, you can adjust the camera position by moving the eye or viewing angle in any of the 2d windows.

See the Camera Tool for more information on how to create and adjust 3D cameras.

Mouselook/NoClip style movement

The "mouselook" movement style is the easiest way of moving around in the 3D view. It is designed to be similar to the in-game "NoClip" mode. Using it is very simple:

  • Select the Camera tool, the red camera.
  • Click and hold in the 3D viewport.
  • Move the mouse like in-game, and use W, A, S and D keys to move.
  • If your mouse is unavailable for looking (i.e. selecting textures), you may use the arrow keys for looking.

The mouselook can be enabled or disabled by pressing (lowercase) Z while the 3D view is the active viewport.

Moving your mouse around will change the camera direction. Pressing the W and S keys control forward and backward movement, and the A and D keys control side-to-side (left and right strafing) movement.

You can disable this movement style by deselecting the "Use Mouselook" setting in the 3D Views options dialog.

Keyboard shortcuts

3D viewport shortcuts

There are a number of keyboard shortcuts that you can use to quickly maneuver through the 3D view without switching to the Camera tool:

  • Holding down LMB+Spacebar allows you to rotate your angle of view in any direction, while the viewing point remains stationary.
  • Holding down RMB+Spacebar will allow you to move left, right, up, and down while keeping the viewing angle constant.
  • Holding down LMB+RMB+Spacebar and moving the mouse causes the view to strafe forward, backward, right, and left.
  • Holding down Shift+Spacebar+RMB allows you to move forward and backward, as well as from side to side. Note that this is the same result as the previous method. Use whichever you are more comfortable with.
  • Use the Mouse Wheel to move forward and backwards.
  • Press Ctrl+Shift+E to move the camera to look at the center of the currently selected object(s).

2D viewport shortcuts

  • Holding down LMB+Spacebar you to pan the view left, right, up, and down, without using scrollbars. The scrollbars can be disabled entirely (for more working space) in the 2D Options dialog.
  • Use the Mouse Wheel to zoom.
  • Press Ctrl+E to center the 2D views on the currently selected object(s).

General viewport shortcuts

  • Press Shift+Z to toggle full screen on the current view. Press Shift+Z again to restore 4 views.
  • Press Ctrl+A to resize all 4 views evenly.

See also