User:Mooeypoo/GSOC 2013 Project

From MediaWiki.org
Jump to navigation Jump to search

WiPhys: Physics Embeds in MediaWiki[edit]

Name and contact information[edit]

Name: Moriel Schottlender
Email: moo@smarterthanthat.com
IRC or IM networks/handle(s): mooeypoo
Location: New York City

Synopsis[edit]

My idea is to develop a plugin for MediaWiki that enables the easy embedding of interactive physics demos in wiki articles, using a Javascript physics engine like Box2web (which is based on Box2D)

This is intended for schools, educational sites and tutors (and anyone else who'd like to use it) that allows the basic rendering of physics demonstrations visually by picking up on basic code.

The project itself is ambitious and has a lot of potential, but the GSoC2013 portion of the project can serve as an initial building-blocks of a system that can allow for further extension in the future.

A demo of Box2Web can be seen here: https://code.google.com/p/box2dweb/

Implementation Details[edit]

I will concentrate mostly on developing a basic system to provide a link between Box2d and wiki markup. The implementation will be done in the following steps:

  • Creating a plugin that sends parameters to the box2web engine and renders the requested image.
  • Creating a wiki base-template to allow the user to insert parameters using wiki markup
  • Creating wiki sub-templates for two physical subjects as a starting point: projectile movement and collisions.

The implementation will be done under the consideration of allowing future expansion into more physics subjects, like rotational movement, energies, and even electricity and magnetism.

The system will be built so it allows users to add their own templates that interact with the box2d engine and produces powerful demonstrations in articles.

Considerations[edit]

The leading Javascript physics engine that can be used for this plugin is Box2web, based on the powerful C/C++ physics engine Box2D. However, there are several other Javascript-based physics engines that may be considered as alternatives:

  • Ammo.js
  • JigLibJS
  • Cannon.js

The proper javascript engine should be chosen based on the best compatibility and extendibility. While Box2Web is likely the forerunner, a short period of testing is allocated to this project to make sure these contenders are tested and not just dismissed outright.

Basic Example[edit]

An example could be something like the following code:

{{wiphys|collision|[
objects: {
   1: {
     name: "Ball",
     shape: ["circle",{radius: 20}],
     initial: {
        position: {
             x: 25,
             y: 0
        },
        velocity: {
             x: 0,
             y: 10
        }
     }
     mass: 0.4,
     style: {
        fill: "#ffffff",
        strokeColor: "#000000"
     }
   },
   2: {
     name: "Marble",
     shape: ["circle",{radius: 10}],
     initial: {
        position: {
             x: 0,
             y: 25
        },
        velocity: {
             x: 10,
             y: 0
        },
     }
     mass: 0.1,
     style: {
        fill: "#ffffff",
        strokeColor: "#000000"
     }
   }
}
forces:  {}
]}}

(This is just an idea to illustrate the mechanism, it doesn't necessarily represent the actual code)

This above example shows how users can implement their own demos relatively easily. The ideal would be to later add an additional GUI level to add these demos in an easier manner, but that could be done as a followup to the GSoC initial proposal.

Deliverables[edit]

As was mentioned before, this project serves as the base core engine for future enhancements. At the end of the GSoC2013 timelines, the project will result in:

  • A plugin to use Box2D in Wiki pages using markup
  • A working markup for basic static physics demonstration images for two subjects: Projectile and Collisions.
  • A working schema for manipulating the demos:
  • Core Javascript/PHP rendering engine
  • JSON parsing for demo data
  • Core template and two sub-templates for each category (projectile and collisions

Timeline (tentative)[edit]

  • Stage 1:
    • Checking into the best approach in terms of Javascript physics engine
    • Familiarizing myself with the JS physics engine functionality.
    • Creating the base core of the mediawiki plugin
  • Stage 2:
    • Working on the mediawiki plugin: preparing for converting markup to object creation and setting up scenes with extendible options.
    • Creating a base template to parse mediawiki markup into the js engine commands
  • Stage 3:
    • Creating a child-template for "projectile movement"
    • Creating a child-template for "collisions"
    • Testing various scenarios with multi-body scenes for both scenes
    • Testing with more than one scene embed on the same wiki page

If time permits:

  • Creating a GUI for adding or editing a scene
  • Creating child-template for "rotational movement"

Availability[edit]

If accepted to GSoC, I will be available throughout the summer from the end of May to the end of August. I may have to take a summer class, but it is scheduled to be a couple of days a week during the evening, and accommodates full-time work. I will also work during the weekends, so this coursework time will be very much compensated for.

About you[edit]

I have a bachelor's in Physics and am now studying for my Computer Science masters in the New York Institute of Technology in New York City. I've always been very passionate about both, and I think physics can benefit from insights from computer science and vise versa.

Participation[edit]

There are a number of groups that can be helpful in finding resources about this subject. First, physics engine groups related to box2d and javascript/html5 strategies. Also, there are quite a number of groups that can help with finding the best basic physics demonstrations and formulas like physicsGRE forums.

Past open source experience[edit]

I've created a couple of small extensions to lesser-known CMS systems and some side projects in PHP, Javascript/jQuery and Perl. I've worked with SVG rendering libraries (RaphaelJS) and I have experience with physics/math modelling.

For more about my past projects, you can check out my github page.

I am hoping this will be my first proper big contribution to the community!

Any other info[edit]

I have submitted another proposal to GSoC2013 for MediaWiki (Internationalization and Right-To-Left Support in VisualEditor) that seems to have more demand.

However way the GSoC projects go, if this idea has merit, I'd love to do it regardless of GSOC, so I would appreciate the comments and thoughts about this. I would like to make sure it is something the community wants to have, and that I am not missing any important aspects that may make this project not feasible to produce or maintain.

Thank you for your thoughts!

Moriel