Showing posts with label Cinema 4D. Show all posts
Showing posts with label Cinema 4D. Show all posts

Oct 13, 2007

Modeling a pipe using hyperNURBS

This tutorial is a day late, but that’s because I spent yesterday researching and experimenting myself so as to provide you with a top quality tutorial. The first part of today’s tutorial will explain how to model a pipe in Cinema 4D and weight it using hyperNURBS with the second part describing how to create an amazing looking translucent glass texture your sure to love. The second half of this tutorial is also an English translation of this German tutorial viewable here.

Extrude box

Firstly open up cinema 4D and hit the F5 key so as to bring up the multi angle view then create a new primitive cube and make it editable by pressing C. Next select the choose polygons button and select the top face of the now editable cube, right click and select extrude after which then press and hold the left mouse button anywhere within the selection and drag the mouse right (shown step by step above). Alternatively you can just enter a number into the offset value in the tools browser (shown in image below). For this tutorial I extruded each of the faces of the cube however to give a smooth transition for each bend you have to extrude a short way and then a longer way as shown in the image below.

Example and extrude preferences

Once you have a model looking something like the above image, create a new hyperNURBS object (step one in figure below) and place the modified cube as a child of it (step two in figure below). This will result in a smoother version of the model before.

hyperNURBS

Now what we need to do is place a weighting on the ends of the pipes so as to flatten them. Weighting as a way of telling the hyperNURBS where to apply its modifications. To apply this weighting you need to select the edges of the modified cube using the edge selection tool (numbered one in the below image), then to enable the hyperNURBS attribute you need to select the pointer tool (numbered two in the below image). When selecting the edges of the face you might find it easier to press shift while selecting and then if you select the wrong edge press CTRL and select the wrongly selected edge to deselect it (method numbered three below).

Select edges for weighting

Once you have selected all four edges of the face, you should be able to see the hyperNURBS preferences in the pointers preference panel (shown below) set the strength to 100% and press set, then repeat for all the other faces so that you have four pipes extruding out from a central point.

hyperNURBS pointer preferences and result

Now we have half finished the model as well as learnt in detail how to use the hyperNURBS function. As the second half of this tutorial focuses on creating a translucent glassy texture we need to now hollow out our model so that the texture will work. To do so copy and paste the hyperNURBS object and rename the two inside and outside respectively ready for using a Boole for the hollowing. The material I am going to later show you how to make works best when the walls of the container are 1m thick or less so the inside object will need to be precisely resized so that it is within this parameter.

Extrude the inside objects edges

Before we begin with resizing the inside object we need to first extrude its pipes so that when resized and booled they extend out of the outside object thus carving out the pipes inside completely. So as shown in the above image extrude each of the faces of the inside object. Once done select the inside cube object in the object browser then the polygon select tool and press CTRL + A to select all polygons in the inside cube (as shown below as step 3), then right click and select Normal Scale (step 4 below) and enter 99% into its preferences and press enter (step 5 below).

Steps for resizing the inside.

This will result in the shell being 99% the width of the model which is just what we want, next place the inside and outside objects into a Boole in the correct order so that you have a hollow pipe structure as shown below.

Final Model finished ready for texture.

Before I begin with showing you how to create this texture, I must first begin with explaining a little how it works. This texture uses Cinema4D’s subsurface scattering shader which takes a light input from a light within the scene and uses it to manipulate the luminescence of the material absorbing the light. This makes it a most excellent shader for producing glass materials which respond realistically when lit from the inside such as a glass lighting fixture. So the first thing to do before creating the new material is to create the light source which its going to reacting to. When you create the new light object it should automatically be placed in the centre of your model, unless you have moved the model around from its original position, just make sure its near enough centre if you have. Next go to the materials browser and create a new material and apply it to the Boole containing our model.

Step by step selecting subsurface scattering

Within the new material deselect the colour and specular attributes and select the luminance one, within the luminance preferences click the arrow button for the texture preference and select Subsurface scattering (as shown step by step in the above image). When rendered your model will now look like the below image, as you can see the material is reacting to the light, absorbing it and emitting it again, while luminescence depends upon the thickness of the walls.

Example render of defaults with subsurface scattering

We now need to customise the material to the needs of our model as its default settings wont take into consideration our models maximum thickness amongst other things. Therefore, click on the button now labled Subsurface scattering and enter the below settings, you can choose any colour here (step one in below image) however if you like the orange shown here then its RBG values are R255 G182 B0.

Subsurface Scattering prferecnces.

Next select specular colour and give it a slightly lighter colour than the one you chose before and then select Specular and enter the settings shown below.

Specular Preferences

Once rendered you should have something which looks like the below figure as you can see the walls where all the pipes connect are a little too thin this can be remidied by simply resizing the inside object to say 95% of it original size. Also as this is a low polygon model the render will look a little blocky, you can play around and experiment with things to change this.

Final Render

I hope that this tutorial has helped you in some way, if you have any questions or comments then feel free to post them using the form below.

Original German Tutorial of which this is a partial translation of viewable here.

Making an hourglass

This tutorial will teach you to make a great sandglass, which you can use for plenty of purposes. You can find the finished model and other stuff here Glass.zip


Start a new scene. Go to back view. Go to Configuration\background image. Choose your blueprint. I used this one:

Image

Now to begin! Go to Objects\spline object. Choose vertex selection and add points like on the image shown (you add the points by holding 'ctrl' and clicking your mouse button).

(If you image seems deformed, type these values for your background image:size x=900;y=100).

Image

Draw out the edges of the glass part. It MUST be two-sided (it must have an inner and outer edge) . Start from the bottom following the outer edge, and when you reach the middle of glass part, start doing the same for the inner edge until you get to the beggining . Type must be linear Linear.

Here you can see how the edge should look:

Image

Create a Lathe object. Put your line in it (just drag it onto it).

You will get the glass body. Now we must make the rest of it.

Upper and lower holder:

For the holders, we need to insert two sircles into our scene and position them according to the image.

Image

Make two extrude objects, and place the circles into them. Type these values in: Movement: x:0; y:90; z:0

Start Cap: Cap and rounding; end cap: cap and rounding;

Rounding type: 2 steps. (in version 9 the radius should be 19).

Image

Now for the two sticks on the sides. These are the two you saw in the previous two images. I won't explain how to make them, because the process is identical as with the glass body. Because they are not hollow, you don't need to draw the inner edge, only trace the outer. Mine came out like this:

Image

The model is nearly over. All you have to do is to insert everything into a hypernurbs object (except the two extruded circles, they need to be sharp).

Image

The model is now over. Now for the materials.

GLASS

Make a new material. Double click it and name it 'glass'.

Color.

The color should be pure white. The brightness to 100%

Diffusion.

Diffusion should be around 19, because it still keeps some light on it. Uncheck all checkboxes.

Transparency.

The color should be pure white with brightness of 100%. Refraction must be Fresnel, and give it a value of 1.52. Pick Frasnel for texture And click a little preview image to edit it . Mix mode must be Multiply. Make it white with a LITTLE very light gray at the ends.


Reflection.

Seti it up as on the image below.

Image

Specular.

Set it up as on the image. (If you have older versions, where you don't have fallof and innerwidth, make height 700%, and width 0).

Image

Drag the material onto the glass body and render it. If you did everything right, you got something like this:

Image

Although the glass doesn't seem very realistic, it is. To see the material like it really is, insert a floor object and an Omni light. Now the material shows it's real qualities.

THE COPPER MATERIAL

Since this is and old thing, we need an old material. The most popular for sandglasses (and the prettiest) is copper.

Make a new material and double click it.

Color.

Image

Reflection.

Image

Environment.

The scene's reflection is not enough. To add a little more realism, we should put an Environment. That image will be reflected on the copper.

Image

This is the environment you need:

Image

Specular.

Copper is kind of a dull metal, and that is why we need width:

Image

Drag it to the rest of our objects and render it. You should get something like this:

Image

Hmmm, it doesn't seem real enough. Select the omni you made earlier . Give it these parameters:

Type: Omni

Shadow: Soft

Go to Render Settings and under Antialiazing choose Best. Render the scene.

Image

Simple pen in Cinema 4D

Simple pen in Cinema 4D

This tutorial is going to show you how to create a simple pen. The colours on the materials can be changed to your own choice.

Start off by creating a new document.

Then create a new Cylinder:

Modify this cylinder to have these settings:

Create another cylinder and give it these settings:

Then place the second cylinder like this – You can see the shape of our pen already!

Now duplicate the first Cylinder we did:

Modify the settings of the duplicated cylinder to look like this:

Select the duplicated cylinder and place it like this:

Now we’re going to create these two materials – They’re very simple!

Create a new material:

Give the material a pitch black colour and then add a reflection such as this:

Create a second material and give it a blue colour of your own choice – Give it a reflection with these settings:

Now apply these materials to the objects like this:

Now… To make the objects more rounded, we’re going to add “Fillets”. Do so by selecting the object, and go down to “Caps” and check the “Fillet” option. Set the fillet on all our objects to these settings:

Does your pen look somewhat like this now? Good!

Create a new Cube:

Modify the settings of this cube to match these:

Place the cube after applying the blue material to it like this:

Add a floor and place it right under the pen. Then add a light and put it somewhere above the pen, and add a shadow to the light.

Now render!

Result:

Making a glass and a wine bottle with C4D

This tutorial demonstrates ways to make a glass, its materials and the content inside the glass. I made the model in c4d r9, but It can be done with lower versions (just to try it, I got a very similar result with cinema ce6).

Image

And yes…. Sorry about my bad English. I think you’ll understand.

It consists of three parts: Making the glass, making the bottle, and making the scene.

You can find assorted files and finished scene here

PART 1 - MODELLING THE GLASS

You can use blueprints for this, but they are not necessary. I didn’t use them. So, go to Objects/Spline Object. This will create a blank spline. While holding CTRL, draw one half of the glass. You should have in mind the following:

When you are tracing the upper part of the glass (the hollow part) distance between inner and outer part of the spline must be so small, that it’s nearly invisible when you zoom out.

The “leg” of the glass must be filled.

Type of the spline MUST be Linear.

------------------------------------------------------------------------------------------------------------

Here’s what i got:

Image

(i made a mistake in this pic. In the lower part of the glass, each point needs a partner. I drew them on the pic)

When you are done tracing the glass, insert a LatheNURBS object. Place the spline in it. Now you have the glass. For more “smoothity” insert a HyperNURBS object. Place the LatheNURBS in it. Voila!

Image

Image

We are now done with part one.

------------------------------------------------------------------------------------------------------------

PART 1.2 – ADDING A MATERIAL TO THE GLASS

This is the first tricky part with this model. You have to get it right if you want your glass to look…. Well, glassy!

Create a new material. Name it…….. hm…… I don’t know…… glass, maybe? Double click it.

Color.

The colour channel of the glass must be pure white (R 255, G 255, B255) and brightness 100%.

Image

Diffusion.

I use diffusion if I want to make dirt and such. But, it can also represent the light dissipation. There is almost no dissipation on glass, so set the brightness to 19% (I said almost, didn’t I ?). Also, uncheck the Influence Specular checkbox.

Image

Transparency.

Now, this is tricky. We want the glass to be transparent, right? If we only put the transparency brightness to 100% it will become invisible. Ok, let’s add some refraction. Type in 1.52. if you render the scene, you won’t be satisfied. Hmmm… what should we do? Ah, lets add a shader! Choose Fresnel as a shader. Click the Fresnel image to edit it. Middle of the gradient should be pure white. There should also be some pale grey tones on the edges.

Image

Reflection.

If we take the default reflection, it will equally reflect everything on the whole glass surface. We want a subtle reflection. To do that, we need our good old friend Mr. Fresnel. Again, click the image to edit it. One end of the gradient should be dark gray, the other pure black.

Image

Specular.

This channel differs in the newest versions of C4D. If you own an older version of Cinema 4D, don’t worry, I’ll explain what to do with them too.

- old versions (under 7). Since there is no inner width and fallof, type this:

Height 650

Width 0

- versions (above 7).

Height 100

Width 12

Falloff 0

Inner width 25

Illumination. (this channel does not exist in the older versions. If you own one, don’t worry, this isn’t very important)

Since the default shader is Phong, it puts highlights on both sides of the glass. We don’t want that. So change it to Blinn.

Drag the material onto the glass. If you did it all right, you will be satisfied with the result:

Image

-----------------------------------------------

That completes the second part.

------------------------------------------------------------------------------------------------------------

PART 1.3 – MAKING LIQUID INSIDE THE GLASS

This part is the easiest. It only involves editing already made stuff.

To make the shape of liquid, we are going to copy lower polygons of the hollow part. Since our glass is made of two layers, inner and outer, we are going to select only the outer layer. To make sure you do that right, in the Selection tool active object choose only select visible elements. Now, using common sense, select polygons that would represent the liquid. Go to Functions/Split. Select the splitted object and drag it out. Notice that our wine has no top (lid?!). We can add the top in 2 ways. First is for users of the newer versions and the second one for older versions.

1. Select the splitted object. Go to polygon selection. Choose a poly and press CTRL + a.

This will select all polys. Now go to Structure / close polygon hole. Move the mouse on top of the hole. If nothing happens, try to move your cursor to an edge. Close the hole by clicking. Done! Now we have a finished liquid object.

2. (old versions) Select all vertexes around the hole (only the topmost ones, those that make a circle). Press B. Bridge the surface carefully.

Scale the new part a bit (scale it so it’s a bit smaller than the actual glass).

Place it inside the glass.

------------------------------------------------------------------------------------------------------------

PART 1.4 – MAKING LIQUID MATERIAL

To make a wine material, we are going to edit the glass material. First copy and paste it. Double click the copied material. Edit only what is mentioned here:

Transparency.

Change the transparency colour to dark red (burgundy). It will instantly decrease the transparency (which is what we want). Wine isn’t as reflective as glass, so turn it down a bit. I don’t want to give you the exact parameters, because then you can make it as you like.

DONE!

------------------------------------------------------------------------------------------------------------

PART 1.5 – MAKING THE ENVIRONMENT

Insert 3 planes to the scene and position them as shown:

Image

(this is a render, don't worry if your project doesn't look like this yet)

Insert a light. Default omni will do nicely. Go to the properties of the light you just made. For the shadow type, choose Soft shadow. No need for anything else.

------------------------------------------------------------------------------------------------------------


Now, go to Render settings. Change antialiazing to best (r9) or all (CE6). We don’t want anything spectacular, so save the changes and render. WOW!!!

Image

Now, for the second part of the tutorial. Making the bottle.

Our current scene is artistic and nice, but is still kind of empty. Thus, we will add a bottle of wine to it. Process of making the bottle is pretty straight forward, and is exactly like making the glass. This is an advantage of lathe. You can make various different shapes using the EXACT same techniques.

So, let’s start of by cleaning up our scene.

Delete everything in the scene except the glass model (uncluding the liquid) and lights. You can hide your model, but you don’t need to, and it’s better not to, because you will have better view of the proportions.

Find a reference for your wine bottle. I used this one:

Image

Now, what is good about this reference is that it is in high res. That way, we can use the reference as a texture when we make the label later. This image was much bigger than you see it, but I scaled it down to fit the page. You won’t need a bigger picture anyway.

Now, place this picture as your viewport background. Make another spline object and draw out the inner and outer edge of the bottle, as you did with the glass. Trace just one half of the bottle. MAKE SURE YOU MAKE THE SPOUT! The bottle must be open. We will make it all out of a single piece and then separate parts like the label and the cork. Make sure the spline type is set to ‘Linear’.

Image

Image

Image

Once you have drawn it out, make a lathe object and put your spline in it. If it is not showing like it should, move the spline to the ordinate (y axis) with the middle vertices on 0 value of y axis. Now you have a block. This is the basic shape of the bottle. On our reference, the cork is covered with foil, but since there is already some wine in our glass, the whole scene will seem illogical. That is why we traced out edges of the spout. We don’t need a reference for the cork, since it is very simple. Make another spline object and draw out outer edge of the cork. Remember, only draw one half of it.

Cork Profile:

Image

Lathe Bottle:

Image

Make a new lathe object and put the cork in it J.

Bottle with cork:

Image

Now we need to add a label to it. Make the bottle lathe object editable and select the label polys. This don’t need to be exact, but because we will use the texture for it from the reference, try to match the selection as close as possible. You can even select loops of vertices and adjust them to the label on the ref. Right click your selection and choose split. Rename the newly created object to ‘Label’.

Selected polys:

Image

Scale it just a tiny, tiny bit and extrude it (also a TINY bit, because the label doesn’t have much thickness, but it still has some). Choose ‘Make caps’.

Image

We also need some liquid in the bottle, and we’ll make it exactly as we did with the glass. Select one third of the bottle’s polys (where the vine should be. Don’t forget to select the bottom!). Split it, cover the top using ‘Close polygon hole ’ tool, and scale it don’t do it too much, just a little.

Image

Place the bottle and cork into new HyperNURBS objects. The label should be as sharp as possible, so you don’t need to put it into a HyperNURBS, phong tag will be enough. Don’t put liquid in the hyper nurbs, as it will mess it up.

Oops! Looks like something is wrong with our cork. Hyper nurbs made a hole in the middle of it. To fix this, select all middle vertices of the cork on the top of it (the center) and weld them together. Done!

Image

Image

That is it for the modelling. Now to make the mats.

PART 2.2 MAKING THE BOTTLE MATERIAL

Our main bottle material will rely on the old glass material that we made. Of course, we are going to make some adjustments, to make it green and dull.

Copy the Glass material and name it bottle.glass. Double click it, and set it up as shown:

Colour:

Image

Diffusion:

Image

Transparency:

Image

Click the Fresnel preview box and set it up like so:

Image

Reflection:

Image

And to make the label texture… Make a new mat and name it label.tex. Use a photo editing program and crop the label from our reference. Save it as a new file.

In the colour channel, click the button next to ‘Texture’, the button is labelled with 3 dots. Locate your label texture.

Drag the material to the label and change projection from UVW mapping to Cylindrical.

Give it these coordinates: Position Y-63. Don’t change anything here. Go to ‘Tag’. Length X: 50; Length Y: 117 and tiles X: 2.

For the cork texture we are going to use a simple noise texture. Create a new material and name it, hmmm, cork. Press the little triangle button in the colour channel and locate ‘Noise’. Click the preview box, and you’ll see two little boxes. Don’t move them.

The first’s colour should be: 177, 128, 78.

Second’s: 124, 82, 61.

Also, change the U and V frequency to 5.

Drag the material onto the cork.

Now that that is done, we are going to make a new scene. First, adjust the bottle size so that it is proportioned correctly to the glass. Move the bottle away from the glass a little.

We need a table. We can choose from two types of tables: Round and cubic. Both are easy to create, but they will not give us the same result. So, let’s review our project:

We have a lot of glass, which means we need reflections to make it visible and realistic. So, we need an environment that can encompass our models well, without holes. If we use a round table, we won’t be able to place walls without having a gap between the table and walls. That will result an unrealistic render. So, cubic table it is!

Make a box (size doesn’t really matter, make it as big as possible) and place it so that the top of it touches the bottom of the bottle and the glass. Make two planes and position them orthogonally, as two walls. Position your camera and make a render!

Image