I figured it out ... seems the + and - signs make a big difference when orbiting on the z axis ... so with that said here is the code if you want to make your own unique orbits ...
if you want to orbit on a different axis just change around the x,y,z cords as needed ... as I said this code orbits the z axis. The floating point and whole number after the cos and sin add the option of playing around with the orbit ... stretch it to elliptical ... widen it ect.
Have fun ... I know I am ... now if I could only get a blazing sun rather than a dull object giving off light :-)
Code Select
myOrbitAngle += myOrbitSpeed;
if(myOrbitAngle > Math.PI * 2)
myOrbitAngle %= Math.PI * 2;
SimpleVector sv = new SimpleVector();
//double rad = (myOrbitAngle * (Math.PI / 180)); // Converting Degrees To Radians
double x = myOrbit.getTransformedCenter().x - distanceFromParent * (Math.cos(myOrbitAngle)* .5);
double z = myOrbit.getTransformedCenter().z - distanceFromParent * (Math.sin(myOrbitAngle) * 1);
sv.x = (float) x;
sv.z = (float) z;
sv.y = 0;
myObject.clearTranslation();
myObject.translate(sv);
myObject.rotateY(myOrbitSpeed);
if you want to orbit on a different axis just change around the x,y,z cords as needed ... as I said this code orbits the z axis. The floating point and whole number after the cos and sin add the option of playing around with the orbit ... stretch it to elliptical ... widen it ect.
Have fun ... I know I am ... now if I could only get a blazing sun rather than a dull object giving off light :-)