|
|
On Fri, 18 Jul 2003 15:32:24 +0300, "Janne" <kos### [at] kolumbusfi> wrote:
> Hi,
> 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.
Here is simple method:
1. Get camera location in point L
2. Get rectangle of screen in scene coordinates - vertices at P1,P2,P3,P4
3. Declare mesh M with triangle T1=P1-P2-P3 and T2=P1-P3-P4 to mimic screen
loop:
4. Get random location in point A
5. Use trace function with ray from L to A.
6. Check if sended ray intersected mesh M.
7. If intersected then use point A to locate object.
8. If not enough founded locations then repeat loop.
9. Render
10. Show result in povray.binaries.images
ABX
Post a reply to this message
|
|