@3D Repeat Basic Settings
--track0:dx,-1000,1000,0
--track1:dy,-1000,1000,0
--track2:dz,-1000,1000,0

shiftX=obj.track0
shiftY=obj.track1
shiftZ=obj.track2
shiftRx=0
shiftRy=0
shiftRz=0
shiftZoom=0
baseAlpha=1
shiftAlpha=0


@3D Repeat Relative Rotation Settings
--track0:<dx,-3600,3600,0
--track1:<dy,-3600,3600,0
--track2:<dz,-3600,3600,0
shiftRx=obj.track0
shiftRy=obj.track1
shiftRz=obj.track2

@3D Repeat Relative Scaling and Opacity
--track0:dScale,-300,300,0
--track1:Clearness,0,100,100
--track2:dOpacity,-100,100,0
shiftZoom=obj.track0/100
baseAlpha=obj.track1/100
shiftAlpha=obj.track2/100

@3D Repeat Render
--track0:Loop,0,50,2
--track1:Intvl,-1000,1000,0
--track2:Twist,-3600,3600,0
--track3:Spin,-3600,3600,0
--param:kijun=0;
rep=math.floor(obj.track0)
space=obj.track1
spin=obj.track2
rot=obj.track3
if(shiftX==nil) then shiftX=0 end
if(shiftY==nil) then shiftY=0 end
if(shiftZ==nil) then shiftZ=0 end
if(shiftRx==nil) then shiftRx=0 end
if(shiftRy==nil) then shiftRy=0 end
if(shiftRz==nil) then shiftRz=0 end
if(shiftZoom==nil) then shiftZoom=0 end
if(baseAlpha==nil) then baseAlpha=1 end
if(shiftAlpha==nil) then shiftAlpha=0 end

diffZ = space + shiftZ
diffRz = spin + shiftRz

baseX=0
baseY=0
baseZ=0
baseRx=0
baseRy=0
baseRz=rot
baseZoom=1.0
if(kijun==1) then
  baseX = 0.5*(rep-1)*shiftX
  baseY = 0.5*(rep-1)*shiftY
  baseZ = 0.5*(rep-1)*diffZ
  baseRx = 0.5*(rep-1)*shiftRx
  baseRy = 0.5*(rep-1)*shiftRy
  baseRz = rot+0.5*(rep-1)*diffRz
  baseZoom = baseZoom+0.5*(rep-1)*shiftZoom
  baseAlpha = baseAlpha+0.5*(rep-1)*shiftAlpha
  shiftX=-shiftX
  shiftY=-shiftY
  diffZ=-diffZ
  shiftRx=-shiftRx
  shiftRy=-shiftRy
  diffRz=-diffRz
  shiftZoom=-shiftZoom
  shiftAlpha=-shiftAlpha
elseif(kijun==2) then
  shiftX=-shiftX
  shiftY=-shiftY
  diffZ=-diffZ
  shiftRx=-shiftRx
  shiftRy=-shiftRy
  diffRz=-diffRz
  shiftZoom=-shiftZoom
  shiftAlpha=-shiftAlpha
end
if(rep==0) then
  obj.alpha=0
end
if( (kijun==0) and ((baseAlpha==0) and (shiftAlpha<=0)) ) then
  obj.alpha=0
end
if( (kijun==1) and ((baseAlpha==0) and (shiftAlpha==0)) ) then
  obj.alpha=0
end
if( (kijun==2) and ((baseAlpha==0) and (shiftAlpha<=0)) ) then
  obj.alpha=0
end

for i=0,rep-1 do
  alpha=baseAlpha+shiftAlpha*i
  if(alpha>1) then alpha=1 end
  if(alpha>0) then
      obj.draw(baseX+shiftX*i, baseY+shiftY*i, baseZ+diffZ*i, baseZoom+shiftZoom*i, alpha, baseRx+shiftRx*i, baseRy+shiftRy*i, baseRz+diffRz*i)
  end
end
