Advertisement
Guest User

Untitled

a guest
Dec 6th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. import struct
  2.  
  3. instr = struct.Struct("HHHBBBx")
  4. outstr = struct.Struct("IIII")
  5.  
  6. cnt = 0
  7. with open("sibenik.bin3", "rb") as infile:
  8.   with open("sibenik.vxl", "wb") as outfile:
  9.     infile.read(8)
  10.     while infile:
  11.       data = infile.read(instr.size)
  12.       if not data: break
  13.       (x,y,z,r,g,b) = instr.unpack(data)
  14.       c = r*0x10000 + g*0x100 + b
  15.       outfile.write(outstr.pack(x, y, z, c))
  16.       cnt += 1
  17. print "->", cnt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement