PDA

View Full Version : Visibility linked to a volume


number2
06-06-2006, 02: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 :)

number2

softmonkey
06-06-2006, 11: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

number2
06-07-2006, 08:32 AM
Softmonkey!

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

Thanks again

number2

jankin
06-08-2006, 02: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.

number2
06-09-2006, 03:55 PM
Jankin

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

Thanks
number2

Benr
06-09-2006, 04:37 PM
There's also Alan Jones' BoolTrace shader.

CGTalk Moderation
06-09-2006, 04: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.