Modelling and Rendering a Glass
In this tutorial I am going to show you step-by-step how to model a glass with liquid in it in Google SketchUp and then render it using Kerkythea. Part one is the modelling stage, part two is rendering and part 3 is depth of field. You will end up with something like this:
Part 2: http://www.overclock.net/9163210-post206.html
Part 3: http://www.overclock.net/9163484-post207.htmlRequirementsInitial StepsPart 1
Start with a new SketchUp. Go into Parallel Projection mode and go into a front view. Then draw a 100mm horizontal line and a 50mm vertical line on the end of it.
Grab the curve tool and draw a perfect quarter of a circle between the middle of the 100mm line (blue snapping point on the line) and the top of the vertical line. Then delete the excess lines.
Tip: The curve will turn blue or pink as you are drawing it to indicate if you are at point where the curve flows on perfectly from connecting lines (in this case, it is when the curve is a quarter of a circle)
Grab the curve tool and start to model the rest of the glass. Make sure your curves are blue before you click them down.
I ended up with this, but you can do whatever you like.
Select all parts of the line, then click on the offset tool and offset it around 6mm.
If you look at a glass, the base is always thicker than the sides. So for us to do this, select the inner line and then use the scale tool to make the bottom part thicker.
Then connect the bottom left ends with a vertical line (make sure it is a perfectly vertical line)
On the other end, connect the two ends with a perfect semi circle (there is snapping point for it). If you have closed the ends properly, the series of lines should fill in and become a plane.
Rotate the viewpoint around and draw a horizontal circle from the base of the shape. The radius does not matter.
Delete the centre of the circle so you are left with a line. Select the line, then click on the 'Follow Me' tool. Then click on the shape we made before (make sure you click on the face, not the edge)
You should suddenly end up with a glass!
Next we need to put some liquid inside. Create a new layer and call it Hidden.
Select all the outside faces of the glass, like in the picture above. Then in in the 'Entity Info' window change the layer to hidden.
Toggle the layer visibility of the 'Hidden' layer to off in the 'Layer' window. The outside of the glass will disappear, leaving the inside.Info:
Rendering engines have trouble with liquids in a glass/cup. The issue is, they don't know what to do when the liquid meets the solid material. For Kerkythea, we get around this by making the container itself become the liquid, and then just add a top. In SketchUp, each face has two sides - a white and a purple one. White means 'outside' and purple means 'inside. To get Kerkythea to recognize that there is something 'inside' the glass, we need to reverse the faces where we want the liquid to be so they become white on the outside. NB: you can see the direction of faces in SketchUp by changing to 'monochrome' mode.
Select the faces up to the point where you want the surface of the liquid to be. Then right click, and click reverse faces.
Next we need to add a top to our liquid. Select the part of the jar that you did not reverse and change the layer to 'Hidden' so it disappears.
Draw a line across the top of the remaining geometry so the top closes up. Delete the line so there is just a face left.
If you look in a glass of water, you will see a 'meniscus' at the top of the liquid. This is where the edges of the water 'curve' upwards due to the surface tension. You can read more here: http://en.wikipedia.org/wiki/Meniscus
. We need to model this. Grab the 'Push Pull' tool and push the top of the model down 3mm.
You may see the above happen after doing the push pull. There is geometry coming through the wall of the liquid. If you do not, then you can skip the next step.
Select the top face. Get the 'Scale' tool out. Scale the top down using 'Scale around centre' until you cannot see lines coming out of the sides. You can read more about scaling around centre here: http://sketchup.google.com/support/b...n&answer=94904
At the moment the lines aren't very curved, and will give a dodgy render. We need to use the plugin 'RoundCorner' to curve the edge. Select the top face and then click on the orange, or 'Round Corners in 3D' button.
The RoundCorner plugin will start and a bar will pop up. Click the area in the bar underneath 'Offset' and the window above will pop up. Change the values to the above. Then click the green tick. Once it has finished computing, exit RoundCorner.
You will be left with this.
Triple-click on a face to select all of the liquid. Put a material on it. It does not matter what colour as long as you don't make the glass the same colour.
Turn the 'Hidden' layer back on. We are now going to make a straw to put in the glass! Draw a horizontal circle next to the beaker, radius 6mm.
Use the offset tool to make a smaller inner ring. Delete the centre part.
Use the push pull tool to make the straw a bit taller than the glass. Then select the straw and Right Click -> Make Group. This will stop the straw interfering with the geometry of the glass when we move it into position.
Go into an X-Ray view to make it easier to line up the straw, as shown above.
Use the 'Move' and 'Rotate' tools to move the straw into position. Make sure the straw does not cut through the glass at all, or it will look bad in the render. It does not matter if it doesn't touch perfectly.
If you are having trouble, make sure the straw is lined up with the middle of the glass.
If you turn off the Hidden layer and go back into non-xray mode, there should be no straw sticking through the liquid.
Double click the straw, then select the top face. Go back into RoundCorner 3D mode and round the top with the settings above.Info:
Doing this will make the straw look more realistic. If you look at anything in real life, no matter how sharp the edge is, it will always be slightly curved. This curve will give of a 'glint' or 'sparkle' when light hits it. In 3D modeling, we have the ability to create infinitely sharp joints. However when these are rendered, they look 'wrong'. To counteract this, we add a tiny curve to the edge. I advise doing this to all models if you are going to render them.
You may notice that the RoundCorner plugin fills in the hole in the straw. This is normal and you can just delete the face. Then triple click the straw and make it a different colour to everything else in the model.
Next we need to soften/smooth edges. Triple click the glass, then right click -> 'Soften/Smooth Edges'.
Turn on 'Soften Coplanar' and you should see all the lines disappear.
Now we need to export the model to something Kerkythea can read. Go Plugins -> Kerkythea Exporter -> Export Model.
Use the settings above, and save the .xml file somewhere.End of Part 1.
Part 2 tomorrow