Welcome to the E15 beta Wiki. Here you will find some information about getting started with E15.


About E15

E15 is a graphics platform designed for creating dynamic, 3D data visualizations. It consists of an OpenGL-based graphics engine with a scripting interface that can be used to generate objects, create textures, and fetch data from the web. The scripting interface, an embedded Python interpreter, enables the visualization designer/developer to change visual parameters without having to recompile code, making it easy to rapidly prototype different visual designs. The E15 environment also leverages the web to create a social network for its developers, enabling them to browse and share code with each other and learn from the developer network.


Recent Updates

For those of you beta testers that are using E15_b001, note that there is a new version, E15_b002 of the same extension and location as the first bundle you downloaded. Please upgrade if you haven't already.


Installing E15

Version “1.0” of E15 exists, but only because the version number was not changed from 1.0 prior to release. Only the first group of users have an actual version 1.0. For all other users of versions < 1.0, you will need to install the JSON framework from the following location:

http://code.google.com/p/json-framework/

You'll also need to install various Python libraries, depending on what examples you find on e15web, but that can be determined later.


Running E15

  1. The following instructions will help get you connected with the collection of submitted examples in the E15 repository submitted by other users at http://e15web.media.mit.edu. While you don't need to follow these instructions, they will help you get started.
  2. Go to http://e15web.media.mit.edu, and create an E15:Web account with a login ID and password.
  3. Start E15.
  4. Command + shift + w opens the E15 web browser window.
  5. Again, go to http://e15web.media.mit.edu and log in.
  6. When you click on one of the recently submitted images, the associated script will load into the script view.
  7. Hit “eval” to run the script.

Additional Notes

  • <command>+z removes any loaded images or video in the window.
  • Navigating the scene is done with the scrollwheel. (Hold <shift> to translate along the y axis, and <command> to rotate along the x and y axes)
  • <command>+s will capture the screen, and submit the scripts you've run to the e15web.media.mit.edu server, for everyone to see.
  • If you see a message of the form: “ImportError: No module named XXX” means that a Python module is missing. You need to download and install the missing module. Python module installation is easy in 10.5, so this shouldn't be a problem.
  • When scripts are saved to E15:Web, the entire history of evaluations is saved as a collection. (Yes, you can evaluate new scripts as your current script is running!). When a script is loaded from E15:Web to the console, only the first of these scripts is loaded.

E15:oGFx

E15 has two “modes”. In the first (also commonly referred to as E15:oGFx), the program structure is similar to that of languages like Processing. That is, users define a “draw()” procedure, and it gets evaluated as fast as possible (there is no setup()). When running scripts in this way, you must include the “from drawengine import *” declaration at the top of your script, as it contains the custom Python bindings necessary to generate frames. Before declaring your draw() procedure, you must also be sure to call the function “tsize(int)”, which specifies the size of the texture to generate every frame. We currently require this size to be a power of two. We often use 512 as a reasonable number, but you are likely to get better performance with smaller texture sizes.

from drawengine import *
from math import *

a=0
b=0
tsize(512)

def draw():
  global a,b
  background(1,1,1,0)
  linewidth(10)
  stroke(1,0,0,1)
  for i in range(50):
	stroke(i%2,0,(i+1)%2,0.5)
	moveto(i*10,i*10*b)
	beginline()
	line(512-i*10*b,i*10)
	closeline()

Once the script is running, you can continue to evaluate additional statements in the E15 console to influence the running animation. For example:

envcolor(1, 0, 0)  #Sets the environment color to red

Following this, you can add:

history(100, 0.00005)  #Displays the last 100 frames of the animation, separated by a small distance (0.00005).

In addition to animation history, the entire collection of Apple's Core Image filters are available to E15:oGFx.

See the following URL for Core Image filter documentation:

http://developer.apple.com/documentation/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html

Applying the filters is still rudimentary, but proceeds as follows:

A gaussian blur filter can be installed as follows:

root.gaussianblur("radius", 5)

Where the format is “root.”<filtername>(paramname, paramvalue)

Other examples:

root.colorcontrols("saturation", 20)
root.edges("intensity", 6)
root.pixellate("scale", 6)

Removing filters can be done as follows (but a bug remains if you have applied the same filter multiple times):

root.removeFilter("gaussianblur", lambda: del_gaussianblur())
root.removeFilter("colorcontrols", lambda: del_colorcontrols())
root.removeFilter("edges", lambda: del_edges())
root.removeFilter("pixellate", lambda: del_pixellate())

E15:oGFx is less documented than E15 in general. Look for examples on E15:Web. And if you write something that looks nice, please submit to E15:Web!


E15:StaticWriter

The other E15 “mode” is currently referred to as “static” mode. In this mode, no procedural animations take place. The E15 view is treated as a 3D environment where drawings, images, and text can be placed, and actions can be defined when these objects are selected with the mouse. In the following example, a PDF document is loaded from a URL, and its pages are drawn into the view, arranged spatially. To designate static mode functionality, users must include the following statement:

from staticwriter import *

In this mode, every object displayed has an id that is a string. This string is specified when users create objects. In the following example, each page of the PDF is loaded with the “pdfpage” function, whose first argument is the id of the object. Users may determine which objects are currently being displayed in the scene through the following statement: “print displayables()”. This shows a list of the ids currently being displayed.

Users may select objects in the scene with the mouse, and when selected, the Python procedure “onHit(e)” will be invoked. When this procedure is invoked, it means an object was selected, and the user is provided with the id of the object. In the example below, when a user selects an object, the camera position is updated to look at that object.

from staticwriter import *

envcolor(1, 1, 0) #Set the environment color to yellow.

pdfname = "http://developer.apple.com/documentation/GraphicsImaging/Reference/CGDataProvider/CGDataProvider.pdf"	
num_pages = pdfnumpages(pdfname) #Get the number of pages in the pdf.

for i in range(num_pages):  #Page numbers start at 1
  pdfpage(str(i), pdfname, i+1, -i, 0, -i, 1- i/(num_pages*1.0))

def onHit(e_id):  #When the user selects an object, get a callback.
  camera_goto(e_id)

#You may also define the following key press handlers:
def onLeft():
  print "Left button hit!"

def onRight():
  print "Right button hit!"

Playing YouTube Videos

As referenced in my blog: http://buza.mitplw.com/blog/?p=173, playing YouTube videos is a little tricky, requiring some trickery to get YouTube to cough up the video file for E15 to play. In order to facilitate this process, E15 users must create a directory on their desktop called “e15video” for the YouTube download engine to use to store videos. If you're running a YouTube demo, you need to create this directory.

Performance Notes

Often times, you will run your E15 script multiple times, downloading the same collection of images over and over from a remote site. In order to alleviate this performance bottleneck, E15 users may create a directory on their desktop called “e15cache” that, upon creation, E15 will use as a temporary storage directory for loaded images. Subsequent image loads of the same images will come from the cache, and not from the network, dramatically decreasing load time. The creation of this directory, is, of course, purely optional.

Note: This is currently flaky and is likely to cause erratic behavior in current versions. This should be fixed soon. Use at your own risk.


The E15 WWW Browser

To use E15 to render web pages, you will need to bring up the Web Panel. You can do this by selecting Window Web Panel, or with the key combination, command+shift+w. The Web Panel is a normal web browser, and you can specify a URL in the location bar. Once a page is loaded, the page will be rendered into the main 3D window if your script calls the following procedure to enable the automatic loading of textures into the view:

from staticwriter import *
autopageload(1)
e15.txt · Last modified: 2011/09/13 15:14 (external edit)
 
 
©2008 BuzaMoto industries.