Tuesday, January 4, 2011

Making A Bookshelf With Boole

Let’s say you want to make a bookshelf. One way to accomplish this would be to use Cinema 4D’s Boole tool.

Boole:
What Boole does, is it cuts out the shape of one polygon, on to another polygon, kind of like a customizable cookie-cutter.

In order to use this for a bookshelf, lets take a cube primitive and resize it to roughly the shape of a bookshelf. Now copy and paste it, then scale the new primitive down a bit, and pull it so that it’s partially sticking out of the old bigger rectangle.  Adjust the new rectangle so that it leaves a narrow margin around it where the bigger one is. 

Once you have that in place, go to the Nurbs menu and select ‘Boole’. Like all the other Nurbs, it will drop a ‘Boole’ object on to your object manager.  To use it, FIRST parent the object that’ll be making the hole, on to the Boole, THEN parent the object that’s getting the hole. So in this case, take the newer/smaller rectangle and parent it to the Boole, then parent the larger rectangle to the Boole, and you should automatically notice that your larger rectangle just got a chunk taken out of it in the form of your smaller rectangle. From there, you could just use flattened rectangle primitives for shelves.

Now what if you want to create a die, but don’t want to have to go through the trouble of Booling each semi-spherical indent onto your cube individually?   For a situation like that, you could just select all the spheres you plan to use as holes and group them (Option+G). Then all you’d have to do would be to parent that group as the first object under the Boole, followed by your cube, and you should have a nicely Boole'd die.

P.S.: Whenever you’re finished modeling with any of these Nurbs, remember to always right click on the Nurbs in your object manager, and select ‘Current State To Object’. This will turn your Nurb group into a single simplified polygon; it will be important to remember this for keeping your geometry complexity low to improve the performance of your game.

More Nurbs

If you were to want a smoother, pipe-like type of arm rests or legs for your chair, Cinema 4D provides us with an easy way to do that as well, through Sweep Nurbs.

Sweep Nurbs:
This nurb takes the shape of one spline, and traces out the outline of another spline with it. If you were to draw out the shape of a coat hanger with a spline for example, you could then drop a small spline circle onto your scene, representing the size/width of the coat hanger’s wire, and then drop a Sweep Nurb on to your object manager. To use the Sweep Nurb, you must FIRST parent the circle spline to the nurb, and THEN parent the coat hanger spline to the nurb; once that’s done, make sure your object manager lists the Sweep Nurb first, then the circle, and finally your other spline, because if it’s not in that order, your geometry won’t work as you want it to.  You should then have a 3D coat hanger ready to go.  If you wish to adjust the thickness of the wire, simply scale/transform the circle spline to your liking.

You may also apply this technique if you wanted to make your coat hanger outline be blocky, or shaped like a star, using the corresponding spline shapes instead of the circle.

Loft Nurbs:
Another type of useful Nurbs is the Loft Nurb. A loft Nurb essentially allows you to combine multiple spline shapes together to form a 3D object.  Let's say you had no idea Cinema 4D had a built in cylinder primitive for example, and you wanted a cylinder.  With the Loft Nurbs, all you would have to do is drop 2 circle splines, move one of them is straight up above the other (to whatever you want the height of your cylinder to be), and then parent them both to the Loft Nurb.  Just keep in mind that you can set as many different spline shapes, at as many different distances as you want, with this Nurb, so take advantage of it to create something interesting!

Let's Make A Chair!

Let’s try making a chair using what we’ve learned so far, and introduce a couple new techniques along the way.

Step 1: Using 4 elongated cube primitives, form the rectangular frame of a chair seat.

Step 2: Select one of the shorter sides of the frame, copy and paste it, and move it in towards the hollow area of the frame.

Step 3:
On the left-hand side panel, there is a button near the top of it with an icon showing two spheres; this button enables Component Mode, which makes primitives more editable (allowing us to sculpt them better). Select the newly copied section of the chair frame, and click this button.

Step 4:
Further down on the same left-hand panel, you’ll notice an icon with an orange square above a small 2x2 black grid; this is the button to enable Face Mode. Face Mode allows you to select and manipulate the faces of an object.  Click on the Face Mode button, and on the newest object, select the face looking towards the other short side of the chair frame.

Step 5:
Once selected, use the move tool to pull the face along the X/Z axis until the hollow part of the frame is completely covered. Your chair seat should now be composed of a rough square at the center, enclosed by 4 rectangular primitives.

Step 6:
Next we’re going to create a dip/indentation in the chair seat to make it look a bit more comfortable.  For this, switch on Face Mode and select the top face of the center rectangle, then right click on your object and select the Knife Tool from the menu.  The Knife tool allows you to cut new segments on your models however you wish.  With the Knife tool selected, go ahead and cut out 2 straight diagonal segments across the face of that rectangle, connecting the 4 corners of it together such that you’re left with a nice large ‘X’ on that face.

Step 7:
Notice where your new segments intersect, Cinema 4D has automatically created a ‘point’ there for our convenience. To work with points, go once again to your left-hand side bar and one icon above the Face Mode button is the Points Mode button, designated by 3 orange dots on a small black grid. Points Mode, like Face Mode, allows you to select and modify Points.  Now turn on Points Mode, and select that newly created point at the center of your object.

Step 8:
Using the Move Tool, push that selected point down along the Y-axis, until you’re just about touching the bottom face; this will result in a nice dip for your chair seat.

[In addition to the Face and Points modes we just learned, there is also an Edge Mode (right in between the icons for the other two) that you could also use, and like the others, it is useful for moving/manipulating the edges of your objects.]

Step 9: Create the legs of the chair using Lathe Nurbs.

Lathe Nurbs:
To create the legs, we are going to use Lathe Nurbs, which essentially sweep a spline around 360 degrees to form a 3D object.

To do this, lets first go to either our ‘Front’ or ‘Right’ alternate view, and move your chair seat so that it’s edge is aligned next to the Y-axis, then adjust the scene so that you have sufficient room to work with under your seat. Now grab a spline tool such as the Bezier or Akima tools; these tools allow you to draw smooth, rounded splines, necessary to make our chair legs look nice.  Now start drawing from the bottom edge of your seat, up against the Y-axis, and draw only the RIGHT HALF of your chair leg; that is, if you were to picture your ideal chair leg cut vertically right down the middle, how would the right half look like? Use the Y-axis to guide you so you don’t make your half-leg too skinny;  also, ensure that your leg starts and ends touching the Y-axis, cause you don’t want your leg to be hollow!

If you wish to make any adjustments to your spline after you’ve drawn it, you could always turn on Points Mode, and use the Move Tool to select and move/adjust any points you made.

Once your spline is drawn, go up to the Nurbs menu, and select the ‘Lathe Nurbs’. Just like the Extrude Nurbs, the Lathe Nurbs will appear in your Object Manager, and then all you have to do is drag the spline you just drew over the Lathe Nurbs, and parent them together. Now if you go to your perspective view, you should see that you have a good solid 3D chair leg.

Step 10: Copy and paste your leg 3 times so you have 4 legs, and go to your top view so you can align them properly under your chair seat.



Step 11: Now to make the backrest of the chair, you can copy/paste one of the long rectangles from the frame of the seat, and rotate it so that it’s vertical. Use your alternate views to position it on a corner where your backrest is going to be.  

Step 12: Next, make your rectangle editable by enabling Component Mode, then switch on Face Mode and select the top face of the rectangle. Use the Move tool to pull this face upwards, making the rectangle taller, and pull it a bit back, so that your rectangle is slanted like a reclined backrest. Copy and paste this inclined rectangle a couple times, and place the copies along the back edge of the seat to continue forming the backrest. 
Step 13: Finally, just create a simple skinny rectangle that goes along the tops of the inclined rectangles to form the overall frame of the backrest, and you’ll be done.

[Alternatively, you could make the backrest spokes out of Lathe Nurbs, like the legs.  Feel free to customize the chair however you wish.]

Intro To Nurbs

Creating 3D Text with Extrude Nurbs:
Extrude Nurbs add depth to a 2d shape, therefore, in order to use an Extrude Nurb, you must first create a 2D shape using what are called ‘splines’. A spline is essentially a 2D, volume-less outline of some kind, and Cinema 4D provides you with a whole slew of tools to create them.
Right next to the Primitives icon, there’s an icon with a squiggly blue line; this is the free-form spline tool (much like the pencil tool in photoshop), and long pressing it reveals the spline-tool selection menu, showing you all the different tools available for creating splines. One of these tools, is the Text tool.

Go ahead and select the Text tool, then select the giant spline object that appears in your scene and says “Text”.  In the Attributes menu, under the ‘Object’ tab, change the text in the ‘Text’ field to whatever you want your 3D text to say. 

Next, go to the first green icon on the toolbar, right next to the spline tool icon; click and hold to reveal the menu containing all the Nurbs at your disposal. From here, select the ‘Extrude Nurb’;  The Nurb should now appear in your object manager.  In order to use the nurb, you must parent your spline to it, so drag and drop your text spline object onto the extrude nurb in your Object Manager, and voila, your text is now 3D! The same would work for any other type of spline outline.

More With Primitives (Redbot Project)

Today we’ll be making a simple robot from a reference image, using primitives. Often times it is hard to figure out what the scale/sizes of our shapes should be when creating a model, even when we have a reference image to work off of.  To make sure we avoid this difficulty with our robot, we will be learning a cool technique to help us ensure we get all our proportions correct.

Step 1: Create a new material, and add our front-view redbot source image as a texture in the ‘color’ tab.
Step 2: Drop a plane primitive on to your scene; we will be using this to place our redbot image on the scene.
Step 3: Select the plane, then go to your Attributes Manager (lower right hand section), and look in the ‘Object’ tab. Here we will reduce the number of segments our plane has to make sure we avoid having unnecessarily heavy objects on our scene (maintaining a low polygon count is crucial to optimal game performance).  For both the ‘Height Segments’ and ‘Width Segments’ properties, set their value to 1.
Step 4: Place your redbot texture on the plane, and rotate it so that it is vertical and facing the right direction.
Step 5: At this point, the redbot texture you placed on the plane is probably looking a little stretched out, so resize your plane until the image looks as it should.
Step 6: Copy and Paste the redbot plane, and rotate the new one horizontally by 90 degrees.
Step 7: Create another material, this time with the side-view of the redbot as the texture, and put it on the newly rotated plane (also make sure it’s facing the right direction). Now you should be able to get a basic idea of the scale your robot model will be.
Step 8: Now you can start placing primitives, and aligning+resizing them to fit the outlines of your redbot planes. 










Taking Advantage Of Alternate Views:
Alternate views would really make the task of resizing our primitives to the right scale rather easy, if only they showed our redbot textures… Oh wait, they can!
From any of your alternate views, select the planes containing your reference redbot images, then go to your view-window menu-bar, and select Display > Constant Shading. You should now be able to see your redbot textures from inside your alternate views.
Now to make it even easier to accurately size your primitives, whenever you drop a primitive onto the scene, select it, and make sure to have the “Display > X-Ray” option on, from the same menu you enabled the Constant Shading earlier. ‘X-Ray’ makes whichever object you’re actively working on become translucent, making it incredibly easy to then trace out a shape with it from a reference image.

Fillet:
Although the robot is fairly blocky, most of its shapes still have rounded edges. Luckily, Cinema 4D provides us with a simple way to round the edges of primitives using the ‘Fillet’ property. To enable it, select the primitive you wish to round, and go to your Attributes Manager, then under the ‘Object’ tab, check the box labeled ‘Fillet’.  This will automatically give your shape rounded edges; you can adjust the roundness of the edges by messing with the values in the ‘Fillet Radius’ and ‘Fillet Subdivisions’ properties.






Parenting:
For some structures that contain several parts, such as the arms of our robot, it would makes sense if we could group all the parts/objects pertaining to that structure together, or better yet, organize them in a hierarchical fashion (i.e. where the fingers belong to the hand, and the hand belongs to the forearm, etc.).

Well, again Cinema 4D makes our lives as easy as possible, and allows us to ‘parent’ objects together, by simply dragging and droping objects to the parts they belong to in the object manager (section in the upper-right). Therefore, you can just drag each one of your finger objects to a flattened cylinder representing the palm, and have yourself a nicely structured robot hand. The benefit to structuring your models this way, is that it provides you with an quick way to make easily adjustable joints. A hand parented to a forearm for example, may still be rotated independently of the forearm, yet if you rotate the forearm, the hand goes with it.

Cinema 4D Basics

Cinema 4D will be the tool we use to create our 3D models.

Coordinate Plane:
The coordinate plane is the big rectangular area in the center of your Cinema 4D window representing the 3D space in which we will be making our models. As we will be working in 3 dimensions, there are 3 axes to the plane: X, Y, and Z.
X (red) =  Horizontal
Y (green) = Vertical
Z (blue) = Horizontal, but perpendicular to X; i.e. if you were facing forward and the X axis were going along the width of your shoulders, the Z axis would be coming straight out of your chest.

Toolbar:
The toolbar is the strip along the top with the big icons, right below the menu bar.
First few Icons/Tools from left to right:
  • Undo
  • Redo
  • Selection Tool: Selects faces/points/edges on your model
  • Move Tool: Allows you to move the object anywhere you want, including strictly along any of the axis by dragging your model using the axis handles that stick out of it when selected.
  • Scale Tool: Adjusts the size of your model. With this tool you can adjust the size of any side on your model by pushing/pulling the axis handles sticking out of your selected object. If you click and drag the on the small cube that appears at the center of your model, it will scale your model uniformly. Also, you may resize an object without the scale tool, simply by using the small orange boxes that appear around your object when selected.
  • Rotate Tool: Allows you to freely rotate your object along any axis.


Primitives:
In order to help you start modeling, Cinema4D provides you with basic simple shapes such as cubes, cones and cylinders to work off of. These simple shapes are called ‘Primitives’; you can access them through the small blue cube icon on the toolbar, which when you long-press it, reveals a menu containing all the primitive shapes you have at your disposal.

Views:
Right below the toolbar, there is a strip along the top of your coordinate plane that contains tools to tumble around your view of your model. On the upper right hand corner of this strip are 4 buttons (from left to right):
  • Pan
  • Zoom
  • Rotate
  • Alternate views

For each of the first 3 buttons, you can simply hold down your left mouse button over them, and move your mouse around to adjust your view. The 4th button provides you with 4 different perspectives to view your model from:

  • Perspective (This is the default 3D coordinate plane view)
  • Top
  • Right
  • Front
It is often useful to alternate between these views to make any precise/fine-adjustments to your model.

Materials Manager:
Section on the lower left hand corner; contains all the shaders/materials/textures used to bring color to your models. To create a new material, simply double click in the empty gray area or go to File > New Material. Once your new material appears, double click on it, and a new window will pop up with all the settings you can customize on it, including its color. Once you’re satisfied with your material, simply drag it and drop it from the materials manager onto the object you want to texture.


PROJECT:
Using these tools, let’s create a simple, colorful Jack In The Box head.