import vrml.*; import vrml.node.*; import vrml.field.*; import java.lang.Math; public class tail extends Script { private SFRotation rotation; public void initialize( ) { rotation = (SFRotation)getField( "rotation" ); } public void timer( float frac ) { float rot[] = new float[4]; rot[0] = 0; rot[1] = 1; rot[2] = 0; rot[3] = (float)( 0.8 * Math.sin( frac*6.28 ) ); rotation.setValue( rot ); } public void processEvent( Event e ) { String EventName = e.getName( ); if( EventName.equals( "setfraction" ) ) timer( ((ConstSFFloat)e.getValue()).getValue() ); } }