Basically I have this class:
package Actions;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.vecmath.AxisAngle4f;
public class Rotate {
public Rotate(Transform3D Trans, TransformGroup group, float SpinVar, float Speed, String Axis) {
switch(Axis.toLowerCase()) {
case "x":
Trans.setRotation(new AxisAngle4f(Speed,0f,0f,SpinVar));
break;
case "y":
Trans.setRotation(new AxisAngle4f(0f,Speed,0f,SpinVar));
break;
case "z":
Trans.setRotation(new AxisAngle4f(0f,0f,Speed,SpinVar));
break;
}
group.setTransform(Trans);
}
}
to rotate a given transform but (as you can expect) since the code is written to set rotation with at least one of the values being 0f it resets the angle on one of the axis which is not wanted, instead I want a way to be able to add to the rotation value instead of setting it so it makes it easier to read and wont reset the transforms rotational value on any axis :)