POV-Ray : Newsgroups : povray.text.scene-files : Differential rotation Server Time
25 Dec 2024 23:38:51 EST (-0500)
  Differential rotation (Message 1 to 2 of 2)  
From: Bob
Subject: Differential rotation
Date: 5 Jun 1999 10:25:46
Message: <37593344.9D2CD3DF@aol.com>
Differential spiral rotation script. The number of "rings", as it were,
could be increased of course to refine the adjacent rotations. This is
basically a simple example of the effect. The important factor would be
the rotation ratios if to be looped in animation (that is the idea after
all). In this case the number of spiral arms being 4 matches up with the
360, 270 and 90 degree amounts turned by the 'clock'.

//BEGIN
/* A simple way to fake differential rotation of a spiral galaxy, etc.
The number of textures, S1...Sn, could be increased. The 'onion' pattern
is used to mask off the spiral pattern.
*/

// white pointlight at camera position
#declare LCX = 0;
#declare LCY = 0;
#declare LCZ = -10;

light_source { <LCX,LCY,LCZ> color rgb 1.5
}
camera
{ fisheye //to enclose this particular scene
  location  <LCX,LCY,LCZ>
  up y right x //squared off for this also
  angle 22.5
  look_at   <0, 0, 0>
}

// ring or band textures
#declare S1 =
 texture {pigment {spiral1 4 color_map {
		[0 color rgb 0]
		[1 color rgb 1]
 } //rotate 0*z //offset if any
 } }
texture {pigment {onion color_map {
		[0 color rgbt 1]
		[.25 color rgbt 0]
 } } scale 2 //all scales were for a example animation render
}

#declare S2 =
 texture {pigment {spiral1 4 color_map {
		[0 color rgb 0]
		[1 color rgb 1]
 } //rotate 0*z //offset if any
 } }
texture {pigment {onion color_map {
		[0 color rgbt 0]
		[.25 color rgbt 1]
		[.5 color rgbt 0]
 } } scale 2
}

#declare S3 =
 texture {pigment {spiral1 4 color_map {
		[0 color rgb 0]
		[1 color rgb 1]
 } //rotate 0*z //offset if any
 } }
texture {pigment {onion color_map {
		[.25 color rgbt 0]
		[.5 color rgbt 1]
		[1 color rgbt 0]
 } } scale 2
}

//spiral texture surface
plane {z,0
	texture {average texture_map {
		[1 S1 rotate clock*360*z]
		[1 S2 rotate clock*270*z]
		[1 S3 rotate clock*90*z]
 } } scale 1.25
}
//END


-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Bob
Subject: Re: Differential rotation
Date: 6 Jun 1999 04:14:12
Message: <375A2DB9.8F710084@aol.com>
// Persistence of Vision Ray Tracer Scene Description File
// File: slipping.pov
// Vers: 3.1
// Desc: A way to slip textures past one another in a circle at different
rates
// Date: 99.425
// Auth: Bob Hughes  mailto://inversez@aol.com?Subject=PoV-Scene
// Note: the second #switch in each defined layered texture will not work.
// This scene hasn't been made to be adjustable for other situations, just
an example.

// white pointlight at camera position
#declare LCX = 0;
#declare LCY = -10;
#declare LCZ = -10;

light_source { <LCX,LCY,LCZ> color rgb <1,1.25,1.5>
}
camera
{ //fisheye //to enclose this particular scene
  location  <LCX,LCY,LCZ>
  up y right 4/3*x //squared off for this also
  angle 44//34
  look_at   <0, -1.66, 0>
}

#declare TA = 0; //turbulence amount (does not work for looped animation)

  //1 ramp, 2 sine, 3 scallop, 0 or other default triangle_wave
#declare WT1 = 0;
#declare WT2 = 3;

// spiral arms in ring (banded) textures

#declare S1 =
 texture {pigment {spiral1 4 turbulence .05*TA color_map {
		[0 color rgb .5]
		[1 color rgb 1.5]
 }
#switch (WT1)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
 //rotate 0*z
  }   normal {granite .25 scale .01}
       finish {ambient <.2,.3,.4>*3 diffuse .5}	
 }
texture {pigment {onion turbulence .1*TA color_map {
		[0 color rgbt 1]
		[.125 color rgbt 0]
 } //sine_wave
/*
#switch (WT2)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
*/
  }   normal {granite .25 scale .001}
 scale 3
}

#declare S2 =
 texture {pigment {spiral1 4 turbulence .05*TA color_map {
		[0 color rgb .25]
		[1 color rgb 1.25]
 }
#switch (WT1)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
 //rotate 0*z
  }   normal {granite .25 scale .01}
       finish {ambient <.2,.3,.4>*2 diffuse .5}	
 }
texture {pigment {onion turbulence .1*TA color_map {
		[0 color rgbt 0]
		[.125 color rgbt 1]
		[.25 color rgbt 0]
 } //sine_wave
 /*
#switch (WT2)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
*/
  }   normal {granite .25 scale .001}
 scale 3
}

#declare S3 =
 texture {pigment {spiral1 4 turbulence .05*TA color_map {
		[0 color rgb 0]
		[1 color rgb 1]
 }
#switch (WT1)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
 //rotate 0*z
  }   normal {granite .25 scale .01}
       finish {ambient <.2,.3,.4>*1 diffuse .5}	
 }
texture {pigment {onion turbulence .1*TA color_map {
		[.125 color rgbt 0]
		[.25 color rgbt 1]
		[.5 color rgbt 0]
 } //sine_wave
 /*
#switch (WT2)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
*/
  }   normal {granite .25 scale .001}
 scale 3
}

#declare S4 =
 texture {pigment {spiral1 4 turbulence .05*TA color_map {
		[0 color rgb 0]
		[1 color rgb 1]
 }
#switch (WT1)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
 //rotate 0*z
  }   normal {granite .25 scale .01}
       finish {ambient <.2,.3,.4>*.75 diffuse .5}	
 }
texture {pigment {onion turbulence .1*TA color_map {
		[.25 color rgbt 0]
		[.5 color rgbt 1]
		[1 color rgbt 0]
 } //sine_wave
 /*
#switch (WT2)
#case (1)
  ramp_wave
#break
#case (2)
  sine_wave
#break
#case (3)
  scallop_wave
#break
#else //default triangle_wave
#end
*/
  }   normal {granite .25 scale .001}
 scale 3
}

union {
//spiral arm surface
disc {<0,0,0>,<0,0,1>,2.5
	texture {average texture_map {
		[1 S1 rotate clock*720*z]
		[1 S2 rotate clock*360*z]
		[1 S3 rotate clock*180*z]
		[1 S4 rotate clock*90*z] //minimum, based upon spiral arm number
	} sine_wave scale .85 } 
  scale 2 //fit to view
}
//overlay of central bright region
disc {<0,0,-.001>,<0,0,1>,2.5
texture {pigment {onion turbulence .1*TA color_map {
		[.05 color rgbft <1,.95,.75,.5,.125>]
		[.1 color rgbft <.9,.85,.8,.75,.25>]
		[.2 color rgbft <.9,.9,.9,.5,.25>]
		[.3 color rgbft <.85,.9,1,.25,.75>]
		[.9 color rgbft <1,1,1,1,1>]
  } ramp_wave }
   normal {granite .25 scale .005}
  finish {ambient 1}
   scale 2.5
 } scale 2
}
 scale 1 rotate 0 translate 0
}
//END


Post a reply to this message

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