POV-Ray : Newsgroups : povray.documentation.inbuilt : Initial draft for 3.7.1 user_defined camera documentation & demo scene. Please review. Server Time
28 Mar 2024 16:26:44 EDT (-0400)
  Initial draft for 3.7.1 user_defined camera documentation & demo scene. Please review. (Message 1 to 3 of 3)  
From: William F Pokorny
Subject: Initial draft for 3.7.1 user_defined camera documentation & demo scene. Please review.
Date: 6 Jun 2016 16:04:09
Message: <5755d739$1@news.povray.org>
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

From: Jim Holsenback
Subject: Re: Initial draft for 3.7.1 user_defined camera documentation & demoscene. Please review.
Date: 21 Sep 2016 13:29:52
Message: <57e2c390$1@news.povray.org>
On 6/6/2016 4:04 PM, William F Pokorny wrote:
> 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.

this ones done too: http://wiki.povray.org/content/Reference:Camera


Post a reply to this message

From: William F Pokorny
Subject: Re: Initial draft for 3.7.1 user_defined camera documentation &demoscene. Please review.
Date: 22 Sep 2016 03:06:34
Message: <57e382fa$1@news.povray.org>
On 09/21/2016 01:29 PM, Jim Holsenback wrote:
> On 6/6/2016 4:04 PM, William F Pokorny wrote:
>> 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.
>
> this ones done too: http://wiki.povray.org/content/Reference:Camera
>
Thanks Jim! The update looks good to me.

Bill P.


Post a reply to this message

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