Tuesday, 10 January 2012

LabVIEW






LabVIEW
Programs













Introduction to LabVIEW
LabVIEW is an application that lets you interface a computer with an experiment. It is extremely powerful, allowing you to generate and measure analog and digital voltages as well as control the timing of such operations. In order to be such a powerful application,there is a huge amount of exibility in what you can program. This makes it a little more difficult to get started, but once you become familiar with the procedures you will enjoy an amazing capability. After a description of the general features of the application, you will be prompted to write four basic programs, each of which performs one operation. Following that, you will write two programs that are more complicated. Finally, you will have the chance to browse the library of example programs and then write a program of your ownchoosing. The computer is equipped with a National Instrument PCI-6221 Multifunctional I/O board. This board is capable of (1) generating an analog voltage (D/A conversion), (2) measuring an analog voltage (A/D conversion), (3) generating and measuring digital voltages (digital I/O), and (4) timing the various operations. The D/A and A/D conversions have a resolution of 16 bits, meaning that the voltage range (-10 to +10 V) is divided into 216 = 65536 levels. The spacing between levels is therefore 0:3 mV if the voltage range is -9.99756 to 10.00000 V. You can choose ranges/resolution among some standard settings
(_10V , _ 5V , _ 1V , _ 0:2V ). Every generated or measured analog voltage will be one of these 216 values. There are 2 analog output channels for generating voltages and 8 analog input channels for measuring voltages. The 8 analog input channels can be set up to use the same ground connection as the reference (this is called RSE or Referenced Single Ended, there is also differential input, but we aren't going to use this). The 2 analog output channels have a common reference ground. There are 3 digital channels, each of which has 8 lines that can be low/false (0 V) or high/true (5 V). Each digital channel can be used either to generate a digital voltage (digital out) or measure a digital voltage (digital in), but clearly not both at the same time!

Introduction to Virtual Instruments
LabVIEW programs are called virtual instruments, or VIs, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. LabVIEW contains a comprehensive set of tools for acquiring, analyzing, displaying, and storing data, as wellastoolstohelpyoutroubleshootcodeyouwrite.
In LabVIEW, you build a user interface, or front panel, with controls and indicators. Controls are knobs, push buttons, dials, and other input mechanisms. Indicators are graphs, LEDs, and other output displays. After you build the user interface, you add code using VIs and structures to control the front panel objects. The block diagram contains this code.
You can use LabVIEW to communicate with hardware such as data acquisition, vision, and motion control devices, as well as GPIB, PXI, VXI, RS232, and RS485 instruments.
Building the Front Panel
The front panel is the user interface of a VI. Generally, you design the front panel first and then design the block diagram to perform tasks on the inputs and outputs you create on the front panel.
You build the front panel using controls and indicators, which are the interactive input and output terminals of the VI, respectively. Controls are knobs, push buttons, dials, and other input mechanisms. Indicators are graphs, LEDs, and other output displays. Controls simulate instrument input mechanisms and supply data to the block diagram of the VI. Indicators simulate instrument output mechanisms and display data the block diagram acquires or generates.
Select View»Controls Palette to display the Controls palette and then select controls and indicators from the Controls palette and place them on the front panel.
Refer to the labview\examples\general directory for examples of building front panels
Block Diagram Data Flow
LabVIEW follows a dataflow model for running VIs. A block diagram node executes when it receives all required inputs. When a node executes, it produces output data and passes the data to the next node in the dataflow path. The movement of data through the nodes determines the execution order of the VIs and functions on the block diagram.
Visual Basic, C++, JAVA, and most other text-based programming languages follow a control flow model of program execution. In control flow, the sequential order of program elements determines the execution order of a program.
In LabVIEW, the flow of data rather than the sequential order of commands determines the execution order of block diagram elements. Therefore, you can create block diagrams that have simultaneous operations. For example, you can run two For Loops simultaneously and display the results on the front panel, as shown in the following block diagram.
LabVIEW is a multitasking and multithreaded system, running multiple execution threads and multiple VIs simultaneously.
LabVIEW Tools
The Tools menu allows you to change the function of the cursor.  For example, in one mode the cursor can be used to change values, and in another it can be used to move and size items.  If you let the mouse cursor hover over a button on the Tools menu, a description of what that button does will appear.




Next is the Function menu.  This is available only when working on the Block Diagram.
This window contains many menus and sometimes submenus for creating your program.  There are a great many functions available and this tutorial will only touch on a few of them.  For more information on what each function button does, refer to the Simple Help popup that can be enabled from the Help menu or the more complete online help also available in the Help menu.  The complete documentation is also available online at
For now we will just create a very simple program.  If you look at the Block Diagram window you will notice that there are two blocks already present, Numeric and Numeric2.  These are representations of what is on the Front Panel.  Remember that Numeric is a Digital Control while Numeric2 is a Digital Indicator.  This means that Numeric will probably be an input value and Numeric2 will be an output value.  The first thing we will try to do is add a constant to Numeric and display the result in Numeric2.  Go to the Numeric menu on the Function window, and select the Add block.  Place this block between Numeric and Numeric2 on the Block Diagram window.  You might want to use the Position/Size/Select cursor (the arrow in the Tools menu) to move Numeric and Numeric2 farther apart
 Tools Palette
The Tools palette is available on the front panel and the block diagram. A tool is a special operating mode of the mouse cursor. The cursor corresponds to the icon of the tool you select on the palette. Use the tools to operate and modify front panel and block diagram objects.
If automatic tool selection is enabled and you move the cursor over objects on the front panel or block diagram, LabVIEW automatically selects the corresponding tool from the Tools palette.
Select View»Tools Palette to display the Tools palette. LabVIEW retains the Tools palette position so when you restart LabVIEW, the palette appears in the same position.
Tip   Press the <Shift> key and right-click to display a temporary version of the Tools palette at the location of the cursor.
You can disable automatic tool selection by clicking the Automatic Tool Selection button on the Tools palette, shown as follows.
When automatic tool selection is disabled, you can use the <Tab> key to move through the most commonly used tools in the sequence they appear on the palette.
To use another tool without clicking to disable automatic tool selection, click the tool you want to use. When you are finished, press the <Shift-Tab> keys or click the Automatic Tool Selection button to enable automatic tool selection again.

Function Palette

The Function Palette contains buttons for functions that are already configured through expanded DeskTopBinder Lite functions. Using these buttons, you can print Windows files, preview printouts, convert images, and register scanners for documents without having to open DeskTopBinder Lite. You can also use these functions simply by dragging a target file to the button corresponding to the required function and dropping it there.
1.                  On the [Start] menu, point to [All Programs], [DeskTopBinder], and then click [Function Palette].
An icon for the Function palette is added to the task tray displayed at the bottom right of the screen.
2.                  Right-click the new icon that has been added to the task tray, and then click [Properties...].
The [Properties] dialog box appears.
3.                  Click the [Contents] tab, select the [PDF Direct Print] check box at the center, and then click [OK].
The [Properties] screen closes and the [PDF Direct Print] icon is added to the palette.

Front Panel Controls and Indicators

NI LabVIEW 8.6 Help
June 2008

NI Part Number:
371361E-01

»
View Product Info
Use the front panel controls and indicators located on the Controls palette to build the front panel. Types of controls and indicators include numeric controls such as slides and knobs, numeric indicators such as meters and gauges, graphs, charts, Boolean controls and indicators such as buttons and switches, strings, paths, arrays, clusters, listboxes, tree controls, tables, ring controls, enumerated type controls, containers, and so on.

Styles of Controls and Indicators

Front panel controls and indicators can appear in modern, classic, or system style.
Select File»VI Properties and select Editor Options from the Category pull-down menu to change the style of the control or indicator LabVIEW creates when you right-click a terminal and select Create»Control or Create»Indicator from the shortcut menu. Select Tools»Options and select Front Panel from the Category list to change the style of the control or indicator LabVIEW creates in new, blank VIs when you right-click a terminal and select Create»Control or Create»Indicator from the shortcut menu. Note  You cannot customize the appearance of the dialog spin control, slide controls, progress bars, or scroll bars because the controls and indicators use platform-specific drawing functions that do not support customization. You also cannot use Property Nodes and Invoke Nodes to customize the appearance of these controls and indicators.

Modern and Classic Controls and Indicators

Many front panel objects have a high-color appearance. Set the monitor to display at least 16-bit color for optimal appearance of the objects.
The controls and indicators located on the Modern palette also have corresponding low-color objects. Use the controls and indicators located on the Classic palette to create VIs for 256-color and 16-color monitor settings.

System Controls and Indicators

Use the system controls and indicators located on the System palette in dialog boxes you create. The system controls and indicators are designed specifically for use in dialog boxes and include ring and spin controls, numeric slides, progress bars, scroll bars, listboxes, tables, string and path controls, tab controls, tree controls, buttons, checkboxes, radio buttons, and an opaque label that automatically matches the background color of its parent. These controls differ from those that appear on the front panel only in terms of appearance. These controls appear in the colors you have set up for the system.
The system controls change appearance depending on which platform you run the VI. When you run the VI on a different platform, the system controls adapt their color and appearance to match the standard dialog box controls for that platform.
You can find similar controls and indicators on other palettes in LabVIEW. For example, the Cancel button located on the System palette is similar to the Cancel button located on the Boolean palette.

Numeric Displays, Slides, Scroll Bars, Knobs, Dials, and Time Stamps

Use the numeric objects located on the Numeric and Classic Numeric palettes to create slides, scroll bars, knobs, dials, and numeric displays. The palette also includes color boxes and a color ramp for setting color values and time stamps for setting time and date values. Use the numeric objects to enter and display numeric data.
You can set the representation, data range, and format and precision for numeric objects. Numeric objects accept only certain numeric characters. Tip  Expect users to supply invalid values for numeric controls. Right-click the control and select Data Entry to set the control item to coerce invalid values into a desired range. Refer to the LabVIEW Style Checklist for more tips on how to maintain consistent style and quality throughout a VI.

Numeric Controls and Indicators

Numeric controls and indicators are the simplest way to enter and display numeric data. You can resize these front panel objects horizontally to accommodate more digits. Change the value of a numeric control using any of the following ways:
Use the Operating tool or the Labeling tool to click inside the digital display window and enter numbers from the keyboard.
Use the Operating tool to click the increment or decrement arrow buttons of a numeric control.
Use the Operating tool or the Labeling tool to place the cursor to the right of the digit you want to change and press the up or down arrow keys.
When you type a new value into a numeric control or indicator, the Enter button appears on the toolbar to remind you that the new value replaces the old value only when you press the <Enter> key, click outside the digital display window, or click the Enter button. While the VI is running, LabVIEW waits until you perform one of these actions to interpret the new values. For example, while changing a value in the digital display to 135, you do not want the VI to receive the values 1 and 13 before 135.
Note  If the numeric control or indicator has a format of engineering or SI notation and does not have a complex representation, LabVIEW adds any necessary prefixes to the unit string to retain the floating-point representation.
By default, LabVIEW displays and stores numbers like a calculator. A numeric control or indicator displays up to six digits before automatically switching to exponential notation. You can configure the number of digits LabVIEW displays before switching to exponential notation by right-clicking the numeric object and selecting Display Format from the shortcut menu to display the Display Format page of the Numeric Properties dialog box.
The precision you select affects only the display of the value. The internal accuracy still depends on the representation.

Slide Controls and Indicators

Slide controls and indicators are numeric objects with a scale. The slide controls and indicators include vertical and horizontal slides, a tank, and a thermometer. Change the value of a slide control using either of the following ways:
*    Use the Operating tool to click or drag the slider to a new position.
Use the digital display to enter data just as you do for numeric controls and indicators.
As you change the value, LabVIEW displays the value of the control in a tip strip. If you drag the slider to a new position and the VI is running during the change, the control passes intermediate values to the VI, depending on how often the VI reads the control.
Slide controls or indicators can display more than one value. Right-click the object and select Add Slider from the shortcut menu to add more sliders. The data type of a control with multiple sliders is a cluster that contains each of the numeric values.
You can customize the scale of a slide control or indicator.

Scroll Bar Controls and Indicators

Scroll bar controls, similar to slide controls, are numeric objects you can use to scroll data. The scroll bar controls include vertical and horizontal scroll bars. Change the value of a scroll bar by using the Operating tool to click or drag the square scroll box to a new position, by clicking the increment and decrement arrows, or by clicking the spaces between the scroll box and the arrows.

Rotary Controls and Indicators

The rotary controls and indicators include knobs, dials, gauges, and meters. The rotary objects operate similarly to the slide controls and indicators because they are numeric objects with a scale. Change the value of a rotary control using either of the following ways:
*    Use the Operating tool to click or drag the needle to a new position.
Use the digital display to enter data just as you do for numeric controls and indicators.
As you change the value, LabVIEW displays the value of the control in a tip strip.
Rotary controls or indicators can display more than one value. Right-click the object and select Add Needle to add new needles. The data type of a control with multiple needles is a cluster that contains each of the numeric values.
You can customize the scale or color ramp of a rotary control or indicator.

Time Stamp Control and Indicator

Use the time stamp control and indicator to send and retrieve a time and date value to or from the block diagram. You can change the value of the time stamp control using any of the following ways:
Right-click the control and select Display Format from the shortcut menu.
*    Click the Time/Date Browse button, shown as follows, to display the Set Tim and Date dialog box.
*    Right-click the control and select Data Operations»Set Time and Date from the shortcut menu to display the Set Time and Date dialog box.
Right-click the control and select Data Operations»Set Time to Now from the shortcut menu.

Color Boxes

A color box displays a color that corresponds to a specified value. For example, you can use color boxes to indicate different conditions, such as out-of-range values. The color value is expressed as a hexadecimal number with the form RRGGBB. The first two digits control the red color value. The second two digits control the green color value. The last two digits control the blue color value.
Set the color of the color box by clicking it with the Operating or Coloring tool to display the color picker.

Color Ramps

A color ramp uses color to display its numeric value. You configure a color ramp that consists of at least two arbitrary markers, each with a numeric value and a corresponding display color. As the input value changes, the color displayed changes to the color that corresponds to that value. Color ramps are useful for visually indicating data ranges, such as a warning range for when a gauge reaches dangerous values. For example, you can use a color ramp to set the color scale for intensity graphs and charts.
Right-click the color ramp and use the shortcut menu items to customize the appearance, size, colors, and number of colors.
You also can add a color ramp to any knob, dial, or gauge on the front panel. Meters have a visible color ramp by default.

Graphs and Charts

Use the graph controls and indicators on the Graph and Classic Graph palettes to plot numeric data in graph or chart form. Use the picture indicator to create, modify, and view graphics in LabVIEW. Use the 3D picture control to display graphical representations of 3D objects.

Buttons, Switches, Lights, and Checkboxes

Use the Boolean controls and indicators located on the Boolean and Classic Boolean palettes to create buttons, switches, and lights. Use Boolean controls and indicators to enter and display Boolean (TRUE/FALSE) values. For example, if you are monitoring the temperature of an experiment, you can place a Boolean warning light on the front panel to indicate when the temperature exceeds a certain level.
Boolean controls have six types of mechanical action that allow you to customize Boolean objects to create front panels that more closely resemble the behavior of physical instruments. Use the shortcut menu to customize the appearance of Boolean objects and how they behave when you click them.
Boolean controls and indicators have Boolean text labels in addition to their owned labels.

Radio Buttons Controls

Use the radio buttons control to give users a list of items from which they can select only one item at a time. If you want to give users the option to select none or one item, right-click the control and select Allow No Selection from the shortcut menu to place a checkmark next to the menu item.
Because the data type of a radio buttons control is an enumerated type, you can use the radio buttons control to select the cases of a Case structure.
You cannot right-click Boolean controls in the radio buttons control and perform data operations, such as setting the default value.
Refer to the following VIs for examples of using a radio buttons control:
Radio Buttons Control VI: labview\examples\general\controls\booleans.llb  
Radio Buttons With Event Structure VI: labview\examples\general\controls\booleans.llb  

Mixed Checkboxes

Use a mixed checkbox to display a TRUE, FALSE, or MIXED value. For example, use a mixed checkbox if you want to display a set of Boolean values in a single indicator, where that set of Boolean values are either all TRUE, all FALSE, or a combination of TRUE and FALSE, called MIXED. Use the mixed checkbox as a control to simultaneously change a set of Boolean values to either a TRUE or FALSE value.
Although the mixed checkbox is an enumerated type control, you can configure the control similarly to a Boolean control.
To disable the ability to set the MIXED value of a mixed checkbox interactively, right-click the control and select Allow Mixed from the shortcut menu to remove the checkmark next to the menu item. When you disable Allow Mixed, LabVIEW can assign the value of the mixed checkbox as MIXED, but you cannot operate to MIXED by clicking on it.
Running vis
This document contains the LabVIEW 8.5 Run-Time Engine. This Run-Time Engine must be installed on any Windows system where you plan to run executables that you build with the LabVIEW Application Builder. Version 8.5 of the Run-Time Engine may be used only to run executables that were built with LabVIEW 8.5
Additionally, the Run-Time Engine allows your browser to display VIs that are embedded in Web pages.
If you were attempting to view a VI through a browser and you were directed to this site by your Web browser, the VI will display correctly after you install either Run-Time Engine.
There are two downloads that are available. You only need to install one of them.
·                 LabVIEW 8.5 Run-Time Engine (Standard) gives full support for executables. This version will support all executables built with LabVIEW as well as allow viewing of Remote Front Panels in web browsers. It includes support for DataSocket, Variable Engine and NI-USI. This version can be deployed using an installer created with Application Builder. Download LabVIEW85RuntimeEngineFull.exe to install this version.
·                 LabVIEW 8.5 Run-Time Engine (Web Browser Only) is a smaller download intended for viewing Remote Front Panels in web pages. It does not contain the full run-time engine, but will allow some executables to run. This version can not be deployed. Download LVRunTimeEng.exe to install this version.

maya L 2


Lesson 2: Creating, manipulating, and viewing
objects
Introduction
Using primitive objects to model 3D forms is a great place to continue learning
about Maya. You can create many types of 3D objects using Maya and then
move, scale, and rotate them to create more complex forms in your scene.
In this lesson, you begin to construct a classic temple using the primitive
object creation tools in Maya. The project is not very complex and provides
you with experience in using some of the important object manipulation and
viewing tools.
As you continue to work with Maya, you’ll learn how to visualize more
complex forms using these basic objects. Maya has many advanced tools and
options for modeling complex forms, as you will learn in later chapters.
In this lesson, you learn how to:
■ Create 3D primitive objects.
■ Select objects for manipulation and editing purposes.
■ Move and rotate objects using your mouse.
■ Move, rotate, and scale objects using numeric input.
■ Duplicate objects.
■ Change the viewing panels in Maya using a variety of methods so you can
view your objects from different points of view.
Lesson 2: Creating, manipulating, and viewing objects | 29
■ Undo actions when you need to undo a particular task or step.
Creating a new scene
You begin your temple project by creating a new empty scene.
To create a new scene
1 Start Maya (if it is not already running).
When Maya starts, it automatically creates a new scene.
If Maya was previously running, follow steps 2 and 3.
2 From the main menu, select File > New Scene.
Maya displays the following prompt.
3 Click No.
Maya creates a new scene and delete everything that was in the previous
scene.
Primitive objects
Maya provides many types of primitive types and shapes such cubes, spheres,
cylinders, and planes.
Primitive objects can be used as a starting point for a wide variety of shapes
and forms. The most common workflow when using primitive objects is:
■ Set the construction options for the primitive when you initially create it
so that it appears in the Maya scene roughly in the size and shape that
you require.
30 | Chapter 2 Maya Basics
■ Move, scale, and rotate the primitive object into its final position either
by direct manipulation (the move, scale, and rotate tools), or by entering
numeric values through an editor.
■ Duplicate the primitive objects to create multiple copies of the original or
create different variations from your original primitive object.
In this section, you construct the base for the temple using a polygonal cylinder
primitive. The octagonal shape is created by modifying the creation options
for the cylinder tool before you create the object. If you did not modify the
cylinder options you would create a round cylinder.
To create a polygonal cylinder for the base
1 Select the Polygons menu set.
NOTE Unless otherwise indicated, the directions in this lesson for making
menu selections assume you’ve already selected the Polygons menu set.
You should also ensure that the Interactive Creation option for primitives
is first turned off by selecting Create > Polygon Primitives > Interactive
Creation to ensure the check mark does not appear beside the item.
2 From the main menu, select Create > Polygon Primitives > Cylinder >
.
An option window appears.
3 In the Polygon Cylinder Options window, select Edit > Reset Settings and
then set the following options:
■ Radius: 10
■ Height: 1
■ Axis divisions: 8
■ Height divisions: 1
■ Cap divisions: 1
■ Axis: Y
4 In the Polygon Cylinder Options window, click Create.
Primitive objects | 31
Maya creates a cylinder primitive object that is octagonal in shape and
positioned at the center of the Maya workspace. This cylinder is 20 units
wide by one unit high, and has eight faceted sides.
NOTE You were instructed to reset the option settings as a precaution in
case they had been set differently. This is a good habit to practice when
working with tool options to avoid getting a result that was different from
what you expected.
The Toolbox: Layout shortcuts
The Toolbox is located on the left hand side of the Maya user interface. It
contains icons that open tools for transforming your objects within Maya
(selection, move, rotate, scale) as well as layout shortcuts for changing the
views and panel layouts.
The Quick Layout buttons shortcuts allow you to select a different panel or
switch to another layout.
You need to finish positioning the cylinder. To do this you need to see the
object from a side view to make sure it is sitting exactly on the ground plane.
To change the panel layout to view the base from a side view
1 From the Toolbox, click the Four View layout shortcut.
32 | Chapter 2 Maya Basics
The workspace changes to a four-view layout. The perspective view is
located in the top right corner and the other views show the object from
the top, front and side. The layout shortcuts have other options that you
will learn later in this tutorial.
It’s now possible to see the base from the side view, but it would be easier
to determine the position of the base if the side view were enlarged to a
full view.
2 To enlarge the side view, position the mouse cursor in the side view, and
tap the spacebar of your keyboard.
The workspace changes to a single view layout with the side view in an
enlarged view. It is easier to view the position of the base from this side
view. Notice that the base lies slightly above and below the ground plane
(X, Z).
The Toolbox: Layout shortcuts | 33
TIP You can position your mouse cursor in any scene view and tap the
spacebar once to toggle the view. If the view is a full panel view, it will change
to a four panel view and vice versa.
The Toolbox:Transformation tools
You need to move the base slightly upwards in the Y direction so it is
positioned on the X, Z plane. To do this you use the Move transformation
tool located in the Toolbox.
The upper half of the Toolbox contains the tools for transforming objects
(selection, move, rotate, scale) within Maya. When you move your mouse
cursor over any transformation tool icon you see the name of the tool appear
next to the mouse cursor.
The tool’s name also appears in the Help Line at the bottom of the Maya
window. The Help Line has an additional purpose: it displays summary
instructions as you use tools that require several steps.
Selection and de-selection of objects
Before you can transform an object, you must ensure it is selected. You can
select objects by clicking them directly, or by dragging a rectangular bounding
34 | Chapter 2 Maya Basics
box around some portion of the object to indicate what you want selected.
To deselect an object, you simply click somewhere off of the selected object.
To select the base primitive object in the scene view
1 Do one of the following:
■ With your left mouse button, click the object’s wireframe outline in the
scene view.
■ With your left mouse button, drag a bounding box around one corner or
edge of the object’s wireframe.
The object is selected when its wireframe outline color displays in a bright
green color. If it is not selected, its display color is navy blue.
To use the Move Tool to adjust the position of the base
1 Select the Move Tool from the Toolbox.
A move manipulator icon appears over the primitive cylinder in the scene
view.
The Move Tool Manipulator has handles that point in the direction of
the three fundamental axis directions of 3D space: X, Y, Z. The handles
are colored red, green, and blue based on their function related to the X,
Y, Z axes and control the direction of the movement along an axis.
When you click a specific handle, it indicates that the move is constrained
to that particular axis direction.
2 In the side view, drag the green Y manipulator handle to move the
primitive cylinder upwards in the Y direction. Move it upwards enough
so that the bottom of the base cylinder is aligned with the X axis (the
thick dark line of the grid)
The Toolbox:Transformation tools | 35
The base cylinder now needs to be rotated slightly so the front of the base is
parallel to a grid line. Since each facet of the octagon represents 45 degrees of
a circle, you need to rotate the object approximately half of that amount or
22.5 degrees.
To use the Rotate Tool to adjust the position of the base
1 Display all four views by positioning the mouse cursor in the view and
tapping the spacebar of your keyboard.
The four view panel appears.
2 Position the mouse cursor in the top view and tap the spacebar once.
The top view appears in the workspace.
3 With the base cylinder selected, choose the Rotate tool from the Toolbox.
A rotate manipulator icon appears over the primitive cylinder in the scene
view.
The Rotate Tool manipulator consists of three rings (handles), plus a
virtual sphere enclosed by the rings. The colors of the handles correspond
to the X, Y, and Z axes. The handles are colored red, green, and blue based
on their function related to the X, Y, Z axes and control the direction of
the rotation around an axis.
4 In the top view, drag the green Y manipulator ring to rotate the primitive
cylinder so that one of the facets of the base cylinder is aligned with the
grid as shown in the image below.
36 | Chapter 2 Maya Basics
You are rotating the cylinder around its Y axis.
You may be asking yourself the question “How do I know if I’ve rotated
the base exactly 22.5 degrees?” You can check the accuracy of the rotation
by viewing the Channel Box. Rotate Y should be close to 22.5 degrees.
TIP You can undo and redo the last action you performed. Undo reverses
the last action you performed on a selected object. It also reverses any action
you performed from the Edit Menu.
To undo an action select, Edit > Undo, Redo, Repeat. Maya allows you
to perform multiple undos.
The Channel Box
The Channel Box is an editing panel that provides you access to an object’s
transformation information and much more. It provides information on three
distinct areas for any type of object: The transform node, shape node, and
input node.
Nodes are where information about object types are kept track of within Maya.
Nodes are comprised of attributes. Attributes refer to information related to
what the node is designed to accomplish. In this case, information about the
primitive cylinder’s Y axis rotation is referred to as the Rotate Y attribute. You
will learn more about nodes later in this tutorial.
When you moved and rotated the cylinder primitive using the Move Tool,
you were doing this by your own visual judgement. This will usually be
sufficient for many of your creative applications.
If you need to control the attribute of an object with more accuracy you can
do this by entering the precise values into the appropriate attribute field of
the Channel Box.
The Channel Box | 37
To move and rotate the base using the Channel Box
1 With the base cylinder selected, view the Transformation attributes in
the Channel Box. Specifically, view the values for Translate Y, and Rotate
Y.
2 In the Channel Box, adjust the attribute values so they match the above
image by clicking in the field and entering the correct numerical values.
This accurately positions the base in your Maya scene.
Maya named the cylinder primitive when it was first created. Rename
the cylinder to something more meaningful to your project.
To rename the cylinder primitive using the Channel Box
1 In the Channel Box, click in the field with the name pCylinder1.
2 Rename the primitive object by typing the new name: templeBase and
then pressing Enter.
38 | Chapter 2 Maya Basics
Duplicating objects
Duplicating an existing object is a useful way to make an exact copy of it
without having to start over. When you duplicate an item the copy takes on
the characteristics of the original. Using the Duplicate Tool you can
additionally apply transformations to the copy (move, rotate, scale).
Return to a four view layout to view what you’ve accomplished to this point.
To change the panel layout to a four view layout
1 From the Toolbox, click the Four View layout shortcut.
The workspace changes to a four view layout. It is easier to view the work
from this four view layout.
The base for the temple is constructed of two levels and appears stepped.
You duplicate and scale the templeBase object using the duplicate tool.
To duplicate the temple base
1 Display all four views by positioning the mouse cursor in the view and
tapping the spacebar. Then click in the perspective view to display the
base in this view.
2 With templeBase selected, choose Edit > Duplicate Special > from the
main menu.
The Duplicate Special Options window appears.
Duplicating objects | 39
3 In the Duplicate Special Options window, select Edit > Reset Settings and
then set the following options:
■ Translate: 0 1.0 0
■ Rotate: 0 0 0
■ Scale: 0.9 1.0 0.9
■ Geometry Type: Copy
■ Group under: Parent
4 In the Duplicate Options window, click Duplicate Special.
Maya creates a duplicate of the templeBase object that is scaled to 0.9 of
the original in the X, Z axes, and is one unit above templeBase. As a result
of the scale operation, the base for the temple now appears stepped.
Maya keeps track of the name of the duplicated object based on the name
of original and renames the duplicated object templeBase1.
Save your work
In the last lesson we recommended that you save your work at regular intervals.
An example of this is when you have just completed a major task such as
constructing the base for the temple. With this strategy, if you ever make a
mistake, you can always open the previously saved version of your work and
begin from there.
To save your Maya scene
1 Select File > Save Scene.
A file browser appears showing the GettingStarted project directory
where you can save your scene.
40 | Chapter 2 Maya Basics
If you do not see the GettingStarted project directory, you have not yet
copied the GettingStarted folder and set it as your Maya project. For
more information, see Copying and setting the Maya project on page 25.
2 Within the GettingStarted project directory, ensure that you are saving
in the scenes sub-directory.
3 Type Lesson2Base in the file name text box.
4 Click Save.
Beyond the lesson
In this lesson you continued with the fundamental tools and skills to
successfully learn:
■ An overall workflow for constructing forms using primitive objects.
■ Where the primitive object tools are located in the main menu.
■ How to create a primitive object as well as reset and edit its creation
options.
■ How to change between a single view and four view panel layout using
layout shortcuts and by tapping the spacebar of your keyboard.
■ How to select objects by clicking them with your mouse.
■ How to move and rotate objects using the transformation tools in the
Toolbox.
■ That tool manipulators can constrain a transformation to the X, Y, or Z
axes.
■ How to edit an object’s transformation node attributes (move, rotate, scale)
accurately using the Channel Box.
■ How to rename objects using the Channel Box.
■ How to duplicate objects and apply transformations while doing so.
We suggest you additionally practice the following tasks on your own:
■ Creating other primitive object types, with various options so that you
can understand the variations that are possible.
Beyond the lesson | 41
■ Try using the ViewCube™ located in the upper-right corner of the active
scene view to change the camera’s viewing angle in relation to the objects
in the scene.
■ Practice moving, rotating, and scaling objects, and changing between the
various scene views (single perspective, four view, single side, single top