Rotate a colorcube and stop when a value is 1
Posted by Davidave on Dec 11, 2014; 4:36pm
URL: https://forum.jogamp.org/Rotate-a-colorcube-and-stop-when-a-value-is-1-tp4033740.html
Hey guys. I need your help one more time !
in my programm i am looking in front of a rotating colorcube. when a value "stop" gets 1 i want to STOP the rotation. thats no problem so far! But when it stops it should show me the RED side of the colorcube! how can i do that ?
here is some of my code!
Transform3D drehCube3D = new Transform3D();
TransformGroup drehGroup = new TransformGroup();
drehGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
TransformGroup tgdrehfinal = new TransformGroup();
Vector3f v3DrehCube = new Vector3f(0f, 1f, 0f);
drehCube3D.setTranslation(v3DrehCube);
ColorCube drehbox = new ColorCube(0.3);
drehbox.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
drehGroup.setTransform(drehCube3D);
drehGroup.addChild(drehbox);
AlphadrehAlpha = new Alpha(1000,1000);
rotint = new RotationInterpolator(AlphadrehAlpha, drehGroup );
rotint.setSchedulingBounds(new BoundingSphere());
branch.addChild(rotint);
tgdrehfinal.addChild(drehGroup);
branch.addChild(tgdrehfinal);
return branch;
}
if ( stop == 1){
AlphadrehAlpha.pause();
System.out.println("yes");
}
i set my alpha 0nPause when stop gets 1 ! but NOW it stops at any point. how can I say that it should stop at the right position(when i can see the red side)?