Hi everyone,

I am trying to write a solar system model for a uni course project.  As
you can imagine, rotationInterpolators are required to guide the planets
orbits, but i cannot get them to rotate in any way but their default.
When i print out the rotation matrix, it is always the identity matrix.
Code is below.

I have asked someone about this, they suggested ways to do the rotation
myself, but i would prefer to use the roationInterpolator.

 private BranchGroup createScene()
 {
  BranchGroup root = new BranchGroup();

  TransformGroup tg = new TransformGroup();
  tg.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE );
  root.addChild( tg );

  AxisAngle4f aangle =
        new AxisAngle4f(new float[]{4.0f,3.0f,2.0f,0.0f} );

  Transform3D t3d = new Transform3D();
  t3d.setRotation( aangle );

  Alpha alp = new Alpha( -1, 1600 );
  RotationInterpolator rot = new RotationInterpolator(
                alp, tg , t3d, 0, 2*(float)Math.PI);
  rot.setSchedulingBounds( new BoundingSphere() );
  System.out.println( rot.getAxisOfRotation().toString() );
  tg.addChild( rot );

  Transform3D t = new Transform3D();
  t.set(new Vector3f(1.0f,0.0f,0.0f));
  TransformGroup tg2 = new TransformGroup(t);
  tg2.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE );
  tg.addChild(tg2);
  tg2.addChild( new Sphere( 0.1f, Sphere.GENERATE_TEXTURE_COORDS,
80,cEA() ));

  root.compile();
  return root;
 }

 What i need is to be able to rotate a sphere primitive around an
arbitrary access, because some of planets have moons orbiting at odd
angles and directions.

Any help would be greatly apprciated.

Thanks loads

Dave

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to