Verge3D Developer Kit

Verge3D Developer Kit (DevKit) is a collection of examples, tools and source code which comes with Verge3D Enterprise package. This collection will help you to perform various developer tasks such as:

Developer Kit is intended for seasoned programmers who wish to modify the engine. You don't need it for creating Verge3D applications with the standard set of functionality.

Installation and Configuration

Grab the DevKit archive from the download area of your account dashboard. Unpack this archive to a directory of your choice.

If you're going to build Verge3D engine or Puzzles from source code, you'll need the npm utility which is part of the Node.js runtime. You can install it by following these instructions.

Finally, go to the unpacked directory of DevKit and execute the following command to install the dependencies:

npm install

DevKit Structure

Freshly installed DevKit includes the following directories:

Directory Description
addons/verge3d Source code of Blender add-on (Verge3D for Blender only).
build Pre-built Verge3D engine scripts and additional modules (ammo.js, etc).
max_plugin Source code of 3ds Max plugin (Verge3D for 3ds Max only).
maya_plugin Source code of Maya plugin (Verge3D for Maya only).
puzzles Pre-built scripts and source code of the Puzzles editor.
python Python 3 runtime and utility modules.
src Verge3D engine source code.
templates Verge3D application templates.
wordpress Verge3D for WordPress plugin source code.
xz Source code of the XZ compression module.

Building Verge3D

Before compiling Verge3D, please make sure you installed npm and all required dependencies as described above.

To compile an unoptimized build of Verge3D, which suits well for testing and debugging purposes, execute the following command in the DevKit directory:

npm run build

You can find the compiled modules inside the build directory of your DevKit. To test it, simply copy v3d.js engine module to your application inside Verge3D installation, for example:

cp build/v3d.js ~/verge3d/applications/my_awesome_application/

To compile an optimized of Verge3D (aka release version), execute the following command in the DevKit directory:

npm run build-release

The following commands are used to build the Puzzles logic editor. To build an unoptimized version type:

npm run build-puzzles

To build an optimized version, execute:

npm run build-puzzles-release

You can find the compiled Puzzles editor script inside the puzzles directory of your DevKit. To apply it to Verge3D, copy the entire content of this directory to the puzzles directory inside your Verge3D installation (replacing files which already exist there).

Adding New Method to JavaScript API

Say, you want to add another method to the App class. For example, a printHelloWorld() method should print something to the browser console:


The App class is implemented in the module located at src/extras/App.js. Open it and add the following code to the end of the file, just before the closing brackets of the App class. Don't forget to add another comma where the previous method ends.

printHelloWorld: function() { console.log('Hello World!'); }

Build and copy the Puzzles runtime to your Verge3D installation folder. You can now try the newly added block in the Puzzles editor.

Adding New Class to JavaScript API

To supplement the Verge3D API with some custom class, create a .js file named after your class in a relevant subdirectory of DevKit's src folder (e.g. src/extras/MyAwesomeClass.js). In this .js file, implement your class - you can get inspired by already existing classes. Finally, register your class in the global namespace v3d by adding the following line in src/v3d.js file:

export { MyAwesomeClass } from './extras/MyAwesomeClass.js';

Build and copy the Verge3D runtime to your application, and try it out in the browser console.

var myAwesomeStuff = new v3d.MyAwesomeClass(); myAwesomeStuff.whatEver();

Adding New Puzzles

To create a custom Puzzles block, edit the puzzles/src/puzzles_blocks.js file. You can get inspired by already existing puzzles. Register it in a relevant toolbox category in the top of the file.

Build and copy the Puzzles runtime to your Verge3D installation folder. You should now find your new puzzle in the toolbox of the Puzzles editor.

Got Questions?

Feel free to ask on the forums!