MODULES
In General

Three.js has adopted the use of modules. A module is js code that contains subroutines that you can use in your program. We plan to create a series of modules that you can use in your programs.

One way to use modules is to create a variable that contains several "subvariables". You can pass that variable to the module for use in making computations. The module can then save the results in that variable. The variable can take the following form:

	let var_ = {
			inputA: 0,
			inputB: 0,
			result: 0
		}

The programs within the module can take several forms.

The module can contain subroutines which you can access using this format:

	initModule(var_);
	moveModule(var_));

Alternatively, the module can be designed such you can initialize and call the program using this format:

	let module = new Module(var_);
	module.update();
Modules

Here are the modules that we have created:

Flight Module A flight simulation module.
Ocean Module An ocean wave generator.
Ocean/GridMap Modules An ocean wave generator and grid map.
Programming Setup

Because we have been working on fairly small programs, we have not yet switched to using a server environment like node.js. Instead, we save our files in a directory named "WebGL" which includes the following subdirectories:

The 3js subdirectory includes a "common" subdirectory which includes elements used by your 3js programs. The first subdirectory in "common" is "air" which includes all of my custom 3js modules. The remaining directories contain your various html/3js programs arranged by topic, such as "Aircraft" and "Flight".
Note: the 3js subdirectroy used to include the latest version of three.js, but this proved to be unnecessary.