What is WTK R6?

WorldToolKit R6 is a portable, cross-platform software development system for building high-performance, real-time, integrated 3D applications for scientific and commercial use. The WTK library has more than 900 high-level functions for configuring, interacting with, and controlling real-time simulations

 

Object-orientated structure

WTK is structured in an object-orientated manner, although it does not use inheritance or dynamic binding. WTK functions are object-orientated in their naming conventions WTK functions are grouped into classes

WTK Basics

WTK is so named because your applications can resemble virtual worlds Object can have real world properties and behaviors. Worlds are controlled by a variety of input devices 2d mice - 6d sensors. Users experience worlds through a computer display or by using HMDs. Simulations are built by assembling NODES into a hierarchy called a SCENE GRAPH.

Naming Conventions

 

A Sample WTK application

/* a sample WTK application code */
/* include this file with all wtk applications */
#include "wt.h"

/* function declarations */
void actions(void);

/* globals */
WTsensor *spaceball = NULL;

int main(void)
{

/* initialize the simulation manager */
WTuniverse_new(WTDISPALY_DEFAULT, WTWINDOW_DEFAULT);

/* load a default lighting file */
WTlightnode_load(WTuniverse_getrootnodes(), "lights");

/* load a geometry from a file *.
if (!WTnode_load(WTuniverse_getrootnodes(0, "mygeofile", 1.0f);

/* initialize a spaceball sensor */
spaceball = WTspaceball_new(SERIAL1);

/* set the universe action functions */
WTuniverse_setactions(actions);

/* scale the sensor to the speed of the universe */
WTsensor_setsensitivity(spaceball, 0.1f * WTnode_getradius(WTuniverse_getrootnodes());

/* attach the sensor to the viewpoint using a motion-link
WTmotionlink_new(spaceball, WTuniverse_getviewpoints(), WTSOURCE_SENSOR, WTTARGET_VIEWPOINT);

/* ready the universe for the simulation loop */
WTuniverse_ready();

/* Enter the main simulation loop */
WTuniverse_go();

/* Exit the application and clean up */
WTuniverse_delete();

/* return */
return 1;

}

/* The action function */
void actions(void)
{

/* stop by pressing button one on the spaceball */
if (WTsensor_getmiscdata(spaceball) & WTSPACEBALL_BUTTON1)
WTuniverse_stop();

} /* end actions */