|
![](/i/fill.gif) |
you could use the sphereradio: (all code untested)
(I assume you will be change the camera or object position with the "clock")
// Variables
#declare cameralocation = <5-clock, 0.5, -4.0>;
#declare cameralookat = <5-clock, 0.5, 0.0>;
#declare camerangle = 90;
camera {
location cameralocation
sky z // you probably use y for up ??)
//up z
right -x*image_width/image_height // (=camera aspect ratio)
look_at cameralookat
angle camerangle
}
//////
#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; // (not used)
#declare objectDistance = vlength(AC);
#declare objectSize = degrees(asin(sphereradio/objectDistance)); //(half of
it)
#declare extraSize = 1.0; //(degrees) (zero should be possible!)
//#declare D = A + AB + AC;
#declare objectangle = VAngleD(AC,AB);
#if ( objectangle < ((camerangle/2)+extraSize+objectSize) )
#declare #include "myfile.inc"
#else
#declare #include "myfiletest.inc" // (empty or simplifyed version)
#end
Post a reply to this message
|
![](/i/fill.gif) |