POV-Ray : Newsgroups : povray.text.scene-files : motion blur revisited: faded toy top problem? Server Time
3 Jul 2024 02:12:10 EDT (-0400)
  motion blur revisited: faded toy top problem? (Message 1 to 1 of 1)  
From: Bob H 
Subject: motion blur revisited: faded toy top problem?
Date: 1 Jul 2001 04:30:16
Message: <3b3edf98@news.povray.org>
/*This is a test file from long ago but I figure it's worth posting.  It was
already posted in part about the same subject, a semitransparent spinning
object problem.  Seems it has something to do with the math in the blur
amount, I guess.  Am not sure at all.*/

// Persistence of Vision Ray Tracer Scene Description File
// File: testingspinningtop.pov
// Vers: MegaPov 0.4 or >
// Desc: spinning toy top with motion blurring
// Date: 99.8, 01.5
// Auth: Bob Hughes
// Mail: inv### [at] aolcom?Subject=Pov-Scene
// Note: when spun in place, the toy top can be semitransparent.  incorrect
behavior(?)

#version unofficial MegaPov 0.7;

// choose spinning, linear, lobed, or scaled movements
#declare WhichBlur=1; // spinning is the subject of controversy

#declare BlurS=10;
#declare BlurA=1;

// declaring clock as anything else doesn't work outside of a motion_blur
statement?
/*
#declare clock_type="D"
#include "clockmod.inc"
#declare dC=mclock;

#declare clock_type="S"
#include "clockmod.inc"
#declare sC=mclock;
*/

global_settings {
  assumed_gamma 2.2 // PC
  motion_blur
   // BlurS,BlurA // comment out if using the way below
   // use the following to see possibly wrong behavior
    BlurS,(BlurA+.0001)-(pow(clock, .5 / 1)) // deceleration taken from
C.C.'s ClockMod.inc
}

// #declare C=clock;  // motion blur won't accept this. Reason: outside of
statement?

/* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& */

#switch (WhichBlur)
#case (1) // spin

motion_blur {
#declare C=clock;  // motion blur will accept this (clock used)

  union {

    cone {0,1,-2*y,0}
    sphere { 0, 1}
    torus {.5,.25 clipped_by {cylinder {-.25*y,.25*y,.5}} translate 1.125*y}
    texture {pigment {radial frequency 8} finish{specular .75 metallic 1
brilliance 1}}
  }

   translate (1.25-(.5-(C*.5)))*y // move object down first to get wobble
// rotate 720*dC*y rotate sC*60*x rotate (720-(360*sC))*y  // non-working
way
  rotate -(90*(1-(sin((C - .5) * pi) / 2 + .5)))*y // S-wave taken from
C.C.'s ClockMod.inc
   rotate (pow(C, 2)*(60*sin((C - .5) * pi) / 2 + .5))*x // S-wave taken
from C.C.'s ClockMod.inc
    rotate (540-(1080*(pow(C, .5 / 1))))*y // deceleration taken from C.C.'s
ClockMod.inc
  translate (1.25-(.425*C))*y  // move back up so tip is at plane (not
accurate!)
//  translate <0,1,2*clock>
}

#break
#case (2) // unidirectional

#declare C=clock;  // motion blur will accept this (just to set variable)

motion_blur {

  union {

    cone {0,1,-2*y,0}
    sphere { 0, 1}
    torus {.5,.25 clipped_by {cylinder {-.25*y,.25*y,.5}} translate 1.125*y}
    texture {pigment {radial frequency 8} finish{specular .75 metallic 1
brilliance 1}}
  }
  translate 2*y // position the toy top
 translate pow(C/BlurS-1,2)*x
 #declare C=C+1; // C defined outside first, so loop effect takes place
}

#break
#case (3) // oscillating

 #declare C=0;  // motion blur will accept this (just to set variable)

motion_blur {

  union {

    cone {0,1,-2*y,0}
    sphere { 0, 1}
    torus {.5,.25 clipped_by {cylinder {-.25*y,.25*y,.5}} translate 1.125*y}
    texture {pigment {radial frequency 8} finish{specular .75 metallic 1
brilliance 1}}
  }
  translate 2*y
 translate sin(C/30)*x
 #declare C=C+5; // C defined outside first, so loop effect takes place
}

#break
#case (4) // expand

 #declare C=0;  // motion blur will accept this (just to set variable)

motion_blur {

  union {

    cone {0,1,-2*y,0}
    sphere { 0, 1}
    torus {.5,.25 clipped_by {cylinder {-.25*y,.25*y,.5}} translate 1.125*y}
    texture {pigment {radial frequency 8} finish{specular .75 metallic 1
brilliance 1}}
  }
  translate 2*y scale 1+sqrt(C/30)
 #declare C=C+.5; // C defined outside first, so loop effect takes place
}

#break

#end


// ----------------------------------------
camera {
  location  <-3, 4.5, -9>
  direction 1.5*z
  right     4/3*x
  look_at   <.5, 1.5, 0>
}

sky_sphere {
  pigment
  {
    gradient y
    color_map { [0 color rgb <.6,.8,.9>] [.25 color rgb <.3,.6,1>] [1 color
rgb <.1,.3,.6>] }
  }
}

light_source {
  0*x
  color rgb 1.5
  translate <-30, 30, -30>
}

plane { y, 0 clipped_by {box {-1,1 scale <10,1,10>}} pigment {color rgb
<0.7,0.5,0.3>}}

// END TEST SCENE


Post a reply to this message

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