let the rocket fly

This commit is contained in:
MaZderMind 2015-07-31 22:02:44 +02:00
parent 764d808b20
commit 6ffd341e66
2 changed files with 59 additions and 27 deletions

View file

@ -12,8 +12,7 @@ def introFrames(parameters):
title = titlemap[id] if id in titlemap else parameters['$title'].strip()
rnd = random.Random()
#rnd.seed(title)
rnd.seed("blafoo23")
rnd.seed(id)
tiles = range(1, 28)
targets = {}
@ -26,7 +25,7 @@ def introFrames(parameters):
maxdelay = max(maxdelay, delay)
targets[tile] = (
# x/y
rnd.randint(-1200, -820),
rnd.randint(-1200, -900),
rnd.randint(-600, 600),
# delay
@ -54,7 +53,8 @@ def introFrames(parameters):
placements.extend([
('text', 'style', 'opacity', '%.4f' % opacity),
('text', 'attr', 'transform', 'translate(%.4f, 0)' % x)
('text', 'attr', 'transform', 'translate(%.4f, 0)' % x),
('rocket', 'style', 'opacity', '0'),
])
yield placements
@ -75,24 +75,39 @@ def introFrames(parameters):
# final frame
yield placements
return
# start rotation
dr = 30
# start point
dx = -890
dy = 660
# distance from origin
ox = 830
oy = 576
# landing height
lh = 15
# fly the rocket
dr = 20.000
dx = 1648.5714
dy = -1562.8571
ox = -111.42858
oy = 1265.7144
frames = 3*fps
for i in range(0, frames):
r = easeLinear(i, 0, dr, frames)
x = easeLinear(i, 0, dx, frames)
y = easeLinear(i, 0, dy, frames)
r = easeOutQuad(i, dr, -dr, frames)
x = easeOutQuad(i, dx, -dx, frames)
y = easeOutQuad(i, dy, -dy - lh, frames)
yield (
('rocket', 'attr', 'transform', 'rotate(%.4f, %.4f, %.4f) translate(%.4f, %.4f)' % (r, ox+x, oy+y, x, y)),
('rocket', 'style', 'opacity', '1'),
('rocket', 'attr', 'transform', 'translate(%.4f, %.4f) rotate(%.4f, %.4f, %.4f)' % (x, y, r, ox, oy)),
)
# land the rocket
frames = 1*fps
for i in range(0, frames):
y = easeLinear(i, -lh, lh, frames)
yield (
('rocket', 'attr', 'transform', 'translate(0, %.4f)' % y),
)
@ -122,4 +137,22 @@ def debug():
# )
def tasks(queue, args):
raise NotImplementedError('call with --debug to render your intro/outro')
# iterate over all events extracted from the schedule xml-export
for event in events(scheduleUrl):
# HACK: only render event 49
#if event['id'] != 49:
# continue
queue.put(Rendertask(
infile = 'intro.svg',
outfile = str(event['id'])+".ts",
sequence = introFrames,
parameters = {
'$id': event['id'],
'$title': event['title'],
'$subtitle': event['subtitle'],
'$personnames': event['personnames']
}
))

View file

@ -27,10 +27,10 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="640.65224"
inkscape:cy="633.69474"
inkscape:cx="771.01569"
inkscape:cy="614.78598"
inkscape:document-units="px"
inkscape:current-layer="g4867"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1014"
@ -53,7 +53,7 @@
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="1041.4286,879.99999"
position="872.77184,1028.3353"
orientation="0,1"
id="guide4485" />
<sodipodi:guide
@ -550,10 +550,10 @@
inkscape:label="#flowRoot3553"><flowRegion
id="flowRegion3555"><rect
id="rect3557"
width="854.14764"
height="577.59332"
x="947.17649"
y="163.074498"
width="856.16803"
height="729.11627"
x="947.17651"
y="15.07449"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:37.50000381px;line-height:100%;font-family:Neris;-inkscape-font-specification:Neris;text-align:center;text-anchor:middle" /></flowRegion><flowPara
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:80.00000763px;line-height:100%;font-family:Neris;-inkscape-font-specification:'Neris Light';text-align:start;letter-spacing:-3.00000024px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1"
id="flowPara3567">#2342</flowPara><flowPara
@ -1034,8 +1034,7 @@
inkscape:connector-curvature="0"
inkscape:label="#path344" />
<g
id="rocket"
inkscape:label="#g6441">
id="rocket">
<path
inkscape:connector-curvature="0"
id="path364"

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 175 KiB