Start a new free form object as usual.
In the free form modeler, choose Geometry; Extrusion Envelope; Symmetrical. This will let you make the basic container shape.
Draw your first cross section, and center it. (Sections; Center.)
Click on the Extrusion Envelope Plane and choose Drawing Plane from the View menu, so you can see the shape of your container easily.
Using the Pen tool, draw the shape you want, adjusting the points as necessary.
Choose the points from the extrusion envelope, and insert cross sections where needed.
Go back to Reference View, click on the Cross Section Plane, and choose View Drawing Plane again. I usually choose to view only the section I am working on, because it makes it a lot clearer.
Draw the new cross section, and adjust it so that the size is the same as the old one.
Sometimes you luck out at the next step, and can choose the old cross section easily. If you can't, move the new one to one side to expose the old one.
Select and then delete the old cross section.
Center the new cross section if you had to move it.
Repeat these steps as needed.
And there is your container!
You may want to switch back to Reference View, and move it around to make sure it's the shape you wanted.
At this point, it's also a good idea to add the Shader you want to use. The reason for this is that it puts the Shader on the Master Object. This isn't really important if you only have the one glass in your scene. But if you get into this habit, it can make your life much easier when you need to use a different shader on all the glasses on the table, or all the spokes in a wheel, or all the links in a chain.... You get the idea!
Click Done, and return to the Perspective window.
Duplicate the glass, to give you another in exactly the same position and orientation. Give it a new name to avoid confusion, and double click to enter the Free Form window again.
When the dialog box appears asking if you want to create a new master, tell it OK.
Add a new point to the extrusion envelope to make the fill level for the contents.
Then, starting at the first point drawn, select and remove points until you reach the new level point. This will eliminate the outside wall of the container, and leave you with a solid object that will fit the container perfectly.
Don't forget to change the shader.
Click Done to leave the modeler, and make the contents slightly larger so that you don't have gaps where the surfaces meet. 100.01% usually does it. And that's it!
Note: If you have only one cross section, you will get a dialog box explaining that you can't remove the first point, because it is the last cross section. If this happens, simply insert a new cross section at your fill level point. This gives it a cross section to use, everyone is happy, and you can remove all the points from the outside wall with no more problems.
Hints:
If you want your container to be transparent in Ray Dream Studio 5, you have to select it, and go to the Properties Palette. Scroll through the tabs until you come to Rendering, and choose plenty of levels of transparency. These slow the rendering down, but without them, you won't be able to see through your glass. It will just revert to the base color at the end of the levels chosen.
The same is true for the contents, of course, if they are supposed to be transparent as well.
Be sure to check Light Through Transparency in the Render Settings, too, if you want the shadows to render realistically.
If your container isn't exactly upright, don't forget that you can use Boolean functions to cut away the contents at an angle.
Add a plain cube to your scene, and position it so that it covers all the contents above the new level. It will automatically be level with gravity, so that concern is taken care of.
Perform the Boolean operation, subtracting the cube from the contents, and there you have it. The contents of the bottle are now in accord with gravity!
You can use the same idea with other shapes to get surfaces that aren't perfectly level, as I did with the salt and pepper shakers in the title picture.
Just watch your transparency levels, and anything is possible!
If you have a question, write to me and ask it!
Everything on this site is copyright © Robin Wood; all rights reserved. Please do not use anything without permission. To get permission, write to Robin, and explain what you intend to use it for.