title: Java3D Sphere Orbit
body: <p>I've looked everywhere and I can't find anything on how to make a sphere orbit a central point in Java 3D. Specifically I want to make a sphere do a circular motion around the origin at a constant speed and for it to loop forever. I guess that these equations are to do with it:</p>
  <blockquote>
  <p>X = originX + sin(angle)*Size;</p>
  <p>Y = originY + cos(angle)*Size;</p>
  </blockquote>
  <p>I tried using a PositionInterpolator but that only covers 1 axis so doesn't form a circular orbit. Also I noticed only 1 transformation can be done at a time, the spinning on the axis OR the PositionInterpolator, How do I have both transformations applied to the object at once ?</p>
  <pre><code>      Planet planet = new Planet(new Color3f(0.2f,0.2f,0.2f),new Vector3f(1.0f,0.0f,-10.0f), 0.2f,1.0f,1.0f, 1.0f);
        Sphere planet = new Sphere(planet.radius,planet.pl);
      
      Transform3D tfgPlanet = new Transform3D();
      
    //  tfg.setTranslation(planet.position);
      tfgplanet.setTranslation(planet.position);
      TransformGroup tgm = new TransformGroup(tfgPlanet);
      tgm.addChild(planet);
      theScene.addChild(tgm);
  
  
      Transform3D planetRotate = new Transform3D();
      
      int timerotation = 1500;//A slow rotation takes 1.5 seconds.
      
      //The Alpha for rotation
      Alpha planetRotationStart = new Alpha(1000,
              Alpha.INCREASING_ENABLE,0,0,timerotation,0,0,0,0,0);
  
      //rotate around axis
      RotationInterpolator planetrotation = new RotationInterpolator(
      planetRotationStart,tgm,
      planetRotate,planet.orbitAngle,(float) Math.PI*2);
  
      BoundingSphere bind = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
      planetrotation.setSchedulingBounds(bind);
  
      tgm.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
      tgm.addChild(planetrotation);
      
  
      Alpha planetOrbit = new Alpha(1000,
              Alpha.INCREASING_ENABLE,0,0,timerotation,0,0,0,0,0);
      
      Transform3D axis = new Transform3D();
      PositionInterpolator pi = new PositionInterpolator(planetOrbit,tgm,axis,1.0f, 10.0f);
      pi.setSchedulingBounds(bind);
      tgm.addChild(pi);
  
      //compiles scene
       theScene.compile();
  
      //Add everything to the universe.
      su.addBranchGraph(theScene);
      }
  </code></pre>