POV-Ray : Newsgroups : povray.general : How to place objects randomly in the visible area of image? : Re: How to place objects randomly in the visible area of image? Server Time
5 Nov 2024 03:16:17 EST (-0500)
  Re: How to place objects randomly in the visible area of image?  
From: Warp
Date: 22 Jul 2003 07:33:30
Message: <3f1d210a@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.