OIV 之引擎(基于COIN 3D)

 :一个引擎与一个SoRotationXYZ节点的数据域相关连,当实时时钟发生变化时,引擎会同时修改在SoRotationXYZ节点中的角度数据。

key code:

// This transformation is modified to rotate the cone SoRotationXYZ *myRotXYZ = new SoRotationXYZ; root->addChild(myRotXYZ); // An engine rotates the object. The output of myCounter // is the time in seconds since the program started. // Connect this output to the angle field of myRotXYZ //myRotXYZ->axis = SoRotationXYZ::X; // rotate about X axis X轴旋转 myRotXYZ->axis = SoRotationXYZ::Y; // rotate about Y axis Y轴旋转 SoElapsedTime *myCounter = new SoElapsedTime;//Controllable time source engine. myRotXYZ->angle.connectFrom(&myCounter->timeOut);//将时间和旋转角度联系起来

你可能感兴趣的:(OIV 之引擎(基于COIN 3D))