12.08.2013 Views

The AR Workbench: A Complete Co-located Reach-in Mirror-Based ...

The AR Workbench: A Complete Co-located Reach-in Mirror-Based ...

The AR Workbench: A Complete Co-located Reach-in Mirror-Based ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Marlon Richert, Master’s <strong>The</strong>sis, Friday, 23 February, 2007<br />

Figure 21 Interaction callback mechanism, part 3: Evaluat<strong>in</strong>g the logical<br />

conjunction (activity diagram).<br />

Figure 22 Interaction callback mechanism, part 4: Mak<strong>in</strong>g the callback<br />

(sequence diagram).<br />

Table 8 shows an example of how you can use the roles module to set up<br />

Interactions between virtual objects. This example is also <strong>in</strong>cluded with the module<br />

itself. Note that the two Roles that the example def<strong>in</strong>es are not very sophisticated,<br />

but that is not the po<strong>in</strong>t of the example. <strong>The</strong> po<strong>in</strong>t is that to subclass Role, the only<br />

th<strong>in</strong>g the application programmer needs to do is implement the act(…) method. <strong>The</strong><br />

programmer can then reuse their Roles for different actors. Of course, as you can<br />

see, implement<strong>in</strong>g an act(…) method still requires a fair amount of doma<strong>in</strong><br />

knowledge. This is, however, unavoidable as it is very hard to automate because the<br />

details of what the programmer wants to act achieve with a certa<strong>in</strong> Role will vary<br />

wildly between applications.<br />

Table 8 Example of how to use the roles module (Python code).<br />

# In IPF:<br />

# Create objs to represent your actors and targets.<br />

# Create regions to def<strong>in</strong>e the boundaries of your target objs.<br />

# Create pivots to def<strong>in</strong>e the sensors of your actors' roles.<br />

# Create b<strong>in</strong>ds and maps to make sure your regions and pivots stay<br />

# current.<br />

# Add the path where roles.py is <strong>located</strong> to the system path<br />

import sys<br />

sys.path.append(".")<br />

37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!