cspiral-plugin for POV-Ray 3.0 1997 Christoph Schuette christoph.schuette@telelev.net ---------------------------------------------- Please be aware that this is not the final version of the cspiral-plugin and the doc. There will be some changes. Please send me eMail with your questions or suggestions, so i can enhance it. ---------------------------------------------- "Into the spiral the cybernautic dream" ---------------------------------------------- What can cspiral do for you ? cspiral renders spiralforms depending on parameters you set up Tutor.pov is a good place to start. ---------------------------------------------- How do I install it ? POV-Ray uses a directory for all Include files that you want to access globally, "include" located in your POV Directory. Copy the file "cspiralv.inc" into this directory and you can access it from everywhere you need it. ---------------------------------------------- How can I use it ? There are several ways ! At first create a parameter file like the following and save it as a POV file, i decided to give these files the extension "csp" (cspiral parameter), but do it as you wish. //This is the cspiral-logo ! //spike.csp //init------------------------- #declare px=0 #declare py=0 //variable--------------------- #declare h=6 #declare i =360 #declare k=20 #declare m=1 #declare hv=0 #declare l=0 #declare lv=1.5/360 #declare com_al=1 #declare sizer=1 #declare sz=0 #declare c_fade_in=0.0025 #declare c_fadeout=0.00125 #declare c_al=5 #declare s_fade_in=10/360//0.0012 #declare s_fadeout=10/360//0.0012 #declare max_size=0.2 #declare min_size=0.01 //----------------------------- #ifndef(test_it) light_source{<-6,10,0> rgb 1} include "cspiralv.inc" camera{ location<0, 9.5,0> look_at < 0,0, 0>} #end The above means that if test_it was not defined you can take a look at your creation. So if you want to render more spiralforms as a scene declare test_it and the main camera and light is used in your scene. The included "demo.pov" shows how to do that. //Demo.pov //Author:Christoph Schuette //Desc :Draws multiple spiral forms // Into the spiral the cybernautic dream //Environment. Pov-Ray 3.0 #declare test_it=1 //camera and light off in parameter file include "spiral.csp" include "cspiralv.inc" include "armstar.csp" include "cspiralv.inc" include "truespira.csp" include "cspiralv.inc" include "snake.csp" include "cspiralv.inc" light_source{<-6,10,0> rgb 1} camera{ location<0, 9,0> look_at < 0,0, 0>} In the above you see you just have to inlude the following lines include "spiral.csp" include "cspiralv.inc" to render a spiralform. ------------------------------------------- Redefinition?! A redefinition changes previous values stored in memory. Ah, you have that nice spiralform and it could look a bit more like, or you just want the spiralform in another place, then take look at this: include "spiral.csp" //now override the loaded values to move the spiral to //another place #declare px=10 //position x #declare py=5 //position z #declare h=4 //position in height //you can do this with every parameter cspiral uses. //now render it include "cspiralv.inc" I want to rotate it! Ok, then you could do this: #declare spiralform= union{ include "spiral.csp" include "cspiralv.inc" } object{spiralform rotate x*45} -------------------------------------------------------------------- px and py is the postion for the spiral in pov-space this can be used for multiple spiralforms in a scene see demo.pov and scene.pov. #declare px=0 #declare py=0 h is the height where the spiral starts #declare h=4 i is the angle #declare i=90 k computes how often i is in a full circle if com_al is 4 for example i=60 & k=i/360 give six arms but, you can also say i want 4 arms, so divide 1 by 4, thats 0.25 and set k to this value if com_al is 1 you should change k to 360/i and you get a spiral also if com_al = 2, k also should be 360/i to get a spiral but if you set it to a value greater than zero the when com_al = 3, k also should be 360/i this can give a different effect take a look at "com_al3.pov" This is the most hardest part, so if you get just one "arm" eg one leaf try changing k as mentioned above. It is not implemented yet to change k automatically because some values can produce some incredible objects. This and the constants may change in the future. The algorithm of cspiral can produce so many different objects in size and look, so try everything you can. I've tried everything not to wait too long for rendering and !not to crash POV! I'm always reachable via e-mail. In the "csplib\*.csp" files there are values divided by or through 360, this is a magic number for color & size. #declare k=i/360 m times to render #declare m=5 //depth com_al is a constant to compute the position of the object in the spiral value 1 : pi/180 2 : pi/180 & 2*pi 3 : (22/7)/180 4 : 2*pi 5 : sin((lv+hv)*cos(pi/180)) 6 : 1 #declare com_al=4 hv is the value for the change of height to the previous if you look from above a postive value lets it go down if it is negative it will grow up if hv has a value of 0 the height will stay the same*/ #declare hv=2/360 //difference of height to previous l is the initial radius #declare l=2 lv is the amount for changing the radius if you use a negative value hv(change of height)& l(initial radius) should be greater than zero! a way to create coils is to set l greater 0 and lv to 0, in this case hv also should be greater than zero. #declare lv=-2/360 //difference of radius tv a value that will be added to the angle to bend or to speed up an spiralarm tv should be proportional to hv or lv if you only produced one arm but it looks good you can use tv tomake a spiral out of it. #declare tv=lv min_radius, max_radius these define ranges for the radius, if lv is negativ and you don't want the radius to be smaller than a defined value #declare max_radius=0.5 if you don't want the radius greater than a specified value than #declare min-radius=3 !there is a small bug in the routine sizer is a switch for sizing the objects which are used to render the spiral 0 means off the maximum_size of the object will be used 1 means on max_size and min_size will take effect */ #declare sizer=1 #declare sz=0 c_fade_in is the up-speed for the colorchange #declare c_fade_in=.5/360 c_fadeout is the down-speed for colorchange #declare c_fadeout=1.5/360 c_al is the algorithm to compute the color 0 : set this if you want to use c_com 1 : blue to orange 2 : orange to blue 3 : black to white 4 : an ammonit color 5 : is a toxic one 6 : something green 7 : Blue, White & Black*/ #declare c_al=6 c_com is a string representing a "rgb-code", "+" means the value defined for red, green or blue will be added to black, so "-" means the defined value will be substracted from white it is always three chars long, if it is incorrect you will see a warning indicating the error, the string will be "+++" I have included all possible (8) combinations. r_v represents defines the value for red, g_v the green value and b_v the blue value, if any of these are not defined or the value is zero the default is null. If you want to define a constant value for red, green or blue you can define it with r_constant, g_constant and b_constant the color for this part will not change and the others are mixed to this color, but it will only take effect if r_v, g_v or b_v is set to zero. Tip: if you want to invert the defined color just change the + to - and - to + #declare c_com="+++" #declare r_v=0.1 #declare r_constant=1 #declare g_v=0.5 #declare g_constant=1 #declare b_v=0.1 #declare b_constant=1 c_finish defines the finish for your object if it is not defined the default is ambient 0.5*/ #declare c_finish=finish{ ambient .3 reflection 0.3 crand .5} s_fade_in is the value for the up-size change #declare s_fade_in=0.15/360//0.012 s_fadeout is the value for the down-size change #declare s_fadeout=0.15/360//0.02 max_size is the value for the objects maximum size #declare max_size=0.2 min_size is the value of the objects minimum size !if you use zero or a negative number pov will crash !and maybe your file is lost! #declare min_size=0.05 user_pigment can be used to define your own texture for the object c_al wont be used in this case #declare user_pigment= texture{ pigment{ bozo turbulence 1.2 color_map{ [0 rgb<1,1,1>] [0.3 rgb<0,1,0>] [0.2 rgb<1,0,0>] [0.8 rgb<0,1,0>] } } finish {ambient .3 } } user_obj the shape which will be used to render the spiral if it is not defined a sphere is the default #declare user_obj=triangle { < 0, 0, 0>, < 1, 0, 0>, < 1, 0, 2> } rotate_obj_x, rotate_obj_y, rotate_obj_z can be used to rotate the user object in the x, y , z direction if you only want it to rotate in the x diretion then #declare rotate_obj_x=1, but if you also want y rotated #declare rotate_obj_y=1, theres on more chance for z #declare rotate_obj_z=1. (1=rotation on / 0=rotation off) the amount for the rotation is set by rot_val_x, rot_val_y and rot_val_z #declare rotate_obj_x=1 #declare rot_val_x=18 #declare rotate_obj_y=1 #declare rot_val_y=36 #declare rotate_obj_z=1 #declare rot_val_z=72 //----------------------------- test_it is a switch to look at your creation before it is included in a scene, in your scene you should #declare test_it=0 to undefine the camera, if it is not declared the last camerasetting will take effect and light will be everywhere positioned! #declare report=0 will give some information about the rendering. #ifndef(test_it) light_source{<1,10,0> rgb 1} finally we need "cspiralv.inc" to render the whole spiralform include "cspiralv.inc" camera{ location<1, 10,-2> look_at < 0,0, 0>} #end