POV-Ray : Newsgroups : povray.programming : global settings in pre-scripted light definitions : global settings in pre-scripted light definitions Server Time
18 Sep 2021 04:13:10 EDT (-0400)
  global settings in pre-scripted light definitions  
From: Nieman
Date: 3 Aug 2016 07:15:01
Message: <web.57a1d1cddf429d49663f280c0@news.povray.org>
Hey all,

For creating images I use an pre-scripted textfile in which the light settings
are definded.
Now I need to setup some global settings which can not be setup within this
file.
The script of this file ist written below.
Is there any way to define global settings within an .ini file. Or is there any
command wihtin the script I can use. At my point of view it is not possible to
define global setting in this file, because this commands are read after the
model is rendered...

Thanks for any help!!


/////////////////////////////////////////////////////////////////



; MaxX=            240.0000
; MaxY=           0.0000000
; MaxZ=            500.0000
; MinX=           -260.0000
; MinY=           -400.0000
; MinZ=           0.0000000



CenterX = (MinX + MaxX) / 2.0
CenterY = (MinY + MaxY) / 2.0
CenterZ = (MinZ + MaxZ) / 2.0

CenterZ = CenterZ * -1.0  ; wegen POV hat KOS umgedreht
KameraZ = KameraZ * -1.0  ;
TargetZ = TargetZ * -1.0  ;


;Beispiel: Ein Spot links von der Scene plazieren ..




;SpotX = TargetX -400 ; // nach links
;SpotY = TargetY -6000;
;SpotZ = TargetZ;

Scene = 0;
n = 0
PovScene[Scene][0] = "Zwei Spots"            ; Erste zeile immer die
Definitionszeile




;Beispiel: Ein Spot rechts von der Scene plazieren .., aber ohne Schatten zu
werfen


SpotX = KameraX - 400
SpotY = KameraY - 6000
SpotZ = KameraZ




n = n+1
PovScene[Scene][n] = "light_source {  0*x   color rgb <1,1,1>    spotlight "
n = n+1
PovScene[Scene][n] = "translate <" + SpotX + "," + SpotY + "," + SpotZ + ">"
n = n+1
PovScene[Scene][n] = "point_at <" + CenterX + "," + CenterY + "," + CenterZ +
">"
n = n+1
PovScene[Scene][n] = "radius 180"
n = n+1
PovScene[Scene][n] = "tightness 50 "
n = n+1
PovScene[Scene][n] = "falloff 25"
n = n+1
PovScene[Scene][n] = "fade_distance 2000"
n = n+1
PovScene[Scene][n] = "fade_power 1"
n = n+1
PovScene[Scene][n] = "}"


;Beispiel: Ein Spot Mittig in der Scene plazieren



SpotX = CenterX
SpotY = MinY - 500
SpotZ = CenterZ

TargetX = TargetX -400;
TargetY = TargetY -6000

n = n+1
PovScene[Scene][n] = "light_source {  0*x   color rgb <1,1,1>    spotlight "
n = n+1
PovScene[Scene][n] = "translate <" + TargetX + "," + TargetY + "," + TargetZ +
">"
n = n+1
PovScene[Scene][n] = "point_at <" + CenterX + "," + CenterY + "," + CenterZ +
">"
n = n+1
PovScene[Scene][n] = "radius 180"
n = n+1
PovScene[Scene][n] = "tightness 50 "
n = n+1
PovScene[Scene][n] = "falloff 25"
n = n+1
PovScene[Scene][n] = "fade_distance 2000"
n = n+1
PovScene[Scene][n] = "fade_power 1"
n = n+1
PovScene[Scene][n] = "}"



Scene = Scene + 1


PovScene[Scene][1] = "light_source {  0*x   color rgb <1,1,1>    spotlight
fade_power 10"
PovScene[Scene][2] = "translate <" + KameraX + "," + KameraY + "," + KameraZ +
">"
PovScene[Scene][3] = "point_at <" + TargetX + "," + TargetY + "," + TargetZ +
">"
PovScene[Scene][4] = "radius 5"
PovScene[Scene][5] = "tightness 50 "
PovScene[Scene][6] = "falloff 20"
PovScene[Scene][7] = "}"

Scene = Scene + 1
PovScene[Scene][0] = "Einfaches helles Licht"
PovScene[Scene][1] = "light_source { <-5000, -25000, -25000> color White"
PovScene[Scene][2] = "fade_distance 100000 fade_power 2"
PovScene[Scene][3] = "}"

Scene = Scene + 1
PovScene[Scene][0] = "TEST"
PovScene[Scene][1] = "light_source {  0*x   color rgb <1,1,1>    spotlight"
PovScene[Scene][2] = "translate <" + KameraX + "," + KameraY + "," + KameraZ +
">"
PovScene[Scene][3] = "point_at <" + TargetX + "," + TargetY + "," + TargetZ +
">"
PovScene[Scene][4] = "radius 180"
PovScene[Scene][5] = "tightness 50 "
PovScene[Scene][6] = "falloff 25"
PovScene[Scene][7] = "fade_distance 2000"
PovScene[Scene][8] = "fade_power 1"
PovScene[Scene][9] = "}"
PovScene[Scene][10] = "light_source {  0*x   color rgb <1,1,1>    spotlight"
PovScene[Scene][11] = "translate <" + KameraX + "," + KameraY + "," + KameraZ +
">"
PovScene[Scene][12] = "point_at <" + TargetX + "," + TargetY + "," + TargetZ +
">"
PovScene[Scene][13] = "radius 180"
PovScene[Scene][14] = "tightness 50 "
PovScene[Scene][15] = "falloff 25"
PovScene[Scene][16] = "fade_distance 2000"
PovScene[Scene][17] = "fade_power 1"
PovScene[Scene][18] = "}"

//////////////////////////////////////////////////////////////////////////////


Post a reply to this message

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