wiki:MakeYourOwnProject

Version 3 (modified by dennisr, 8 years ago) (diff)

--

Start making your own project

Once you have successfully started the first demo program (following the QuickStart instructions), you have seen a virtual human, and you have been able to experiment with a few BML instructions. The next step is to start building your own application, or connecting Elckerlyc to your own application. This page gives some pointers to get you started.

Building a project that includes Elckerlyc

Eclipse

Using Apache Ant, command prompt, and the HMI build system

If you prefer to use Apache Ant and a command prompt for compiling your Java software, then you might like to use the Ant based build system that is shipped with Elckerlyc. One of the great advantages of this system is that it allows you to easily deploy your application on various operating systems for 32bit and 64bit machines.

Connecting your application to Elckerlyc

Directly integrate Elckerlyc in your Java program

Connecting to Elckerlyc using a TCPIP Adapter

Changing the configuration of your Virtual Human

See the VirtualHumanSpec? documentation for information on how you can configure your Virtual Human with a different body, new face and gesture repertoires, other TTS voices, various GUI elements such as a face expression editor or a voice selection dropdown, etcetera.

Loading a nice background scene for the Virtual Human

The Elckerlyc graphical environment supports the Collada graphics format. Below, you see an example of how to load a scene into the environment.

The example assumes the following directory setup:

 <resource directory that is on the resource path>/
 <resource directory that is on the resource path>/modeldirectory/
 <resource directory that is on the resource path>/modeldirectory/room.dae

See UsingResources for information on how to make sure that the directory <resource directory that is on the resource path> can be found and used by Elckerlyc.

Required imports:

import hmi.graphics.opengl.scenegraph.GLScene;
import hmi.graphics.opengl.scenegraph.VGLNode;
import hmi.graphics.opengl.GLTextureLoader;
import hmi.graphics.opengl.GLRenderList;
import hmi.graphics.util.SceneIO;
import hmi.animation.VJoint;

The code to load the room:

    ElckerlycEnvironment env; //of course, this variable needs to be initialized
    public void initRoom()
    {
      String roomDir = "modeldirectory";
      String room = "room.dae";

      GLTextureLoader.addTextureDirectory(roomDir);
      GLScene glScene = null;
      glScene = SceneIO.readGLScene(roomDir, room, null) ;
      glScene.sortGLShapeList();
      GLRenderList shapeListRoom = glScene.getGLShapeList();
      
      VJoint roomJoint = new VJoint ("room");
      roomJoint.setTranslation(0f,0,0);
      roomJoint.addChild(glScene.getToplevelVJoint());
      VGLNode roomNode = new VGLNode(roomJoint, shapeListRoom); // 
      env.addVisualisation(roomNode);
      env.getHmiRenderEnvironment().addWorldRenderChild(roomNode.getRoot());
          
    }

See the MyFirstProject example for how you initialize the ElckerlycEnvironment variable.