Recipe 5.2. Creating 3D ObjectsProblemYou want to create 3D objects for use in Flash. SolutionUse Swift 3D's multiple editors for accomplishing different modeling needs. DiscussionFour of the five editors in Swift 3D are used for modeling of one kind or another. Each has its own specific strengths and weaknesses, and learning which editor is ideal for a specific task can greatly increase your productivity and level of success. Some planning and forethought regarding how an object is constructed will help you determine which editor is best for the job at hand. Often a combination of editors is required to achieve exactly what you want. To illustrate this point, the following example creates a chessboard and three sample pieces using the different modeling tools at your disposal in Swift 3D. Setting up a new documentTo begin, we need to first set up a new Swift 3D document. Create a new file and set the viewport dimensions, found under Layout in the properties panel, to 800 x 600. Select Environment in the properties panel and double click the Background Color preview to enter edit mode. Set the color to dark gray (R: 128, G: 128, U: 128), so that there will be contrast when working with the black and white elements of the chess game. Finally, assign the right viewport to the Top camera and set the secondary viewport to Front. Building the chessboardA chessboard is made up of 64 squares of alternating color; in this case, black and white. Though a relatively simple object, even this could be modeled in a variety of ways. Thinking over it quickly, here are a few options that you could try. They will all give you basically the same results:
These are all feasible solutions, yet there is a much simpler answer. By taking advantage of the segmentation settings of plane primitive and surface groups available in the Advanced Modeler, we can quickly create a checkerboard that is uniform in size and accurate in placement. Enter the Advanced Modeler and click on the Plane primitive button. Under Segmentation in the plane properties, set both the width and height to 8. Working in the Perspective view, click and drag in the viewport to add the primitive plane. The Perspective view is used because primitives added to this viewport automatically maintain their proportions and are placed at the viewport's origin (X:0,Y:0,Z:0).
What we have now looks slightly more complex than a chessboard (see Figure 5-9). The reason for this is that polygons in Swift 3D are always triangular. Each segment is thus composed of two polygons in order to make a square. Drag-and-drop the "ER VectorFlat Black" material, located under the Flat tab in the preset materials gallery, to the plane. This step will not only take care of the material for the black squares, but will also make the wireframe more easily visible for selection purposes. Figure 5-9. Primitive plane in the Advanced Modeler with height and width segmentation of 8 appliedBefore going any further, enter Edit Mesh mode to make the necessary tools available. If necessary, select the Plane primitive button and click the Edit Mesh button located on the right side of the top toolbar. When active, the button will be red and any object selected will turn orange. Switch to working in the Front viewport and deselect the plane by clicking on an empty area in the viewport. Press the F key to enter Face Selection Mode. Starting at the top-left corner of the plane, select every other segment (two polygons per square). When finished, it should look like a black and orange checkerboard in the viewport (see Figure 5-10). With the selection still active, go to Surface Groups in the properties panel (see Figure 5-11) and click the Group Selection button, which will create a new surface group comprised of what will be our white squares. To finish, drag-and-drop the "ER VectorFlat White" material to the material preview located below the lists of available surfaces. The squares of the chessboard are now finished, and you can return to the Scene Editor. Figure 5-10. Selecting individual polygon faces in the Advanced Modeler
The final step will create a slight border around the board and give it depth. In the Scene Editor, add a Box primitive to the viewport. By default, it will be placed directly in the center of the checkerboard, which is ideal for our needs. Click the Scaling Mode icon in the top row of buttons and, while working in the Top viewport, enlarge the box until it is slightly larger than the chessboard. Manual scaling is performed by selecting an object and dragging the cursor to the left, right, up, or down while Scaling Mode is active. Select the box and set its height, under Sizing in the Properties toolbar, to 0.005. Working in the Front viewport, position the box using the cursor and/or the keyboard arrow keys so that it rests just below the checkerboard, with little or no space between the two. When in place, apply the "ER VectorFlat Black" material to finish the chessboard (see Figure 5-12). Select all with Ctrl-A (Win)/Command-A (Mac) and group with Alt-G (Win)/Command-G (Mac). rename the new group "board" in the properties panel, so that it is easy to identify in the Hierarchy menu, and save the file. Figure 5-11. Creating surface groups in the Properties toolbarFigure 5-12. Example of finished chessboard model
Creating the chess piecesNow that we have the playing field, we need the players. For this exercise, we will be modeling only a pawn and knight; however, after doing so you should have the experience necessary for completing the remaining pieces if you wish to do so. Modeling the pieces will make use of all four editors. As you should recall, lathe objects are created from vector paths, so the first things we need are profile drawings of our pieces. I have chosen to draw the profiles in Adobe Illustrator and import them into Swift 3D (the original AI document may be downloaded from ). The reason I use an external program to do this is that though the Lathe and Extrusion Editors both have basic drawing tools, they simply are not of the same capability level of those found in a dedicated illustration program. Figure 5-13 shows the paths as they appear within Illustrator. Black items will ultimately be lathed objects, and the gray objects will be extrusions. Figure 5-13. Vector path chess piece profiles drawn in Adobe Illustrator for importModeling the pawnCreate a new document as in the chessboard exercise. It is generally good practice in projects like this to model each major element in its own document and later combine them into a single file. This process keeps the working environment from slowing down, which can occur when a large number of model meshes are present. Import the paths by going to File Import…and navigating to the local copy of the AI file. After being interpreted, the paths will be brought into the Scene Editor as extruded objects. While the group is still selected, Ungroup with Alt-U (Win)/Command-U (Mac) so that we may work with the paths individually. Select the pieces of the knight and group them (Alt-G/Command-G). In the Properties Toolbar, rename the group "Knight" and check the Hide checkbox. When finished, you should see only the pawn extrusion on the stage, with the Knight grouping visible in the Hierarchy Menu. Select the pawn and enter the Extrusion Editor. Double-click the outline to select the entire path and copy it. Delete the path, enter the Lathe Editor, and paste the path there. This rather roundabout method is necessary because it is not possible to take an extruded path directly into the Lathe Editor or to import an external file. If you cannot view the entire path, use the Zoom tool and zoom out until you can. Click and drag a bounding box around the entire path to select it. Using the keyboard arrow keys, move the path to the right until the left edge is aligned with the green vertical line (y-axis). In the Point Properties panel, when the x-coordinate under Properties is at 0, the path is perfectly aligned (see Figure 5-14). Returning to the Scene Editor, you will find that the pawn model is complete (see Figure 5-15). Apply a white or black glossy material, rename the lathe object "Pawn," and hide it.
Modeling the knightWith the pawn geometry now hidden, select "Knight" in the Hierarchy menu and uncheck the Hide box. Lathe the base of the knight just as with the pawn. Once completed, position it so that the top of the base is just touching the extruded body, as shown in Figure 5-17. The next step is to set the depth and bevel type for each of the extruded objects. Assign all objects an Outer Round bevel type, with a depth of 0.030. Bevels in Swift 3D are an additive process, which results in an object's geometry becoming thicker when bevels are applied. Because of this, you may need to slightly adjust the pieces of the knight so that they are symmetrical and remain aligned. Use Figure 5-18 as a reference point for setting the extrusion depth, found under Sizing. Figure 5-14. Vector path for the pawn inside of the Lathe EditorWith the sizing and bevel options set, it now seems that the base might be a little too narrow, giving the piece an unbalanced appearance. To remedy this, select the base and enter the Lathe Editor once more. Select all the points that do not rest on the center axis and move them to the right. This step will increase the diameter of the base without altering the height. The exact amount is up to you, but it should not extend past the outer edges of the knight's body. Figure 5-15. Lathed pawn modelAfter applying the material of your choice, the knight model should look similar to Figure 5-19. Figure 5-16. Pawn model without radial smoothing and reduced radial segmentation |
Tripod >> 3pod Tips & Learning and manuals for educations