diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /klines/povray | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'klines/povray')
-rw-r--r-- | klines/povray/ball.pov | 289 | ||||
-rwxr-xr-x | klines/povray/balls.sh | 13 | ||||
-rwxr-xr-x | klines/povray/clean.sh | 2 | ||||
-rw-r--r-- | klines/povray/field.pov | 31 | ||||
-rwxr-xr-x | klines/povray/field.sh | 5 | ||||
-rwxr-xr-x | klines/povray/fire.sh | 9 | ||||
-rwxr-xr-x | klines/povray/makeballs.sh | 36 | ||||
-rw-r--r-- | klines/povray/povray.ini | 59 |
8 files changed, 444 insertions, 0 deletions
diff --git a/klines/povray/ball.pov b/klines/povray/ball.pov new file mode 100644 index 00000000..16d577ed --- /dev/null +++ b/klines/povray/ball.pov @@ -0,0 +1,289 @@ +/*************************************************************************** + ball.pov - script for rendering Kolor Lines graphics + ------------------- + begin : Fri May 19 2000 + copyright : (C) 2000 by Roman Razilov + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#version 3.0 + +// Objectname = Main View +// Objecttype = view + +// This camera is build for ratio 451:277 +#include "colors.inc" +#include "textures.inc" +#declare BallColor = Green +#include "clr.inc" + +#declare CELLSIZE = 32 +#declare PIXTIME = 10 +#declare BALLDOWN = 3 +#declare BALLSPACE = 4 + +#warning concat("XXXX clock:",str(clock,5,2),"\n") + +#switch (clock) +// --------------------burning ball------------------- + #range (0,1.001) + + #declare explosion = 1 + #declare jump = 0 + #declare n = 0 + + #declare t0 = 0 + #declare t1 = 0.2 + #declare t2 = 0.5 + #declare t3 = 0.8 + #declare t4 = 1 + #declare tt = clock + #if ( tt = t0 ) + //turbulence + #declare tur = 0 + #declare trb = 0 + #declare trf = 0 + #declare pf = 0 + #end + #if ( tt > t0 & tt <= t1 ) + #declare tl = (tt - t0)/(t1-t0) + #declare tur = 3+(0.2-3)*tl + #declare trb = 0+(0-0)*tl + #declare trf = 1+(3-1)*tl + #declare pf = 0+(0.3-0)*t1 + #end + #if ( tt > t1 & tt <= t2 ) + #declare tl = (tt - t1)/(t2-t1) + #declare tur = 0.2+(0.5-0.1)*tl + #declare trb = 0+(1-0)*tl + #declare trf = 3+(1-3)*tl + #declare pf = 0.3+(0.2-0.3)*t1 + #end + #if ( tt > t2 & tt <= t3 ) + #declare tl = (tt - t2)/(t3-t2) + #declare tur = 0.5+(2-0.5)*tl + #declare trb = 1+(1-1)*tl + #declare trf = 1+(1-1)*tl + #declare pf = 0.2-(0.0-0.2)*t1 + #end + #if ( tt > t3 ) + #declare tl = (tt - t3)/(t4-t3) + #declare tur = 2+(5-2)*tl + #declare trb = 1+(1-1)*tl + #declare trf = 1+(0-1)*tl + #declare pf = 0.0-(0.0-0.0)*t1 + #end + // ball position / size + #declare by = 0 + #declare bh = CELLSIZE-2-BALLSPACE + #declare bw = CELLSIZE-2-BALLSPACE + #break +// ----------------borning ball---------------------- + #range (5,6.001) + + #declare explosion = 0 + #declare jump = 0 + + // fire turbulence + #declare tur = 0 + // trancperancy ball + #declare trb = 0 + // trancperancy fire + #declare trf = 0 + // lambda + #declare pf = 0 + // relative clock + #declare tt = clock - 5 + // y position + #declare by = 0 + #declare r=sqrt(tt) + #declare bh = (CELLSIZE-2-BALLSPACE)*r + #declare bw = (CELLSIZE-2-BALLSPACE)*r + // normal + #declare n = (1-tt)*r*2 + + #break + + // -------------jumping ball---------------------- + #range (10,11.001) + #declare explosion = 0 + #declare jump = 1 + #declare tur = 0 + #declare trb = 0 + #declare trf = 0 + #declare pf = 0 + #declare n = 0 + #declare tt = clock - 10 + // ball free fall: y = -(g * t^2)/2 + // ball jums on X*sin( sqrt(k)*(t0 - t1 + t ) ) + // t whole motion time + // g - gravity acceleration + // A - frei movement amplitude + // BB way with deflation + #declare A = BALLDOWN + #declare B = BALLSPACE + #declare ta = PIXTIME + #declare k = (pi + 2*sqrt( B*(A+B))/A - acos( A/(A+2*B)) )/ta + #declare k = k*k + #warning concat("XXXX k:",str(k,5,2),"\n") + #declare g = k*A*A/(2*(A+B)) + #warning concat("XXXX g:",str(g,5,2),"\n") + #declare t1 = sqrt(2*B/g) + #warning concat("XXXX t1:",str(t1,5,2),"\n") + #declare X = A*(A+2*B)/(2*(A+B)) + #warning concat("XXXX X:",str(X,5,2),"\n") + + #declare tc = PIXTIME - tt*PIXTIME + + #warning concat("XXXX tc:",str(tc,5,2),"\n") + // ball position + #if (tc < t1) + #declare by = B/2 - g*tc*tc/2 + #else + #declare by = -B/2 - g/k - X*cos( sqrt(k)*(ta-tc)) + #end + #if ( by < -2 ) + #declare bh=CELLSIZE-2+2*by + #declare bw = CELLSIZE-2-BALLSPACE+(-by-2) + #else + #declare bh = CELLSIZE-2-BALLSPACE + #declare bw = CELLSIZE-2-BALLSPACE + #end + + #break + + #else + #warning " ERROR, clock out of range !!! \n" + +#end + + +#warning concat("XXXX clock:",str(clock,5,2),"\n") + +#warning concat("XXXX tt:",str(tt,5,2),"\n") + + + + + +camera +{ + orthographic + location <0,0,-100> + look_at <0,0,0> + up (CELLSIZE-2)*y + right (CELLSIZE)*x +} + +// Global settings +global_settings +{ + ambient_light rgb<0.5,0.5,0.5> +} +light_source +{ + <-400, 600, -600> + color White + cylinder + radius 200 + falloff 1000 + tightness 1 + point_at <0,0,0> +} +// Background +background +{ + color rgb<.5,.5,.5> +} + +// fire +#if (explosion = 1) +sphere { 0, 1 + pigment { color rgbt<0,0,0,1> + } + halo { + emitting + spherical_mapping + poly + max_value 40 + exponent 0.1 + linear + turbulence tur +// phase pf + lambda 2-pf + frequency 1 + octaves 6 + color_map { + [ 0 color rgbt <1, 0, 0, 1> ] + [ 0.2 color rgbt <1, 0, 0, 1-1*trf> ] + [ 0.5 color rgbt <1, 0, 0, 1-3*trf> ] + [ 0.9 color rgbt <1, 1, 0, 1-4*trf> ] + [ 1 color rgbt <1, 1, 0.5, 1-6*trf> ] + } + samples 30 + } + hollow + scale<15,15,15> + translate <-0.5,-0.5,0> + } +#end +// Ball +#if ( trb < 1 & bh > 0 ) +sphere +{ + <0,0,0>,1 + pigment { + + wood +// agate_turb 0.5 + turbulence .1 + frequency 2 +// lambda + rotate <30,10,15> + color_map { + [0.5 BallColor transmit trb] + [0.3 BallColor*0.95 transmit trb] + [0.2 BallColor*0.9 transmit trb] + } + } + no_shadow + #if ( n > 0 ) + normal + { + //wood 0.5 + //frequency 2 + //turbulence .1 + //rotate <30,10,15> + bumps n + scale 0.3 + } + #end + finish { + ambient 0.3 + diffuse 0.8 + specular 1 + roughness 0.001 + reflection .1 + phong 0.9 * ( 1-trb) + phong_size 60 + + } + #if (trb > 0) + hollow + #end + scale <bw/2,bh/2,bw/2> + translate <-0.5,by - 0.5,0> + +#warning concat("XXXX by:",str(by,5,2),"\n") +#warning concat("XXXX bh:",str(bh,5,2),"\n") +#warning concat("XXXX bw:",str(bw,5,2),"\n") +} +#end diff --git a/klines/povray/balls.sh b/klines/povray/balls.sh new file mode 100755 index 00000000..1897afaa --- /dev/null +++ b/klines/povray/balls.sh @@ -0,0 +1,13 @@ +#!/bin/sh +echo "#declare BallColor = $2" >clr.inc +#### jumping balls +povray -w30 -h30 -V1 -P +A +KI10 +KF11 +KFF10 -Iball.pov +Oa$1.tga +#### borning balls +povray -w30 -h30 -V1 -P +A +KI5 +KF6 +KFF6 +SF2 +EF5 -Iball.pov +Ob$1.tga +#### burning balls balls +povray -w30 -h30 -V1 -P +A +KI0 +KF1 +KFF11 +SF1 +EF5 -Iball.pov +Oe$1.tga + +montage -geometry 30x30 -tile 100x1 -page 570x30 a$1??.tga b$1?.tga e$1??.tga bl_$1.tga +mogrify -crop 570x30+0+0 bl_$1.tga + + diff --git a/klines/povray/clean.sh b/klines/povray/clean.sh new file mode 100755 index 00000000..df78c905 --- /dev/null +++ b/klines/povray/clean.sh @@ -0,0 +1,2 @@ +#!/bin/sh +rm *.tga *.jpg
\ No newline at end of file diff --git a/klines/povray/field.pov b/klines/povray/field.pov new file mode 100644 index 00000000..1256c733 --- /dev/null +++ b/klines/povray/field.pov @@ -0,0 +1,31 @@ +#declare CELLSIZE = 32 +#include "colors.inc" + +camera +{ + orthographic + location <0,0,-100> + look_at <0,0,0> + up (CELLSIZE-2)*y + right (CELLSIZE)*x +} +// Global settings +global_settings +{ + ambient_light rgb<0.5,0.5,0.5> +} +light_source +{ + <-400, 600, -600> + color White + cylinder + radius 100 + falloff 1000 + tightness 1 + point_at <0,0,0> +} +background +{ + color rgb<.5,.5,.5> +} + diff --git a/klines/povray/field.sh b/klines/povray/field.sh new file mode 100755 index 00000000..f4a784d2 --- /dev/null +++ b/klines/povray/field.sh @@ -0,0 +1,5 @@ +#!/bin/sh +if (povray -w32 -h32 -V1 -P +A +K10 -Ifield.pov +Ofield.tga) +then + mogrify -raise 1x1 field.tga +fi diff --git a/klines/povray/fire.sh b/klines/povray/fire.sh new file mode 100755 index 00000000..2b6b5f9a --- /dev/null +++ b/klines/povray/fire.sh @@ -0,0 +1,9 @@ +#! /bin/sh +echo "#declare BallColor = White" >clr.inc +if (povray -w30 -h30 -V1 -P +A +KI0 +KF1 +KFF11 +SF6 +EF10 -Iball.pov \ ++Ofire.tga) +then # mogrify -raise 1x1 e$1??.tga + montage -geometry 30x30 -tile 100x1 -page 150x30 fire*.tga fire.tga + mogrify -crop 150x30+0+0 fire.tga +# animate -delay 7 $1??.tga +fi diff --git a/klines/povray/makeballs.sh b/klines/povray/makeballs.sh new file mode 100755 index 00000000..62769605 --- /dev/null +++ b/klines/povray/makeballs.sh @@ -0,0 +1,36 @@ +#! /bin/sh +#### clean + +clean.sh + +#### render + +field.sh +fire.sh +balls.sh Red "rgb<1,0,0>" +balls.sh Green "rgb<0,1,0>" +balls.sh Blue "rgb<0,0,1>" +balls.sh Yellow "rgb<1,1,0>" +balls.sh Violet "rgb<1,0,1>" +balls.sh Cyan "rgb<0,1,1>" +balls.sh Brown "rgb<1/2,1/3,0>" + +#### montage balls ( 20x7 cells each 30x30) + +montage -geometry 570x30 -tile 1x10 bl_*.tga balls.tga +mogrify -crop 570x210+0+0 balls.tga + +#### convert to jpeg + +convert -quality 95 balls.tga balls.jpg +convert -quality 95 fire.tga fire.jpg +convert -quality 95 field.tga field.jpg + + +#### copy to data + +cp *jpg ../ + +#### clean + +#clean.sh
\ No newline at end of file diff --git a/klines/povray/povray.ini b/klines/povray/povray.ini new file mode 100644 index 00000000..22ddf8ec --- /dev/null +++ b/klines/povray/povray.ini @@ -0,0 +1,59 @@ +; PERSISTENCE OF VISION RAY TRACER +; +; POV-Ray VERSION 3.0 +; +; SAMPLE POVRAY.INI FILE +; +; This file contains options which control how POV-Ray does its job. +; The file should be placed in the same directory as POVRAY.EXE and +; it will automaticaly read when POVRAY is run. +; +; The general form of the options is "Variable=value". Everything +; between the equals sign and the end of the line is considered part +; of the value. The spacing and layout is free-form but only one option +; per line is allowed. Variables and values are not case-sensitive. +; +; Note: characters after a semi-colon are treated as a comment +; +; Traditional POV-Ray switches beginning with + or - are also allowed +; and they may be given with more than one switch per line. +; +; These options have been put in this file because they will help +; you get up and running quickly. This file assumes you have installed +; the program in the /usr/local/lib directory. If you have installed +; the program on a directory you must edit the Library_Path lines below. +; See the general and Linux specific documentation for full instructions +; on how to use INI options. +; +; Add your own options at the bottom and/or edit these to suit. +; +; +; Width of image in pixels. Accepts integer values. +; +Width = 320 +; +; +; Height of image in pixels. Accepts integer values. +; +Height = 240 +; +; +; Turns pause when done feature off/on. Accepts boolean values. +; +Pause_when_Done = on +; +; +; Sets minimum number of objects before auto bounding kicks in. +; +Bounding_Threshold = 3 +; +; +; Test for user abort with any keypress every 100 pixels. +; +Test_Abort=On +Test_Abort_Count=100 +; +; Specify path to search for any files not found in current +; directory. Up to 25 such paths may be specified. +Library_Path=/usr/lib/povray3 +Library_Path=/usr/lib/povray3/include |