|
|
Janne <kos### [at] kolumbusfi> wrote:
> How can I test if a randomly selected point is visible to my camera? I need
> to place a lot of objects in my scene, but I run out of memory if I place
> objects over the whole scene.
This depends on whether you have reflections/refractions or not. If you
have them, then forget it.
However, if you don't have them, then you only need to test whether the
object is directly visible on camera.
Someone posted some time ago a tip for this: Using screen.inc, create
a box which completely and exactly covers the image area. For testing
whether an object is visible, you only need to call trace() from the
object location to the camera location and see if it hits the box.
There is also a mathematical way of doing it, but the tip above might
be the easiest way.
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|