Converting Radiohead's HOUSE OF CARDS laser data to X3D

This blog entry was posted by on .

It is tagged with InstantPlayer, instantreality, music, Python, and X3D.

So far there are 2 comments. Feel free to add one.

An updated and renamed version of the script can now be found on GoogleCode:

http://code.google.com/p/hoc-csv2x3d/

Here’s a little Python script for converting Radiohead’s 3D laser data into an X3D file. The script creates an animated X3D version of the video data, which can be explored in realtime using the InstantPlayer framework.

The script was initially developed by Michael Zöllner and optimized by me. Head over to Michael’s i.document for some images and videos showing the converted data on the new Fraunhofer IGD heyewall 2.0.

Currently the script is generating non-X3D-conform code which will only work in the InstantPlayer. I will provide a version which generates X3D-conform code to be viewed in other X3D browsers next week.

Usage overview

  1. Download the data from Google Code
  2. Download the radiohead2X3D.py converter script.
  3. Extract the data into a separate directory (e.g. csv)
  4. Use the Python script to convert the csv data.
  5. Use the Python script to generate a main X3D file.

Use the Python script to convert the csv data.

The script must be run two times (two-passes). The first pass will convert the csv files to separate X3D files (stored in the specified target dir).

The second pass will generate an X3D file which inlines the generated data files and drives the animation.

The script provides several options to customize the conversion process. You can display the available options like so:

1
python radiohead2X3D.py -h 

This will show the following usage text:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
usage:radiohead2X3D.py [options]          
 
    Convert Radiohead csv data to X3D.  
options:     
-h, —help            
show this help message and exit     
-d DATA_DIR, —dir=DATA_DIR  
The directory containing the original csv data files.   
-x TARGET_DIR, —targetdir=TARGET_DIR                
The target directory containing the converted X3D files.     
 -s START_FRAME, —startframe=START_FRAME           
The index of the frame to start with.
-e END_FRAME, —endframe=END_FRAME 
The index of the frame to end with.    
-f INTENSITY_SIZEFACTOR, —sizefactor=INTENSITY_SIZEFACTOR   
intensity value (4th parameter) is multiplied by this (for scaling).     
-b, —binary          
When given the inline files will be written as x3db (binary files). 
Requires aopt tool from instantReality.    
 -g, —globalfile     
When given the main file containing the inlines will be
created (using frames between STARTFRAME and
ENDFRAME reading from DATA_DIR writing to TARGET_DIR). 

You can specify the DATA_DIR, TARGET_DIR as well as the START_FRAME and END_FRAME.

E.g. to convert the first twenty csv files, use the script like this:

1
./radiohead2X3D.py -d csv -x x3d -s 1 -e 20 

This will convert the first twenty csv files in the csv directory and generate twenty X3D files in the subdirectory x3d.

To convert all csv files, use the script like this:

1
./radiohead2X3D.py -d csv -x x3d -s 1 -e 2101 

But be warned! This will generate about 900MB of data on your harddrive.

Use the Python script to generate a main X3D file

Now you can generate a main X3D file like so (mind the -g option):

1
./radiohead2X3D.py -d csv -x x3d -s 1 -e 20 -g 

That’s it. You can now view the converted data using InstantPlayer to start the generated main.x3d file:

1
InstantPlayer main.x3d 

License

The Python script is released under the new BSD license.


Comments

said on April 07, 2009

If any of you my dear forum people looking for convert avi to wmv or, simply saying do you ask yourself a question - how to convert wmv, avi and other media formats into other ones? Have you ever had problems with making of quality video content? Do you have no idea how converter programs work?. If you want to convert media files into various formats you should have one to do it with ease. With the help of this free video converter you can easily convert your video into pefect one and save it in any video format: AVI, MP4, WMV, FLV, MP3, MPg etc. And that is freeware tool! Hope that handy tool will help you to make your processor busy for a few spare days. :)

said on April 15, 2009

acheter viagra ;) http://forum.woltar.com/forum/user/pr… Les prix les plus bas . generique pharmacie Achat viagra en ligne dans notre pharmacie. ;())) Generique Inde pharmacie en ligne

Add a comment