Example Source Code (Cont’d)
root.children <<= vehicle.children <<= camera;
vehicle.children <<= spaceball;
root.children <<= cursor.children <<= curshape.geometry <<= curpointer;
root.children <<= object1;
root.children <<= object2;
object1.children <<= shape;
object2.children <<= shape;
shape.geometry <<= box;
shape.appearance <<= app.material <<= mat;
mat.specular = MeColor (0.7, 0.5, 0.5);
mat.diffuse = MeColor (0.2, 0.2, 0.2);
mat.shininess = 0.9;
vehicle.rotation = MeQuaternion (MeVector (0,0,1), -0.75*PI) *
MeQuaternion (MeVector (1,0,0), -racos(1.0/rsqrt(3.0)));
vehicle.translation = MeVector (6, 6, 6);
matxlate.matrix <<= vehicle.matrix;
matxlate.translation <<= spaceball.translation;
curbutnotifier.source <<= spaceball.button;
curposnotifier.source <<= cursor.translation <<= matxlate;
curpointer.radius = 0.3f;
setRoot (root);
cout << "Scene creation done." << endl;
cout << endl;