Cross-section material driven by object

Hi. I was wondering what would be the best approach to obtain a cross-section-render of a model, driven by another object.
My solution is at the moment to use a node group, at the very end of every material (before the ‘surface’ node). I am using the new ‘external object texture coordinate’ input, with a gradient texture controlling a mix with a transparent shader (image below).

To have the cut more or less in the same position of the empty, I had to put the color variation quite at the beginning of the ramp (0.10).

The question is: is it possible to achieve similar results without textures, using math nodes?
Something like ‘everything with x, y, x coordinates higher than the empty position will be transparent’.

A more flexible approach would be to use an intersecting mesh (e.g. a plane) and the backfacing geometry node to control the transparency of the other objects, but I am not sure of the relation between ‘object coordinates’ and ‘object position’.

Ciao ciao,
Piergi

Attachments


does it need to be animated? if not you could use the mesh bisect tool:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Meshes/Editing/Subdividing/Bisect

Not really: I have usually hundreds of objects, and the cross section (albeit not animated) must be dynamic and non-destructive: I need several different sections from the model.

I’m talking about architecture models, and they change all the time during the project :wink:

Also, as stated in the OP, I want to control the section plane with an object (an empty, or even better a mesh).