|
|
I think the whole problem is that up and right are best thought of as scalars,
the length in x and y of the image.
Anyway, here's my proposal for a doc/ wiki to explain the orthographic camera.
I'd be delighted if anyone took this and explained it better, made it prettier,
or even explained the regular camera.
In Linux circles, they spoke of a "girlfriend test," whether someone's
non-Linux-enthusiast SO could but up the OS and use it right away. My version of
this for povray is that someone with basic smarts in computers (say a FORTRAN or
BASIC- educated person) could pick up the docs, and on first sitting, make an
image with spheres perfectly in all four corners of the screen. That I believe
would be a "Holy Grail" goal for the docs.
Four views: Orthographic up too close, Orthographic sufficiently far away,
"Diagram" of Ortho up too close, "Diagram of Ortho far away. White plane is
the camera's viewing plane.
#include"transforms.inc"
///-------------------------------------
// 1 means take image with orthographic camera
// 0 means look at scene as a very early draft for diagram
#declare your_orthographicness=1;
///-------------------------------------
///-------------------------------------
// 1 means a view where the camera plane cuts off figures
// 0 means a view where camera plane a healthy distance away
#declare your_too_closedness=0;
///-------------------------------------
#if(your_too_closedness)
#declare your_location = 3.5*< 0,pow(2,0.5),-pow(2,0.5)> ;
#else
#declare your_location = 15*<0,pow(2,0.5),-pow(2,0.5)> ;
#end
#declare your_up = 10;
#declare your_right = 10;
#declare your_look_at = 0;
#declare your_look_dirn = your_look_at-your_location;
#if(your_orthographicness)
camera {orthographic
location your_location
look_at your_look_at up your_up right your_right
}
#else
camera{location <80,80,-25> look_at 0 angle 45}
box{<-your_right,-your_up,-0.01>,<your_right,your_up,0>
pigment{rgbt <.9,.9,1,0.5>}
Reorient_Trans(<0,0,1>,your_look_dirn)
translate your_location
}
sphere {your_location, 0.5 pigment {rgb 0.1}}
cylinder {your_location,0.25*(your_look_at-your_location)+your_location,
0.5 pigment {rgb 0.1}}
cone{0.25*(your_look_at-your_location)+your_location,1.5,0.35*(your_look_at-your_location)+your_location,
0 pigment {rgb 0.1}}
#end
sphere {your_look_at,1 pigment {rgb 0.1}}
background {rgb 1}
light_source{<-31010,250000.0,-250000> color rgb 1}
light_source{<12220,500,40000> color rgb 2 shadowless}
//cylinder
sphere{<-10,0,-10*pow(2,0.5)>,3.2 pigment {green 1}}
sphere{< 10,0,-10*pow(2,0.5)>,3.2 pigment {green 1}}
sphere{<-10,0, 10*pow(2,0.5)>,3.2 pigment {green 1}}
sphere{< 10,0, 10*pow(2,0.5)>,3.2 pigment {green 1}}
cylinder{<-10,0,-10*pow(2,0.5)>,<-10,0,-10*pow(2,0.5)>+100*<
0.00,10*pow(2,0.5),-10*pow(2,0.5)> ,.2 pigment {green 1}}
cylinder{< 10,0,-10*pow(2,0.5)>,< 10,0,-10*pow(2,0.5)>+100*<
0.00,10*pow(2,0.5),-10*pow(2,0.5)> ,.2 pigment {green 1}}
cylinder{<-10,0, 10*pow(2,0.5)>,<-10,0, 10*pow(2,0.5)>+100*<
0.00,10*pow(2,0.5),-10*pow(2,0.5)> ,.2 pigment {green 1}}
cylinder{< 10,0, 10*pow(2,0.5)>,< 10,0, 10*pow(2,0.5)>+100*<
0.00,10*pow(2,0.5),-10*pow(2,0.5)> ,.2 pigment {green 1}}
cylinder{0,100*< 0.00,10*pow(2,0.5),-10*pow(2,0.5)> ,.2 pigment {green 1}}
#declare nx=0;
#while(nx<16)
#declare nz=0;
#while(nz<16)
sphere{0,1. pigment {red 1} translate <(nx-6.5)*2,0,(nz-6.5)*2> rotate
30*y}
#declare nz=nz+1;
#end
#declare nx=nx+1;
#end
Post a reply to this message
Attachments:
Download 'orthgrip031.png' (75 KB)
Preview of image 'orthgrip031.png'
|
|