Hello, I’m a beginner with jmonkey, I’m working on getting a cube to pulsate found in the 4th beginner tutorial. Right now, my cube continues to grow bigger until it is out of the frame. I tried just looking at the solutions in this link http://jmonkeyengine.org/wiki/doku.php/jm3:solutions, but this just redirects me to the documentation page, so perhaps the link is broken?
This is the code I have for HelloLoop:
package jme3test.helloworld;
/** Sample 4 - how to trigger repeating actions from the main event loop.
In this example, you use the loop to make the player character
rotate continuously. */
public class HelloLoop extends SimpleApplication {
public static void main(String[] args){
HelloLoop app = new HelloLoop();
app.start();
}
private int count;
protected Geometry player;
@Override
public void simpleInitApp() {
/** this blue box is our player character */
Box b = new Box(1, 1, 1);
player = new Geometry(“blue cube”, b);
count = 0;
Material mat = new Material(assetManager,
"Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
player.setMaterial(mat);
rootNode.attachChild(player);
}
/* Use the main event loop to trigger repeating actions. */ @Override
public void simpleUpdate(float tpf) {
the axis of rotation
if ((count % 2 ) == 0){
I think the author of this example might have been slightly confused or at least partially so.
Since scale() is applied relative to the current scale, scale(1) will never ever have any effect.
Try changing that to setScale(1) instead.
P.S.: This was a perfectly worded question… it almost brought a tear to my eye. It has exactly the stuff we need to help as quickly as possible. Welcome to the forum.