Creating the Pool Table and the Balls
You will create a simple pool table as a collision surface for the pool balls. To create the table, follow these steps:
- Create a polygonal plane for the surface of the table. Scale it to 10 along its height and length.
- To create the pocket holes, you'll make two simple holes in opposite corners. The easiest way is to duplicate the tabletop plane and offset it slightly in both directions, as shown in Figure 12.3. This will create a pair of square holes in the corners for the ball to drop through. For this exercise, it will do perfectly well.
- Figure 12.3 Duplicate the table-top plane and offset it slightly in both directions.
3. Create a polygonal cube, and scale it to fit one edge of the plane to create a rail. Duplicate the cube three times, and then move and rotate the pieces to create the rails around the table as shown in Figure 12.4.
- Figure 12.4 A simple pool table
Figure 12.5 Scaling and placing the three spheres
4. Create three poly spheres, and then scale and place them as shown. It is important to place them slightly above the pool table surface. Although it's not imperative to have the exact location shown in Figure 12.5, it's a good idea to get rather close to the layout shown.
Figure 12.5 Scaling and placing the three spheres
Figure 12.6 The pool balls in texture view
5. Shade your pool balls to make each one different. The figures in this exercise show a solid white ball, a striped yellow ball, and a black eight ball, as shown in Figure 12.6.
Figure 12.6 The pool balls in texture view
The spheres are placed a bit over the table surface so that their geometries' surfaces are not accidentally crossing each other, an effect known as interpenetrating. When surfaces interpenetrate, the dynamics that result will usually be as welcome as sand in your eye. Starting all colliding rigid bodies a little bit away from each other should guarantee that their surfaces do not interpenetrate. Using the simple pool table that we've set up will make the dynamics calculations quick and easy.
Use the file Table_v1.mb in the scenes folder of the Pool_Table project on the CD as a reference or to catch up to this point.
Post a comment