I want to make a cylinder that rotates each frame, then gets scaled (smaller) along the y axis (say, small enough to make it look like a quad). The effect I’m trying to achieve is that the texture on the cylinder would appear to be moving sideways, but the cylinder would not.appear to rotate. My setup for the scene is as follows:
Scene node - the node for the scene (rootNode for example).
Intermediate node - I set the scale of this object.
Cylinder geometry object - I set the rotation of this object.
My expectation would be that the object at the lowest level (the geometry in this case) be rotated first, then the next level spatial’s scale would apply. I’m finding the opposite. It’s as if I’m applying scale and rotation to the same thing.
If I have a big scene in a single node, and I scaled it on one or two axes, my expectation would be that objects in the same level keep their relative scales on those axes, but that doesn’t happen if any of them have different rotations.
Is this intentional? And if it is, why?
I threw together some code in case anyone wanted to see what I was doing:
[java] @Override
public void simpleInitApp()
{
Cylinder test=new Cylinder(16,16,2,2);
geom=new Geometry("",test);
Node temp=new Node("");
temp.attachChild(geom);
temp.rotate(0,FastMath.HALF_PI,0);//rotate so it faces the samera
temp.setLocalScale(1,0.1f,1);
Material mat = new Material(assetManager,“Common/MatDefs/Misc/Unshaded.j3md”);
mat.setTexture(“ColorMap”,assetManager.loadTexture(“Interface/Logo/Monkey.jpg”));
geom.setMaterial(mat);
rootNode.attachChild(temp);
temp.setLocalTranslation(0,0,-5);
}
@Override
public void simpleUpdate(float tpf)
{
geom.rotate(0,0,0.03f);
}[/java]