Chapter 14: Drawing and Editing 2D Splines and Shapes


Many modeling projects start from the ground up, and you can't get much lower to the ground than 2D. But this book is on 3D, you say? What place is there for 2D shapes? Within the 3D world, you frequently encounter flat surfaces-the side of a building, the top of a table, a billboard, and so on. All these objects have flat 2D surfaces. Understanding how objects are composed of 2D surfaces will help as you start to build objects in 3D. This chapter examines the 2D elements of 3D objects and covers the tools needed to work with them.

Working in 2D in Max, you use two general objects: splines and shapes. A spline is a special type of line that curves according to mathematical principles. In Max, splines are used to create all sorts of shapes such as circles, ellipses, and rectangles.

You can create splines and shapes using the Create image from book Shapes menu, which opens the Shapes category on the Create panel. Just as with the other categories, several spline-based shape primitives are available. Spline shapes can be rendered, but they are normally used to create more advanced 3D geometric objects by extruding or lathing the spline. You can even find a whole group of modifiers that apply to splines. You can use splines to create animation paths as well as Loft and NURBS objects, and you will find that splines and shapes, although they are only 2D, are used frequently in Max.

Drawing in 2D

Shapes in Max are unique from other objects because they are drawn in 2D, which confines them to a single plane. That plane is defined by the viewport used to create the shape. For example, drawing a shape in the Top view constrains the shape to the XY plane, whereas drawing the shape in the Front view constrains it to the ZX plane. Even shapes drawn in the Perspective view are constrained to a plane such as the Home Grid.

You usually produce 2D shapes in a drawing package like Adobe Illustrator or CorelDRAW. Max supports importing line drawings using the AI format.

CROSS-REF 

See Chapter 3, "Working with Files and XRefs," to learn about importing AI files.

Whereas newly created or imported shapes are 2D and are confined to a single plane, splines can exist in 3D space. The Helix spline, for example, exists in 3D, having height as well as width values. Animation paths in particular typically move into 3D space.

Working with shape primitives

The shape primitive buttons are displayed in the Object Type rollout of the Create panel when either the Create image from book Shapes or the Create image from book Extended Shapes menu is selected. The Shapes category include many basic shapes, including Line, Circle, Arc, NGon (a polygon where you can set the number of sides), Text, Section, Rectangle, Ellipse, Donut, Star, and Helix, as shown in Figure 14.1. The Extended Shapes category includes several shapes that are useful to architects, including WRectangle, Channel, Angle, Tee, and Wide Flange, as shown in Figure 14.2. Clicking any of these shape buttons lets you create the shape by dragging in one of the viewports. After a shape is created, several new rollouts appear.

image from book
Figure 14.1: The shape primitives in all their 2D glory: Line, Circle, Arc, NGon, Text, Section, Rectangle, Ellipse, Donut, Star, and Helix

image from book
Figure 14.2: The extended shape primitives: WRectangle, Channel, Angle, Tee, and Wide Flange

Above the Shape buttons are two check boxes: AutoGrid and Start New Shape. AutoGrid creates a temporary grid, which you can use to align the shape with the surface of the nearest object under the mouse at the time of creation. This feature is helpful for starting a new spline on the surface of an object.

CROSS-REF 

For more details on AutoGrid, see Chapter 8, "Transforming Objects-Translate, Rotate, and Scale."

The Start New Shape option creates a new object with every new shape drawn in a viewport. Leaving this option unchecked lets you create compound shapes, which consist of several shapes used to create one object. Because compound shapes consist of several shapes, you cannot edit them using the Parameters rollout. For example, if you want to write your name using splines, keep the Start New Shape option unselected to make all the letters part of the same object.

Just as with the Geometric primitives, every shape that is created is given a name and a color. You can change either of these in the Name and Color rollout.

Most of the shape primitives have several common rollouts: Rendering, Interpolation, Creation Method, Keyboard Entry, and Parameters, as shown in Figure 14.3.I cover these rollouts initially and then present the individual shape primitives.

image from book
Figure 14.3: These rollouts are common for most of the shape primitives

Rendering rollout

The Rendering rollout includes options for making a spline a renderable object. Making a spline a renderable object converts the spline into a 3D object that is visible when you render the scene. For renderable objects, you can choose to make the spline Radial or Rectangular. For the Radial option, you can specify a Thickness, the number of Sides, and the Angle values; for the Rectangular option, you can specify Length, Width, Angle, and Aspect values.

The Radial Thickness is the diameter of the renderable spline. The number of Sides sets the number of sides that make up the cross section of the renderable spline. The lowest value that is possible is 3, which creates a triangle cross section. The Length and Width values set the size along the Y-axis and the X-axis, respectively, of the rectangular sides. The Angle value determines where the corners of the cross section sides start, so you can set a three-sided spline to have a corner or an edge pointing upward. The Aspect value sets the ratio of the Length per Width. If the Lock icon to the right of the Aspect value is enabled, then the aspect ratio is locked, and changing one value affects the other.

Note 

By default, a renderable spline has a 12-sided circle as its cross section.

You can choose different rendering values for the viewport and for the renderer using the Viewport and Renderer options above the Radial option. Each of these settings can be enabled or disabled using the Enable in Renderer and Enable in Viewport options at the top of the Rendering rollout. Renderable splines appear as normal splines in the viewport unless the Enable in Viewport option is selected. The Use Viewport Settings option gives the option of setting the spline render properties different in the viewport and the renderer.

The Auto Smooth option and Threshold value offer a way to smooth edges on the renderable spline. If the angle between two adjacent polygons is less than the Threshold value, then the edge between them is smoothed. If it is greater than the Threshold value, then the hard edge is preserved.

The Generate Mapping Coordinates option automatically generates mapping coordinates that are used to mark where a material map is placed, and the Real-World Map Size option allows real-world scaling to be used when mapping a texture onto the renderable spline.

CROSS-REF 

To learn more about mapping coordinates and real-world scaling, see Chapter 23, "Adding Material Details with Maps."

Interpolation rollout

In the Interpolation rollout, you can define the number of interpolation steps or segments that make up the shape. The Steps value determines how many segments to include between vertices. For example, a circle shape with a Steps value of 0 has only four segments and looks like a diamond. Increasing the Steps value to 1 makes a circle out of eight segments. For shapes composed of straight lines (like the Rectangle and simple NGons), the Steps value is set to 0, but for a shape with many sides (like a Circle or Ellipse), the Steps value can have a big effect. Larger step values result in smoother curves.

The Adaptive option automatically sets the number of steps to produce a smooth curve. When the Adaptive option is enabled, the Steps and Optimize options become disabled. The Optimize option attempts to reduce the number of steps to produce a simpler spline by eliminating all the extra segments associated with the shape.

Note 

The Section and Helix shape primitives have no Interpolation rollout

Figure 14.4 shows the number 5 drawn with the Line primitive in the Front viewport. The line has been made renderable so that you can see the cross sections. The images from left to right show the line with Steps values of 0, 1, and 3. The fourth image has the Optimize option enabled. Notice that it uses only one segment for the straight edges. The fifth image has the Adaptive option enabled.

image from book
Figure 14.4: Using the Interpolation rollout, you can control the number of segments that make up a line

Creation Method and Keyboard Entry rollouts

Most shape primitives also include Creation Method and Keyboard Entry rollouts (Text, Section, and Star are the exceptions). The Creation Method rollout offers options for specifying different ways to create the spline by dragging in a viewport, such as from edge to edge or from the center out. Table 14.1 lists the various creation method options for each of the shapes and each of the extended shapes.

Table 14.1: Shape Primitive Creation Methods
Open table as spreadsheet

Primitive Object

Number of Viewport Clicks to Create

Default Creation Method

Other Creation Method

image from book

2 to Infinite

Corner Initial, Bézier Drag

Smooth, Initial, Corner, or Smooth Drag

image from book

1

Center

Edge

image from book

2

End-End-Middle

Center-End-End

image from book

1

Center

Edge

image from book

1

none

none

image from book

1

none

none

image from book

1

Edge

Center

image from book

1

Edge

Center

image from book

2

Center

Edge

image from book

2

none

none

image from book

3

Center

Edge

WRectangle

2

Edge

Center

Channel

2

Edge

Center

Angle

2

Edge

Center

Tee

2

Edge

Center

Wide Flange

2

Edge

Center

Some shape primitives such as Star, Text, and Section don't have any creation methods because Max offers only a single way to create these shapes.

The Keyboard Entry rollout offers a way to enter exact position and dimension values. After you enter the values, click the Create button to create the spline or shape in the active viewport. The settings are different for each shape.

The Parameters rollout includes such basic settings for the primitive as Radius, Length, and Width. You can alter these settings immediately after an object is created. However, after you deselect an object, the Parameters rollout moves to the Modify panel, and you must do any alterations to the shape there.

Line

The Line primitive includes several creation method settings, enabling you to create hard, sharp corners or smooth corners. You can set the Initial Type option to either Corner or Smooth to create a sharp or smooth corner for the first point created.

After clicking where the initial point is located, you can add points by clicking in the viewport. Dragging while creating a new point can make a point a Corner, Smooth, or Bézier based on the Drag Type option selected in the Creation Method rollout. The curvature created by the Smooth option is determined by the distance between adjacent vertices, whereas you can control the curvature created by the Bézier option by dragging with the mouse a desired distance after the point is created. Bézier corners have control handles associated with them, enabling you to change their curvature.

Tip 

Holding down the Shift key while clicking creates points that are vertically or horizontally at a right angle with the previous point. Holding down the Ctrl key snaps new points at an angle from the last segment, as determined by the Angle Snap setting.

After creating all the points, you exit line mode by clicking the right mouse button. If the last point is on top of the first point, then a dialog box asks whether you want to close the spline. Click Yes to create a closed spline or No to continue adding points. Even after creating a closed spline, you can add more points to the current selection to create a compound shape if the Start New Shape option isn't selected. If the first and last points don't correspond, then an open spline is created.

Figure 14.5 shows several splines created using the various creation method settings. The left spline was created with all the options set to Corner, and the second spline with all the options set to Smooth. The third spline uses the Corner Initial type and shows where dragging has smoothed many of the points. The last spline was created using the Bézier option.

image from book
Figure 14.5: The Line shape can create various combinations of shapes with smooth and sharp corners

In the Keyboard Entry rollout, you can add points by entering their X, Y, and Z dimensions and clicking the Add Point button. You can close the spline at any time by clicking the Close button or keep it open by clicking the Finish button.

Rectangle

The Rectangle shape produces simple rectangles. In the Parameters rollout, you can specify the Length and Width and also a Corner Radius. Holding down the Ctrl key while dragging creates a perfect square shape.

Circle

The Circle button creates-you guessed it-circles. The only adjustable parameter in the Parameters rollout is the Radius. All other rollouts are the same, as explained earlier. Circles created with the Circle button have only four vertices.

Ellipse

Ellipses are simple variations of the Circle shape. You define them by Length and Width values. Holding down the Ctrl key while dragging creates a perfect circle (or you can use the Circle shape).

Arc

The Arc primitive has two creation methods. Use the End-End-Middle method to create an arc shape by clicking and dragging to specify the two end points and then dragging to complete the shape. Use the Center-End-End method to create an arc shape by clicking and dragging from the center to one of the end points and then dragging the arc length to the second end point.

Other parameters include the Radius and the From and To settings, where you can enter the value in degrees for the start and end of the arc. The Pie Slice option connects the end points of the arc to its center to create a pie-sliced shape, as shown in Figure 14.6. The Reverse option lets you reverse the arc's direction.

image from book
Figure 14.6: Enabling the Pie Slice option connects the arc ends with the center of the circle

Donut

As another variation of the Circle shape, the Donut shape consists of two concentric circles; you can create it by dragging once to specify the outer circle and again to specify the inner circle. The parameters for this object are simply two radii.

NGon

The NGon shape lets you create regular polygons by specifying the Number of Sides and the Corner Radius. You can also specify whether the NGon is Inscribed or Circumscribed, as shown in Figure 14.7. Inscribed polygons are positioned within a circle that touches all the outer polygon's vertices. Circumscribed polygons are positioned outside of a circle that touches the midpoint of each polygon edge. The Circular option changes the polygon to a circle that inscribes the polygon.

image from book
Figure 14.7: An inscribed pentagon and a circumscribed pentagon

Star

The Star shape also includes two radii values-the larger Radius value defines the distance of the outer points of the Star shape from its center, and the smaller Radius value is the distance from the center of the star to the inner points. The Point setting indicates the number of points. This value can range from 3 to 100. The Distortion value causes the inner points to rotate relative to the outer points and can be used to create some interesting new star types. The Fillet Radius 1 and Fillet Radius 2 values adjust the Fillet for the inner and outer points. Figure 14.8 shows a sampling of what is possible with the Star shapes.

image from book
Figure 14.8: The Star primitive can be changed to create some amazing shapes

Text

You can use the Text primitive to add outlined text to the scene. In the Parameters rollout, you can specify a Font by choosing one from the drop-down list at the top of the Parameters rollout. Under the Font dropdown list are six icons, shown in Table 14.2. The left two icons are for the Italic and Underline styles. Selecting either of these styles applies the style to all the text. The right four icons are for aligning the text to the left, centered, right, or justified.

Table 14.2: Text Font Attributes
Open table as spreadsheet

Icon

Description

image from book

Italic

image from book

Underline

image from book

Left

image from book

Centered

image from book

Right

image from book

Justified

Note 

The list of available fonts includes only the Windows TrueType fonts and Type 1 PostScript fonts installed on your system and any extra fonts located in the font path listed in the Configure Paths dialog box. You need to restart Max before the fonts in the font path are recognized.

The size of the text is determined by the Size value. The Kerning (which is the space between adjacent characters) and Leading (which is the space between adjacent lines of text) values can actually be negative. Setting the Kerning value to a large negative number actually displays the text backwards. Figure 14.9 shows an example of some text and an example of kerning values in the Max interface.

image from book
Figure 14.9: The Text shape lets you control the space between letters, known as kerning.

You can type the text to be created in the text area. You can cut, copy, and paste text into this text area from an external application if you right-click on the text area. After setting the parameters and typing the text, the text appears as soon as you click in one of the viewports. The Text is updated automatically when any of the parameters (including the text) are changed. To turn off automatic updating, select the Manual Update toggle. You can then update with the Update button.

To enter special characters into the text area, hold down the Alt key while typing the character code using the numeric keypad. For example, type 0188 in the numeric keypad with the Alt key held down and the 1/4 symbol appears. If you open the Character Map application, you can see a complete list of special characters and the number combinations that make them appear. The Character Map application, shown in Figure 14.10, can be opened in Windows by selecting Start image from book All Programs image from book Accessories image from book System Tools image from book Character Map.

image from book
Figure 14.10: The Character Map application shows all the special characters that are available

Helix

A Helix is like a spring coil shape, and it is the one shape of all the Shape primitives that exists in 3D. Helix parameters include two radii for specifying the inner and outer radius. These two values can be equal to create a coil or unequal to create a spiral. Parameters also exist for the Height and number of Turns. The Bias parameter causes the Helix turns to be gathered all together at the top or bottom of the shape. The CW and CCW options let you specify whether the Helix turns clockwise or counterclockwise.

Figure 14.11 shows a sampling of Helix shapes: The first Helix has equal radii values, the second one has a smaller second radius, the third Helix spirals to a second radius value of 0, and the last two Helix objects have Bias values of 0.8 and 0.8.

image from book
Figure 14.11: The Helix shape can be straight or spiral shaped

Section

Section stands for cross section. The Section shape is a cross section of the edges of any 3D object through which the Section's cutting plane passes. The process consists of dragging in the viewport to create a cross-sectioning plane. You can then move, rotate, or scale the cross-sectioning plane to obtain the desired cross section. In the Section Parameters rollout is a Create Shape button. Clicking this button opens a dialog box where you can name the new shape. You can use one Section object to create multiple shapes.

Note 

You can make sections only from intersecting a 3D object. If the cross-sectioning plane doesn't intersect the 3D object, then it won't create a shape. You cannot use the Section primitive on shapes, even if it is a renderable spline.

The Parameters rollout includes settings for updating the Section shape. You can update it when the Section plane moves, when the Section is selected, or Manually (using the Update Section button). You can also set the Section Extents to Infinite, Section Boundary, or Off. The Infinite setting creates the cross-section spline as if the cross-sectioning plane were of infinite size, whereas the Section Boundary limits the plane's extents to the boundaries of the visible plane. The color swatch determines the color of the intersecting shape.

To give you an idea of what the Section shape can produce, Figure 14.12 shows the shapes resulting from sectioning two Cone objects, including a circle, an ellipse, a parabola, and a hyperbole. The shapes have been moved to the sides to be more visible.

image from book
Figure 14.12: You can use the Section shape primitive to create the conic sections (circle, ellipse, parabola, hyperbola) from a set of 3D cones

Tutorial: Drawing a company logo

One of the early uses for 3D graphics was to animate corporate logos, and although Max can still do this without any problems, it now has capabilities far beyond those available in the early days. The Shape tools can even be used to design the logo. In this example, we design and create a simple logo using the Shape tools for the fictitious company named Expeditions South.

To use the Shape tools to design and create a company logo, follow these steps:

  1. Create a four-pointed star by clicking the Star button and dragging in the Top view to create a shape. Change the parameters for this star as follows: Radius1 = 60, Radius2 = 20, and Points = 4.

  2. Select and move the star shape to the left side of the viewport.

  3. Now click the Text button, and change the font to Impact and the Size to 50. In the Text area, type Expeditions South and include a line return and several spaces between the two words so they are offset. Click in the Top viewport to place the text.

  4. Use the Select and Move button (W) to reposition the text next to the Star shape.

  5. Click the Line button, and create several short highlighting lines around the bottom point of the star.

The finished logo is now ready to extrude and animate. Figure 14.13 shows the results.

image from book
Figure 14.13: A company logo created entirely in Max using shapes

Tutorial: Viewing the interior of a heart

As an example of the Section primitive, let's explore a section of a Heart model. The model was created by Viewpoint Datalabs and is very realistic-so realistic, in fact, that it could be used to teach medical students the inner workings of the heart.

To create a spline from the cross section of the heart, follow these steps:

  1. Open the image from book Heart section.max file from the Chap 14 directory on the DVD. This file includes a physical model of a heart created by Viewpoint Datalabs.

  2. Select Create image from book Shapes image from book Section, and drag a plane in the Front viewport that is large enough to cover the heart.

    This plane is your cross-sectioning plane.

  3. Select the Select and Rotate button on the main toolbar (or press the E key), and rotate the cross-sectioning plane to cross the heart at the desired angle.

  4. In the Parameters rollout of the Modify panel, click the Create Shape button and give the new shape the name Heart Section.

  5. From the Select by Name dialog box (opened with the H key), select the section by name, separate it from the model, and reposition it to be visible.

Figure 14.14 shows the resulting model and section.

image from book
Figure 14.14: You can use the Section shape to view the interior area of the heart




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net