|
|
I hit a hard stop on my first idea for user_defined camera use, but did
work up an initial pass of documentation and a simpler proposed demo
scene. See below. Please review.
Thanks.
Bill P.
---
In top section add 10th CAMERA_TYPE as
"user_defined{USER_DEFINED_MODIFIERS}"
In top section suppose add USER_DEFINED_MODIFIERS:
[location <function{}>, <function{}>, <function{}>] <--- optional!
[direction <function{}>, <function{}>, <function{}>] <--- ditto...
(Misc text in camera section updated to reflect new camera down to
"user_defined projection")
User_defined projection
----------------------------------
Like the Mesh camera, the user_defined camera allows complete control
over ray origin and direction. It has advantages in not having to
actually load a mesh to work and its inner workings are less constrained
than the mesh type.
In addition to being able to duplicate existing camera types, the
mechanism can be used just as well for arbitrary other camera formats
waiting to be implemented in POV-Ray, including light probe-style
angular and cube mapping, side-by-side stereograms, Omni Directional
Stero (ODS), mercator, and other map projections for your self-made
virtual planet, and what-have-you-not cameras.
The specified functions are passed x,y screen coordinates (or u,v) as
parameters, ranging from -0.5 (left/bottom) to 0.5 (right/top),
respectively.
-------
Various camera set ups...
(A)------- Basic orthographic
#declare Camera01 = camera {
user_defined
location {
function { x }
function { y }
function { -5 }
}
direction {
function { 0 }
function { 0 }
function { 1 }
}
}
(B)------- Only direction functions specified
#declare Camera01 = camera {
user_defined
direction {
function { x }
function { y }
function { 1 }
}
location <0,0,-2>
rotate y*5
}
(C)------- Only location functions specified
#declare Camera01 = camera {
user_defined
location {
function { x }
function { y }
function { -5 }
}
look_at <0,0,1>
}
Notes
--------------------
(1) Many of the user_define camera warning and error message say
"user-defined" instead of "user_defined".
(2) Looking like the camera modifiers not by code prevented may
or may not make sense in any given functional set up.
//----------------------- user_defined.pov -------------------------
// This work is licensed under the Creative Commons Attribution 3.0
// Unported License. To view a copy of this license, visit
// http://creativecommons.org/licenses/by/3.0/
// or send a letter to:
// Creative Commons, 444 Castro Street, Suite 900, Mountain View,
// California, 94041, USA.
//
//----------------- Inward facing cylinderical ---------------------
//
// +w900 +h450 +a0.1
#version 3.71; // user_defined introduced with 3.71.
global_settings { assumed_gamma 1 }
#include "shapes.inc"
#declare Grey50 = srgbft <0.5,0.5,0.5,0,0>;
background { color Grey50 }
#declare Black = srgbft <0,0,0,0,0>;
#declare OurText =
"Round and Round and Round and Round and Round old Y we go."
#declare Text00 = object {
Circle_Text_Valigned("crystal.ttf",OurText,
0.10,0.001,0.02,0.5,0,Align_Left,-5,90)
pigment { color Black }
rotate x*-90
}
#declare CameraP = camera {
perspective
location <2.3,2.3,-2.301>
sky <0,1,0>
angle 35
right x*(image_width/image_height)
look_at <0,0,0>
}
#declare White = srgbft <1,1,1,0,0>;
#declare Light00 = light_source { <50,150,-250>, White }
#declare CylY = cylinder { <0,-1,0>, <0,1,0>, 0.01
texture { pigment { color White }
finish { ambient 0 diffuse 0 emission 1 }
}
}
//------- Set up functional camera
#declare FnXrad = function (x) { (x+0.5)*tau }
#declare FnX = function (x) { cos(FnXrad(x)) }
#declare FnZ = function (x) { sin(FnXrad(x)) }
#declare Camera00 = camera {
user_defined
location {
function { FnX(x) }
function { y }
function { FnZ(x) }
}
direction {
function { -FnX(x) }
function { 0 }
function { -FnZ(x) }
}
}
//---
camera { Camera00 }
//camera { CameraP } // Use to see perspective view
light_source { Light00 }
object { CylY }
object { Text00 }
//--------------------- End demo --------------------------
Post a reply to this message
|
|