https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=User:Mihail_Bakalov/Trimester_1/NETWORK_BASED_PROTOTYPING/Assignment11.11.2013&feed=atom&action=history
User:Mihail Bakalov/Trimester 1/NETWORK BASED PROTOTYPING/Assignment11.11.2013 - Revision history
2024-03-28T11:35:21Z
Revision history for this page on the wiki
MediaWiki 1.38.2
https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=User:Mihail_Bakalov/Trimester_1/NETWORK_BASED_PROTOTYPING/Assignment11.11.2013&diff=57100&oldid=prev
Mihail Bakalov: Created page with "File:Mishopyanim.gif import struct, sys width = 320 height = 240 header = struct.pack("<BBBHHBHHHHBB",0,0,2,0,0,8,0,0,width,height,32,1<<5) totalframes = 25 f..."
2014-01-15T15:39:23Z
<p>Created page with "<a href="/mediadesign/File:Mishopyanim.gif" title="File:Mishopyanim.gif">File:Mishopyanim.gif</a> import struct, sys width = 320 height = 240 header = struct.pack("<BBBHHBHHHHBB",0,0,2,0,0,8,0,0,width,height,32,1<<5) totalframes = 25 f..."</p>
<p><b>New page</b></p><div>[[File:Mishopyanim.gif]]<br />
<br />
import struct, sys<br />
<br />
width = 320 <br />
<br />
height = 240 <br />
<br />
header = struct.pack("<BBBHHBHHHHBB",0,0,2,0,0,8,0,0,width,height,32,1<<5)<br />
<br />
totalframes = 25<br />
<br />
for frame in xrange(totalframes):<br />
out = open("frame_%02d.tga" % frame, "wb")<br />
out.write(header)<br />
for y in xrange(height):<br />
for x in xrange(width):<br />
if y >= 200:<br />
r = 5*(float(frame))<br />
g = y/4+2*(float(frame))<br />
b = 3*(float(frame))<br />
a = 255<br />
elif y <= 75:<br />
r = (x+y)/4+(float(frame)/totalframes)<br />
g = y+2*(float(frame))<br />
b = y+2*(float(frame))<br />
a = 255 <br />
else:<br />
r = 5+5*(float(frame)/totalframes)<br />
g = y-2*(float(frame))<br />
b = 4*(float(frame))<br />
a = 255<br />
out.write(struct.pack('B', b))<br />
out.write(struct.pack('B', g))<br />
out.write(struct.pack('B', r))<br />
out.write(struct.pack('B', a))<br />
<br />
out.close()</div>
Mihail Bakalov