Hammer Viewports: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Unicodifying, replaced: [[Image: → [[File:, <br style="clear:both"> → {{clr}})
 
(31 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:Level Design]]
== Introduction ==
=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.
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. The first (upper left) window viewport is the 3D View, and the rest are the 2D views.


=The 3D View=
== 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.
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.
There are different rendering modes the 3D View can be switched between. See the [[Hammer View Menu|View Menu]] for more information.


=Using Cameras=
=== Using cameras ===
To take advantage of the 3D view, you need to be able to place cameras. Cameras  
[[File:hammer_cameracomponents.jpg|frame|right|The Camera components shown in the 2D Views.]]
determine your vantage point in the 3D view. Hammer provides you with precise control over the camera movements in your map.
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.
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.


While it is possible to move a single camera all over the map each time you need to look at something new in the 3D window, it is more convenient to have easy access to multiple cameras placed throughout the map. Hammer allows you to easily cycle through multiple cameras by pressing the PageUp and PageDown keys.
You can place multiple cameras in a map, you can cycle through them using the <code>{{key|PageUp}}</code> and <code>{{key|PageDown}}</code> keys. Only one camera is needed per map, but placing one in each larger part of the map may be helpful.


[[Image:hammer_cameracomponents.jpg|The Camera components shown in the 2D Views.]]
For everyday purpose, just use the Mouselook/NoClip style movement method described below.


=Camera Placement=
===Camera placement===
Creating cameras in Hammer is extremely simple. First, switch to the [[Hammer Camera Tool|Camera Tool]] by pressing <code>{{key|Shift}}+{{key|C}}</code>, then hold <code>{{key|Shift}}</code> and with the {{key|LMB}} 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.


Placing cameras in Hammer is extremely simple. First, switch to '''Camera mode''' 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 [[Hammer Camera Tool|Camera Tool]] for more information on how to create and adjust 3D cameras.{{clr}}


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:


=Mouselook/NoClip Style Movement=
* Select the Camera tool, the red camera.
* Click and hold in the 3D viewport.
* Move the mouse like in-game, and use <code>{{key|W}}</code>, <code>{{key|A}}</code>, <code>{{key|S}}</code>, and <code>{{key|D}}</code> keys to move.
* If your mouse is unavailable for looking (i.e. selecting textures), you may use the arrow keys for looking.


The Mouselook movement style is designed to be the similar to the movement in the game and walking around with both the +mlook (mouselook) and NoClip cheats turned on. It can be enabled or disabled by pressing (lowercase) z.
The mouselook can be enabled or disabled by pressing (lowercase) <code>Z</code> while the 3D view is the active viewport.


Moving your mouse around will change the camera direction, while W and S control forward and backward movement, and A and D control sided to side (left and right strafing) movement.
Moving your mouse around will change the camera direction. Pressing the <code>{{key|W}}</code> and <code>{{key|S}}</code> keys control forward and backward movement, and the <code>{{key|A}}</code> and <code>{{key|D}}</code> 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 View options dialog.
You can disable this movement style by deselecting the "Use Mouselook" setting in the [[Hammer 3D Views Options|3D Views options]] dialog.


=Keyboard Shortcuts=
=== Rearranging Viewports ===
The four viewports can display any of the four views: 2D Top (X/Y), 2D Front (Y/Z), 2D Side (X/Z), or 3D camera.  You can change which view is displayed by activating the viewport then selecting <code>View</code> from the top menu then selecting 2D X/Y, 2D Y/Z, 2D X/Z, or one of the 3D selections.  For example the following is a common Computer Aided Design (CAD) configuration where each adjacent view is a rotation about one of the axes.


There are a number of keyboard shortcuts that you can use to quickly maneuver through the 3D view without switching to the Camera tool.
[[File:Hammer CADviewportConfiguration.png|600px]]


While holding the Spacebar:
Once you have the viewports arranged the way you want Hammer should remember it.


# Holding down the Spacebar and the Left Mouse Button allows you to rotate your angle of view in any direction, while the viewing point remains stationary.
== Keyboard shortcuts ==
# Holding down the Spacebar and the Right Mouse Button will allow you to move left, right, up, and down while keeping the viewing angle constant.
=== 3D viewport shortcuts ===
# Holding down the Spacebar with both the Left <i>and</i> Right Mouse Buttons and moving the mouse causes the view to strafe forward, backward, right, and left.
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 the SHIFT key with the Right mouse button allows you to move forward and backward, as well as from side to side. Note that this is the same result as number 4 . Use whichever you are more comfortable with.
 
# Use the Mouse Wheel to move forward and backwards.
* Holding down {{key|Spacebar}}+{{key|LMB}} left mouse button allows you to rotate your angle of view in any direction, while the viewing point remains stationary.
* Holding down {{key|Spacebar}}+{{key|RMB}} right mouse button will allow you to move left, right, up, and down while keeping the viewing angle constant.
* Holding down {{key|Spacebar}}+{{key|LMB}} left mouse button+{{key|RMB}} right mouse button and moving the mouse causes the view to strafe forward, backward, right, and left.
{{tip|You only need to hold the {{key|Spacebar}} ''initially'' for the above shortcuts. Releasing it and holding down only the indicated mouse button(s) will suffice.}}
* Holding down {{key|Shift}}+{{key|Spacebar}}+{{key|RMB}} right mouse button 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.
* {{key|MMB}} scroll mouse wheel moves the camera forward and backwards.
* {{key|Ctrl}}+{{key|Shift}}+{{key|E}} moves the camera to look at the center of the currently selected object(s).
 
=== 2D viewport shortcuts ===
* Hold down the {{key|Spacebar}}+{{key|LMB}} left mouse button to pan the view left, right, up, and down, without using scrollbars or arrow keys. {{tip|The scrollbars can be disabled entirely (for more working space) in the [[Hammer_2D_Views_Options|2D Options]] dialog.}}
* Zoom
** Press {{key|D}} to zoom in the active 2D view, and the {{key|C}} key to zoom out and synchronize all 2D views together.
** {{key|+}} & {{key|-}} on the numeric keypad zooms all 2D views in and out together.
** If your mouse allows it:
***{{key|MMB}} scroll mouse wheel zooms in and out in the active view.
***{{key|Ctrl}}+{{key|MMB}} scroll mouse wheel zooms in and out all 2D views simultaneously.
* {{key|Ctrl}}+{{key|E}} centers the 2D views on the currently selected object(s).
 
=== General viewport shortcuts ===
* {{key|Shift}}+{{key|Z}} toggles between full screen on the current view, and the default 4 views.
* {{key|Ctrl}}+{{key|A}} resizes all 4 views evenly.
 
== See also ==
* [[Hammer Hotkey Reference]]
 
[[Category:Hammer]]

Latest revision as of 06:27, 8 January 2024

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 LMB 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.

Rearranging Viewports

The four viewports can display any of the four views: 2D Top (X/Y), 2D Front (Y/Z), 2D Side (X/Z), or 3D camera. You can change which view is displayed by activating the viewport then selecting View from the top menu then selecting 2D X/Y, 2D Y/Z, 2D X/Z, or one of the 3D selections. For example the following is a common Computer Aided Design (CAD) configuration where each adjacent view is a rotation about one of the axes.

Hammer CADviewportConfiguration.png

Once you have the viewports arranged the way you want Hammer should remember it.

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 Spacebar+LMB left mouse button allows you to rotate your angle of view in any direction, while the viewing point remains stationary.
  • Holding down Spacebar+RMB right mouse button will allow you to move left, right, up, and down while keeping the viewing angle constant.
  • Holding down Spacebar+LMB left mouse button+RMB right mouse button and moving the mouse causes the view to strafe forward, backward, right, and left.
Tip.pngTip:You only need to hold the Spacebar initially for the above shortcuts. Releasing it and holding down only the indicated mouse button(s) will suffice.
  • Holding down Shift+Spacebar+RMB right mouse button 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.
  • MMB scroll mouse wheel moves the camera forward and backwards.
  • Ctrl+ Shift+E moves the camera to look at the center of the currently selected object(s).

2D viewport shortcuts

  • Hold down the Spacebar+LMB left mouse button to pan the view left, right, up, and down, without using scrollbars or arrow keys.
    Tip.pngTip:The scrollbars can be disabled entirely (for more working space) in the 2D Options dialog.
  • Zoom
    • Press D to zoom in the active 2D view, and the C key to zoom out and synchronize all 2D views together.
    • + & - on the numeric keypad zooms all 2D views in and out together.
    • If your mouse allows it:
      • MMB scroll mouse wheel zooms in and out in the active view.
      • Ctrl+MMB scroll mouse wheel zooms in and out all 2D views simultaneously.
  • Ctrl+E centers the 2D views on the currently selected object(s).

General viewport shortcuts

  • Shift+Z toggles between full screen on the current view, and the default 4 views.
  • Ctrl+A resizes all 4 views evenly.

See also