View Full Version : Visibility linked to a volume

06 June 2006, 01:26 PM
hey you guys

is there anyway of linking the visibility of an object to a volume?

i.e. when an oject is within a cube it will render and when it passes out of the cube it wont render?

I've been trying and getting nowhere fast :)


06 June 2006, 10:01 PM
Shouldn't be too hard...

You can approach this using a complete scripted operator, or using built-in tools...

If the volume you want to use can be represented by a implicit primitive, for example the cube you mention, then you can use the Bounding Volume constraint to do your checking. Set the mode to "monitor only", which will update the location parameter on the constraint. Now you can write a expression on the objects visibility (render/view) and use that parameter in a condintional function.

For reference, the location parameter values are:

"Undefined" = 0
"Outside" = 1
"Inside" = 2
"On Surface" = 3
"Intersecting" = 4

Good luck.
(Note, this would have to be set up for every object that you want to control in this way)
Too quick to send. I have just checked my advice, and there is a distinct lack of update with the expression, but a simple SCOP would fix that

06 June 2006, 07:32 AM

Thanks for the reply. this worked out good enough for my needs.

Thanks again


06 June 2006, 01:54 PM
you can play with primary/secondary rays too. make your volume a absolute transparent object. then say that the objects inside the volume has only secondary rays active. So when the objects are inside they'll render, outside they'll not.

06 June 2006, 02:55 PM

That was a really great solution. So easy and works so well!!!


06 June 2006, 03:37 PM
There's also Alan Jones' BoolTrace shader.

CGTalk Moderation
06 June 2006, 03:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.