Mathematical Visualization WS08 Technical University Berlin

Assignment 2

Theme: Getting started

Part 1. Correction and addition to previous instructions.

Due to how logins are stored in subclipse, you need to correct something if you've already checked out jreality as user guest.

Here's what you need to do:

  • Remove all files in the directory:
    • On Linux/Mac: ~/.subversion/auth/svn.simple/
    • On Windows: %APPDATA%\Subversion\auth\svn.simple
  • You have unique login for this repository: for example, if your linux login is mvws0803, your repository login is MathVisWS0803. The password is Physics!
    • If you don't have such a linux login, you'll still need to get a repository login from me.
  • In Package Explorer, select the jreality project and on the right mouse menu select "Team...->Synchronize with repository". You should be prompted to enter your new login and password. Do so, and click the "save" box.

Also, in eclipse you should set your Java settings so that you have generous heap space for the Java machine. To do this:

  • Select "Window->Preferences..." and then "Java->Installed JREs" and then select the checked JRE, then click on "Edit..."
  • Add the following to the "Default VM Arguments" text field: "-Xmx1024M".

Part 2. Subversion repository for our course

You'll need to set up one more subversion repository, just for our class. Here's how:

  • In eclipse, open the SVN repository perspective by selecting the menu item "Window->Open perspective ...->SVN Respository Exploring"
  • If you don't see this perspective, then you haven't installed subclipse successfully.
  • In the SVN Respository browser, use right mouse click to get a menu; choose the item "New->Repository location..."
  • Enter the URL http://fs.math.tu-berlin.de:8000/svn/gunn/MathVisWS08
  • If you've already checked out jreality correctly, you should not be prompted for a login and password.
    • Select the repository name in the SVN Repository Exploring window and choose the right mouse menu item "Checkout..."
    • You should be able to use the default settings provided in the window. Click OK.
    • The project comes configured as a stand-alone Java Eclipse project.
    • Switch the Eclipse perspective back to the Java perspective.
    • To test whether the project has compiled correctly, navigate in the Package Explorer to "MathVisWS08->src->de.jreality.mathvisws08" and select the file Sample01ParticleSystem.java
    • Use the right mouse menu to select "Run As ...->Java Application"
    • If there is an error message that the class is not found, you'll need to do the following:
      • Select the menu item "Project->Properties"; then select "Build Path" and the tab "Libraries", and select "charlesgunn.jar", and click "Remove", "OK", "OK".
      • Select the menu item "Project->Properties"; then select "Build Path" and the tab "Libraries", and click on "Add JARs...". In the browser, select "MathVisWS08->lib->charlesgunn.jar". Click "OK", "OK".
      • So ... deleting the jar and adding back seems to fix this problem.
    • Assuming you now can run the program, you should see a yellow horizontal cylinder. Click on "Run". You should see lots of red and blue particles move away from the cylinder, and fall to the ground. Read the Readme tab in the navigator window to acquaint yourself with the features of the program, and play around with the parameters as directed in order to understand how the pieces go together. Consider how it could be changed or improved!
    • Note: all students have write permission in this subversion repository. Please be careful! To avoid problems:
      • Create your own package with the name de.jreality.mathvisws08.yourlastname by selecting "File->New->Package" and entering your package name. For example, I would create a package named de.jreality.mathvisws08/gunn.
      • To work on your own version of Sample01ParticleSystem.java, select it in the Package Explorer and select "Copy" from the right mouse menu. Then, select your package and select "Paste" from the right mouse menu. You can leave the name as it is, but I recommend appending your last name so you won't get confused with the original version (for example, Sample01ParticleSystemGunn.java)
      • Don't check in any changes or new files under the package de.jreality.mathvisws08! These will be removed. If there were an easy way to do so, I'd remove write permission from this package (except of course for me!).
      • You can check in your new package and the files it contains by invoking "Team...->Synchronize with Repository" and then selecting your package and selecting "Commit...". Make sure all the files you want to check in are selected before clicking "OK".

    Part 3. Assignment

    Your assignment, due in two weeks (at 14:00 Uhr Wednesday November 5) is to create your own particle system application. It can be implemented as a variation of Sample01ParticleSystem.java or you can start from scratch if you really want to. Here are some ideas for variation of the program:

    • Currently when the particles hit the ground plane (the pool), they are recycled and start out again from the cylinder. You might introduce some other geometry where the particles reflect (bounce) off the geometry before landing in the pool, and adjust the appearance parameters to look like a real waterfall.
    • The current potential function is a very simple gravity term (always in the same direction). Adapt this to be a more interesting function.
    • There is an implicit differential equation to solve. The sample program doesn't make a serious attempt to solve it. Or, rather, it uses Euler's method to solve it: the simplest sort of DE solver, which approximates a solution to x' = x at x = x(0) by x(t) = x(0) + t x'(0). Here the time step is determined by the slider with that name. One variation is to implement a more serious linear differential equation solution method. For example, Runge-Kutta or modified Euler.
    • Once you've finished your work, check it into the svn repository as directed above. Be sure that you've documented the changes that you've made to the original, or if you've written your own system, document how you've done it.
    • Remember, deadlines in this class are strict: no extensions without a medical excuse. If the code isn't checked in by 14:00 Uhr (punkt!) on 05.11.08, it won't receive credit.