TABLE OF CONTENTS


ScPovPlot3D/Cameras.inc [ Modules ]

[ Top ] [ Modules ]

PURPOSE

Very important toolkit defining some handy cameras TODO: still a lot!


VERSION

4.0.5, 2021-05-19 - tested on PovRay 3.7.0

AUTHOR

Janusz Opiła Ph.D.

   jmo{at}agh.edu.pl, janusz.opila{at}gmail.com
   Dept. of Applied Informatics, 
   https://www.facebook.com/KatedraInformatykiStosowanejWZAGH/
   http://kis.zarz.agh.edu.pl/
   AGH University of Science & Technology, Cracow, Poland http://www.zarz.agh.edu.pl/English/index.asp
   Maintained by Janusz Opiła Ph.D.
   Homepage: http://scpovplot3d.sourceforge.net   

HISTORY

2016-10-12, v3.2.0.7, IntelligentEyeT - Target was not applied 2016-03-02, v3.2.0.6

    - light_source added in InsertBarKeyFrItem, InsertBarKeyFrItemBelow definition

2016-02-12, v3.2.0.5

    - InsertKeyItem macro evolved into two: InsertBarKeyItem, InsertCylKeyItem. Minor improvements.
    - CameraTarget may be now re-setted.                     

2016-02-02, v3.2.0.3 - added InsertKeyItem() macro 2021-04-11, v4.0.4 - minor bug in 'range' control for 'CameraAngiel()' 2021-05-19, v4.0.5 - simple default perspective cameras FCamera() and FTiltedCamera() added;

COPYRIGHT

  GNU GPL v.3 License
  (c) 2012-now by Janusz Opiła Ph.D.         
  AGH University of Science and Technology

Cameras.inc/BirdsEye [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Bird eye camera. Gets position based on given spline Function _Spl and vector parameter _s Bird looks down his trajectory. (NOW)

SYNOPSIS

#macro BirdsEye ( _dst, _s )

INPUTS

  _Spl - spline Function - indirect
  _dst - distance parameter       
  _s   - camera position on the path 

SEE ALSO

SetPerspective () SetOrthographic () SetCameraTarget ()


Cameras.inc/CameraLights [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Addon lights (left&right) connected with camera placed next to it oriented on point defined in SetCameraTarget macro.

SYNOPSIS

#macro CameraLights (_Dist, _sep, _col, _fan, _rd) 

INPUTS

  _Dist- target-light distance (may be different from camera-target)
  _sep - separation between lights
  _col - light color
  _fan - falloff angle 
  _rd  - halftone radius 

SEE ALSO

SetCameraAngle () SetCameraShift () IntelligentEye () IntelligentEyeT ()


Cameras.inc/CameraOn [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Element of main camera subsystem. It tries to guess best position and viewing angle from the scene data and tries to guess best target point and adjust it by CameraShift, see SetCameraShift ()

SYNOPSIS

CameraOn (float Dist)

INPUTS

  Dist - float: distance from Target if using perspective camera(SetPerpective () set)

SEE ALSO

SetPerspective () SetOrthographic () SetCameraTarget ()


Cameras.inc/CameraSpher [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

This Camera looks at point set by SetTarget macro

SYNOPSIS

#macro CameraSpher (lam, phi, r)

INPUTS

  lam, phi, r -  floats: longitude[deg], latitude[deg], distance from actual watch point [scene units] 
                 possibly set/reset by SetCameraTarget () macro

SEE ALSO

SetCameraAngle () SetCameraShift () IntelligentEye () IntelligentEyeT ()


Cameras.inc/CameraSpher0 [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

This Camera is placed in spherical ccordinates and looks at point set by SetCameraTarget macro.

SYNOPSIS

#macro CameraSpher0 (lam, phi, r)

INPUTS

  lam, phi, r -  floats: longitude[deg], latitude[deg], distance from actual watch point [scene units] 
                 possibly set/reset by SetCameraTarget () macro

SEE ALSO

SetCameraAngle () SetCameraShift () IntelligentEye () IntelligentEyeT ()


Cameras.inc/CameraSpher1 [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

This Camera is placed relative to point set by SetCameraTarget macro, and looks at it. SYNOPSIS */

INPUTS

  lam, phi, r -  floats: longitude[deg], latitude[deg], distance from actual watch point [scene units] 
                 possibly set/reset by SetCameraTarget () macro

SEE ALSO

SetCameraAngle () SetCameraShift () IntelligentEye () IntelligentEyeT ()


Cameras.inc/CameraSpher2 [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

This Camera is placed relative to point set by SetCameraTarget macro, and looks at it. SYNOPSIS */

INPUTS

  lam, phi, r -  floats: longitude[deg], latitude[deg], distance from actual watch point [scene units] 
                 possibly set/reset by SetCameraTarget () macro, keeps moving toward object if "r" is negative, 

SEE ALSO

SetCameraAngle () SetCameraShift () IntelligentEye () IntelligentEyeT ()


Cameras.inc/FCamera [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Gets position _Loc and target point _AAt tilts by _T degrees, zooms by _Zoom, in or out

SYNOPSIS

#macro FCamera( _Loc  // camera location
              , _AAt  // aim camera at this point
              , _Zoom // Zoom xD
              )

INPUTS

  _Loc  - camera location in povray coords
  _AAt  - aim camera at this 3D povray point (really!)       
  _Zoom - Just zoom: >1 - zoom in, <1 - zoom out, negative values aren't interpreted 

SEE ALSO

none


Cameras.inc/FTiltCamera [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Tilted camera. Gets position _Loc and target point _AAt tilts by _T degrees, zooms by _Zoom, in or out

SYNOPSIS

#macro FTiltCamera( _Loc    // camera location
                  , _AAt    // aim camera at this point
                  , _Zoom   // Zoom xD
                  , _T      // camera tilt (or bank) in degrees (to the left 'minus')
                  )

INPUTS

  _Loc  - camera location in povray coords
  _AAt  - aim camera at this 3D povray point (really!)       
  _Zoom - Just zoom: >1 - zoom in, <1 - zoom out, negative values aren't interpreted 
  _T    - tilt or bank in degrees, minus left, positive right.

SEE ALSO

none


Cameras.inc/InsertBarKeyFrItem [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Inserts legend key with right hand extended Text description. Uses perpendicular prism as legend key. MUST be inserted just after using SetRGBMap () macro, as it purposely utilizes internal variable _RGBMap to keep scene consistent! As it uses Camera location data it must be used AFTER PrepareCamera () macro!

SYNOPSIS

#macro InsertBarKeyFrItem ( _Ts, _Ttext, _scf, _Krad, _vf, _frd ) // description, descr. texture, scal.factor, band wsdth, band. texture, position

INPUTS

  Text - description, 
  texture - description texture, 
  float - Text scaling factor, 
  float - legend key width, 
  float - position counted from bottom (not percent of image height by NOW)

OUTPUTS

  Legend key as POVRay object                                           

EXAMPLE

*  SetRGBMap(RGB5)
*  InsertBarKeyItem ( "V(r)", txMica, .09, .04, .054) 

SEE ALSO

InsertCylKeyItem


Cameras.inc/InsertBarKeyFrItemBelow [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Inserts legend key with extended Text description BELOW, centered. Uses perpendicular prism as legend key. MUST be inserted just after using SetRGBMap () macro, as it purposely utilizes internal variable _RGBMap to keep scene consistent! As it uses Camera location data it must be used AFTER PrepareCamera () macro!

SYNOPSIS

#macro InsertBarKeyFrItemBelow ( _Ts, _Ttext, _scf, _Krad, _vf, _frTxt, _frd ) // description, descr. texture, scal.factor, band wsdth, band. texture, position

INPUTS

  Text - description, 
  texture - description texture, 
  float - Text scaling factor, 
  float - legend key width, 
  float - position counted from bottom (not percent of image height by NOW)
  texture - "frame" texture
  float - width of "frame" 

OUTPUTS

  Legend key as POVRay object                                           

EXAMPLE

*  SetRGBMap(RGB5)
*  InsertBarKeyFrItemBelow ( "V(r)", txYellow, .09, .04, .054, txMica, .02) 

SEE ALSO

InsertCylKeyItem


Cameras.inc/InsertBarKeyItem [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Inserts legend key with right hand extended Text description. Uses perpendicular prism as legend key. MUST be inserted just after using SetRGBMap () macro, as it purposely utilizes internal variable _RGBMap to keep scene consistent! As it uses Camera location data it must be used AFTER PrepareCamera () macro!

SYNOPSIS

#macro InsertBarKeyItem ( _Ts, _Ttext, _scf, _Krad, _vf ) // description, descr. texture, scal.factor, band wsdth, band. texture, position

INPUTS

  Text - description, 
  texture - description texture, 
  float - Text scaling factor, 
  float - legend key width, 
  float - position counted from bottom (not percent of image height by NOW)

OUTPUTS

  Legend key as POVRay object                                           

EXAMPLE

*  SetRGBMap(RGB5)
*  InsertBarKeyItem ( "V(r)", txMica, .09, .04, .054) 

SEE ALSO

InsertCylKeyItem


Cameras.inc/InsertCylKeyItem [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Inserts legend key with right hand extended Text description. Uses cylinder as legend key. MUST be inserted just after using SetRGBMap () macro, as it purposely utilizes internal variable _RGBMap to keep scene consistent! As it uses Camera location data it must be used AFTER PrepareCamera () macro!

SYNOPSIS

#macro InsertCylKeyItem ( _Ts, _Ttext, _scf, _Krad, _vf ) // description, descr. texture, scal.factor, band wsdth, band. texture, position

INPUTS

  Text - description, 
  texture - description texture, 
  float - Text scaling factor, 
  float - legend key width, 
  float - position counted from bottom (not percent of image height by NOW)

OUTPUTS

  Legend key as POVRay object                                           

EXAMPLE

*  SetRGBMap(RGB5)
*  InsertCylKeyItem ( "V(r)", txMica, .09, .04, .054) 

SEE ALSO

InsertBarKeyItem


Cameras.inc/IntelligentEye [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

tries to guess best target point, NO adjustment to camera position

SYNOPSIS

IntelligentEye (lam, phi, r)

INPUTS

  lam, phi, r -  floats: longitude[deg], latitude[deg], distance from actual watch point [scene units] 
                 possibly set/reset by SetCameraTarget () macro

SEE ALSO

SetCameraAngle () SetCameraTarget () IntelligentEyeT ()


Cameras.inc/IntelligentEyeT [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

tries to guess best target point AND adjust camera position by CameraShift in REAL coords set by SetCameraShift () macro

SYNOPSIS

IntelligentEyeT (lam, phi, r)

INPUTS

  lam, phi, r -  floats: longitude[deg], latitude[deg], distance from actual watch point [scene units] 
                 possibly set/reset by SetCameraTarget () macro

SEE ALSO

SetCameraAngle () SetCameraShift () IntelligentEye ()


Cameras.inc/PrepareCamera [ Main macros ]

[ Top ] [ Cameras.inc ] [ Main macros ]

PURPOSE

Element of main camera subsystem. Ought to be placed before scene description as macros could be informed about camera position: this is for future smart and sophisticated extensions ;) Must be followed by call to CameraOn () macro

SYNOPSIS

#macro PrepareCamera (_lam, _phi, _r)
  // lam : longitude: angle from '-z' axis(PovRay) ie. 'x' axis in real world
  // phi : angle above POvRay '-z*x' plane -> X*Y plane in real world: latitude
  // r   : distance from XYZ origin

INPUTS

  _lam, _phi, _r -  floats: longitude[deg], latitude[deg], distance from actual watch point [scene units] 
                 possibly set/reset by SetCameraTarget () macro. If _r<>1 then SET CameraOn (r) with r=1!
                 or unexpected behaviour may be observed.   

SEE ALSO

CameraOn () SetPerspective () SetOrthographic () SetCameraTarget ()


Cameras.inc/SetCameraAngle [ Helper macros ]

[ Top ] [ Cameras.inc ] [ Helper macros ]

PURPOSE

tries to guess best target point and adjust it by CameraShift, see SetCameraShift(ShftVec)

SYNOPSIS

#macro SetCameraAngle (_ang)   // sets camera horizonta viewing angle

INPUTS

  Angle - valid float expression in degrees

SEE ALSO

SetCameraShift () SetCameraTarget ()


Cameras.inc/SetCameraShift [ Helper macros ]

[ Top ] [ Cameras.inc ] [ Helper macros ]

PURPOSE

shifts vector and adjust default LookAt point: CameraTarget=CameraTarget+CameraShift

SYNOPSIS

#macro SetCameraShift (ShftVec) // Shift vector adjust default LookAt point: CameraTarget=CameraTarget+CameraShift

INPUTS

  ShftVec - valid 3D vector expression in REAL coordinates

SEE ALSO

SetCameraAngle () SetCameraTarget ()


Cameras.inc/SetCameraTarget [ Helper macros ]

[ Top ] [ Cameras.inc ] [ Helper macros ]

PURPOSE

defines point in space to watch on WARNING: POVRay coordinates!

SYNOPSIS

#macro SetCameraTarget (XX, YY, ZZ)

INPUTS

  XX, YY, ZZ - POVRay coordinates of the target point

SEE ALSO

SetCameraAngle () SetCameraShift ()


Cameras.inc/SetLabelWidth [ Helper macros ]

[ Top ] [ Cameras.inc ] [ Helper macros ]

PURPOSE

defines intended Label Width

SYNOPSIS

#macro SetLabelWidth (_LW)

INPUTS

  positive float

SEE ALSO

none


Cameras.inc/SetOrthographic [ Helper macros ]

[ Top ] [ Cameras.inc ] [ Helper macros ]

PURPOSE

defines orthografic camera

SYNOPSIS

SetOrthographic (float OSc)

INPUTS

  OSc - float: scaling factor

SEE ALSO

SetPerspective ()


Cameras.inc/SetPerspective [ Helper macros ]

[ Top ] [ Cameras.inc ] [ Helper macros ]

PURPOSE

defines perspective camera

SYNOPSIS

#macro SetPerspective  ()

INPUTS

  no inputs

SEE ALSO

SetOrthographic ()


Cameras.inc/SceneMinX, SceneMaxX, SceneMinY, SceneMaxY, SceneMinZ, SceneMaxZ, CameraTarget, CameraShift, CameraAngle [ Variables ]

[ Top ] [ Cameras.inc ] [ Variables ]

PURPOSE

Internal variables set by relevant macros or automatically by scene itself

SEE ALSO

SetCameraTarget () SetCameraShift () SetCameraAngle ()

SOURCE

#declare SceneMinX    =  0.0;        // these variables defines bounding box for the whole scene
#declare SceneMaxX    =  0.0;        // they are utilized by some macros to determine camera parameters
#declare SceneMinY    =  0.0;
#declare SceneMaxY    =  0.0;
#declare SceneMinZ    =  0.0;
#declare SceneMaxZ    =  0.0; 
#declare CameraAngle  =  35 ;        // camera viewing angle
#declare CameraAngleSet = false;     // default setting is "no explicit setting"
#declare CameraTarget = <0, 0, 0>;   // virtual point Camera looks at
#declare CameraShift  = <0, 0, 0>;   // additional shift in camera position