Thursday, December 31, 2009

Work Progress - Dec 28 - Jan 1

Specification identified:
  • Display methods (annotated with @AutomatableMethod tag) associated with pCSDT object in a proper way. Currently after a pCSDT object is selected, the assoicated method name is displayed correctly, but not the parameter listing. Changes in parameter value there should be able to be copied to statement tree after drag-n-drop.
  • Render statement tree (the structure which stores codelets) properly in scriptlet panel.

Progress:
  • Basically successfully display the methods of the selected object in the render view. The method name is in the form of border title, while the parameter values to be filled are shown as text fields inside. Tool tip text is available when one moves over the text field. Run SB/SBGui.java for a live demo.

Sunday, August 9, 2009

Work Progress - Aug 10 to Aug 14

* Synthesizer web demo
  • Instruction: here
  • Website: here
  • Due to some unknown reason, I have yet been able to make all the implemented features available in the web version. Those described in the instruction are the ones tested ready.
* Useful materials for drag-and-drop feature
  • Chapter 3 and (especially) Charter 5 of Advanced Java How to Program. Free chapter slides and codes are available here.

Sunday, August 2, 2009

Work Progress - Aug 3 to Aug 7

* Include code that changes soundbank - But it is not used since strange to speak, it does not work in my program, while it does in my test program.
* In rug weaver application, change the drawing of stitches from squares to ovals.



* Write a function object "SingleValue" which represents a note to be played at a particular time. This can work as the "PlayNote" objected required by Ron. It will work after creating an object of this type and giving the pitch value, the time to play, the note to play and the instrument to use.
* Because how to incorporate pull-down menu to the object so that it is visible to users under pCSDT is yet uncertain, I choose to implement the polynomial, exponential, rational and constant version of "SingleValue", each of which playing the notes represented by the corresponding function type.
* Progress highlighing is shown below.



The time when the notes are played is shown below.

Thursday, July 23, 2009

Work Progress - Jul 27 to Jul 31

Synthesizer tool - Reference materials
* Java API for music: http://www.jfugue.org/
* Interval can be modelled with Duration: here [p.6]
* Instrument can be changed with I command: here [p.11]
* Model magnitude with frequency: here [p.27]
* Example usage: here
* Frequency of musical note: here
* Reference on drawing line with jogl: here

pCSDT Prototype




In the Synthesizer engine, one can specify the display mode of all the functions (a line showing the function continuously, or dots showing when the note is played - see above screenshots), the music mode (whether exact pitch is to be played, or nearest standard note instead), the tempo (overall speed of the music) and uniscale of the graphical display.

Polynomial (up to degree 4), rational (up to degree 4 for each of numerator and denominator) and exponential functions are the three component pObject implemented. One can specify the start time and end time of each function object separately, so piecewise function can be composed (See the red line in the above screenshot for an example). One can also customize the instrument used, the length of time the note is held (8th note, quarter note, etc), and the time interval between adjacent quarter note.

Musical notes are played on clicking the RUN button. The music can be stopped anytime on clicking the same button again.



The working prototype has been uploaded to the repository.

Tuesday, July 21, 2009

Work Progress - Jul 20 to Jul 24

* Complete LinearIteration and TriangleIteration
* Complete documentation of the RW code

Tuesday, July 14, 2009

Work Progress - Jul 13 to Jul 17

* Finish BoardPoly
* Commenting and documenting SB code
* Implement pCSDT version of Navajo rug weaver (CSDT version here). Source code of the pCSDT version developed so far is available in the repository here.
* Implemented: Line, Point, Rectangle, Triangle.



* User can change whether the pattern should be filled or not through RWEngine's Automatable property bFilled.



* To do next week: LinearIteration, TriangleIteration, documentation

Saturday, July 11, 2009

Work Progress - Jul 6 to Jul 10

  • BoardEngine now allows no Skateboarder defintion to run.
  • HitTest() of BoardPolyLine implemented.
  • SBGui.java now shows an example of BoardPolyLine.
  • Make all automatable properties in working PObject (BoardLine, BoardPolyLine and SkateBoarder) public to compile with recent pCSDT framework specification
  • Review critical tasks listed by Ron
    • ability to specify linear tracks
      [Can currently be done with BoardLine]

    • ability to specify curved tracks (using arc of circle, arc of spiral,polynomial function--math teachers seem to want a variety)
      [Curved surface is now approximated with series of rectangular blocks, as shown in the recent SBGui example. If we are to specify the curved tracks with functions, the task is then to wisely break down the curve into series of small rectangular blocks. P.S.: On working with the recent SBGui example, I find that the width of the fine pieces of rectangular blocks may be related to the size of skateboarder. More study on this part needs to be done.]
    • ability to place obstacles in the way.
      [If it is an rectangular obstacle, we may reuse the BoardLine - the BoardLine with suitable length and width can function as an obstacle. Do we need obstacle of other shapes?]
    • conditionals for obstacle avoidance (so it requires a sensing function that tells how close an object is to the SB character)
      [More details from you needed...]
    • behaviors for obstacle avoidance (apply impulse function for jumping,swerving, etc.)
      [More details from you needed...]

Wednesday, July 1, 2009

Work Progress - Jun 29 to Jul 3

  • Adapting to restructured repository
  • Done with BoardPolyline, which is a series of rectangular blocks with fixed width.
    • Reference: http://www.jbox2d.org/v2demos/ - the shape drawing example
    • [To do] For better delegation of jobs, should put jbox2d body creation into the respective classes.

Saturday, June 27, 2009

Work Progress - Jun 22 to Jun 26

  • Refine what are to be reset in the Reset() functions of Skateboarder and BoarderLine.
  • Refine texture loading procedure of Skateboarder.

Thursday, June 18, 2009

Work Progress - Jun 15 to Jun 19

Incorporating TeamA2 code to repository
  • Step() method for BoarderEngine.
  • HitTest() methods for BoarderLine and SkateBoarder.

Monday, June 8, 2009

Work Progress - Jun 8 to Jun 12

Implementing BoardPoly
  • JBox2d does not support concave polygon collision detection. One needs to break down the concave polygon into multiple convex ones to overcome this issue. A reference with source code is available here. Another reference is available here.
  • Complete integrating JBox2d code into BoardPoly. To specify a polygonal obstacle, one needs to give the vertices in clockwise order. An example can be found in the TestClass.java in the source code here.

Wednesday, June 3, 2009

Work Progress - Jun 1 to Jun 5

A better Java Physics engine: http://www.jbox2d.org/
This provides methods to directly apply an impulse to an object.
It also has built-in support for polygon.
Good starter tutorial: http://www.anddev.org/how-to_2d_physics_with_box2d-t5099.html
Manual: http://www.box2d.org/manual.html
Code doing physics with JBox2d (SkateBoarder's Impulse method also done): http://www.rpi.edu/~laut/TeamA2Code_0606.zip
TO DO: Implement BoardPoly

Monday, May 25, 2009

Work Progress - May 25 to May 29

Study of Java Physics Engine mentioned in week May 11 to May 15
  • Relevant demos: Demo 16 and demo 18 - both having a box sliding along a line, doing rotation on hitting something.
  • To run the demo, download both the core jar and test jar files. Then in command prompt, run the following command: java -classpath .;phys2d-060408.jar;phys2d-test-060408.jar net.phys2d.raw.test.DemoXX where XX is the number of the demo (16 or 18). Alternatively, I have ported the source code to a NetBeans project. One can run the demo by double-clicking on the .bat file after uncompressing this.
Integrating Physics Engine into Team A2 skateboarder code
  • Working code: here
  • Current progress: Using Physics Engine to calculate the displacement and velocity (both linear and angular) of the skateboarder. Displaying skateboarder of a particular angular displacement correctly. Displaying BoardLine with a particular slope correctly.
  • Next step: Clean the code (e.g. the collision handling/auxiliary code in the BoardLine and SkateBorder classes). Import it back to repository (after the pCSDT code update by Jason).

Tuesday, May 19, 2009

Work Progress - May 18 to May 22

Task: Move work in Team A2 code to the repository, without changing any pCSDT code in the repository.
Next step: Complete angular momentum code

Friday, May 15, 2009

Work Progress - May 11 to May 15

Collecting expectation on my contribution:
  • Finish collision detection in the skateboarder
  • Review code from the skateboarder team to see what can be salvaged and moved into the repository proper.
Summarizing useful resource:
Identifying the part of code to finish (referencing the Team A2 code first, then contributing my own):
  • SB/SkateBoarder.java: the Impulse(SbVector r, SbVector J) method
  • SB/BoarderEngine.java: Step(double dt) method [the one method I need to work mostly on], Seek(double t) method