This was a take on the 'wine-glass' tutorial that is common to most Blender 'newbies'. The project has five sections, including:
The glass was modelled as per usual, using Blender's 'Sub-Surface' modifier on an appropriately extruded cube.
TIP: By applying a first Sub-Surface modifier (click apply to the right of the subsurf modifier in the edit buttons area), and then set up another Sub-Surf modifier to act on the more complex mesh. This will soften any angles that occurr on the rim of the glass, and around the base. Also, use only the necessary level of subsurf, as it can prove expensive to the render-time. (Note the separate levels for 3D-views and rendering.)
The surroundings of this render consist of more than is immediately apparent, as I took into account the reflections of what would be
behind the camera that would be visible in the glass. This involved four walls, floor, cardboard box, and extra details for realism
(including the nail in the wall, windows behind the camera - and even a simple modelled camera on tripod! ..which is barely visible.
The cardboard box was necessary, as fluid simulations in Blender are restricted to the 'bounding-box' of the DOMAIN object.
(So whatever shape the DOMAIN object is, the fluid sim will fill it's cube/oblong shaped bounding-box). So, to keep a good
resolution for the fluid sim, it was necessary to have a 'reason' for the fluid to stop abruptly at the sides of this cube; hense the box.
Though I rely on Blender's textures for most of my materials, I wanted to use a digital photo for the walls; so a couple of snaps later, I had the tiles and orange wall texture ready to go in a single image. Using ORCO mapping (Origina Coordinates) in the 'map in' section of the material buttons mapped the texture to the mesh 'plane'. Then, using the preview render (Shift-P), I added some depth to the mesh by extruding the tiles, so they would be raised from the wall, and interact more convincingly with shadows etc.
I used a similar method for the floor - agin using a digital photograph of my coffee table(!) and extruding dividers to make the wood appear to have planks.
The cardboard box involved a little more modelling. Starting with a cube, and subdividing using the 'Fractal' subdivider tool within edit-mode gave me a rough and slightly random-edged box. I then moulded the seam by cutting and extruding - then manually pulling the far end of the seam into the tatty looking flap of cardboard.
I added staples and a piece of parcel tape for detail - both a separate objects, and used their influence to add the finishing touches to the boxes seam.
I wanted to have the glass appear to interact with the fluid simulation, so decided to use the natural movements of the Blender
Game-Engine physics simulator to animate the glasses IPO.
To do this, I set up a sphere, and a plane, angled to allow the sphere to drop, hit the plane, and collide with the top of the
glass. After some trial 'n' error experiments, I got the correct positions and Mass and Damping settings for the desired effect;
toppling the glass without it falling over.
I then removed the sphere and plane to a hidden layer, and set about creating the fluid sim.
To begin with, I used a fairly low resolution simulation to organise a 'demo' of the effect; i think it was about 90 or something.
Once I had it timed well with the movements of the glass, I tranfered the project to my desktop PC for a more detailed simulation.
This higher resolution image was set to 250 - but actually crashed the project! Luckily, as Blender writes the actual simulation
data to disk with every frame, you can re-load the project, and simply click on the first frame of the simulation where you saved
it previously, and the effect will reappear to the point it crashed. This was good enough to capture the hi-res images.