POV-Ray : Newsgroups : povray.animations : how to check if an object is in the camera view : Re: how to check if an object is in the camera view Server Time
1 Jul 2024 02:43:49 EDT (-0400)
  Re: how to check if an object is in the camera view  
From: Troya
Date: 5 Nov 2005 15:20:00
Message: <web.436d12e48e315a6de2083e10@news.povray.org>
Thanks Jaap,

it was really good your explanation.
here is code that I'm using, it is not perfect but I think it will work in
90% of the cases. Also thanks to Friedrich A. Lohmueller site he has a page
named "Analytical Geometry with POV-Ray" very good stuff.

// Variables
#declare cameralocation = <5-clock, 0.5, -4.0>;
#declare cameralookat =    <5-clock, 0.5,  0.0>;
#declare camerangle = 90;


//////
#declare sphereradio = .1    ;
#declare sphereposition = <5,1,0>;

#declare A  = cameralocation;  // camera position
#declare B  = cameralookat;  // look at posision
#declare C  = sphereposition;    // cylinder position
#declare AB = B-A;
#declare AC = C-A;
#declare BC = AC-AB;

//#declare D = A + AB + AC;

#declare objectangle = VAngleD(AC,AB);
#if (objectangle<((camerangle+5)/2))
#declare #include "myfile.inc"
#else
#declare #include "myfiletest.inc"
#end

as I told you is not 100% perfect but for animations with really big include
files is a time saver.

oscar


Post a reply to this message

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