Problem with scaling after rotation

If I scale a Geometry after I rotate it first, it scales it relative to its original position, not it rotated position. For example



[java]Mesh m = new Cylinder(6,6,10f,10f, true);

Geometry gc = new Geometry(“c”, m);

gc.setMaterial(mat_box);

gc.rotate((float)(Math.PI/2.), 0f, 0f);

gc.scale(1f,10f,1f);[/java]



does not give a tall, upright cylinder, it gives a cylinder stretched backward in the z-axis. This doesn’t seem like how rotation and scaling should work, but am I missing something? Why does it scale it relative to its old coordinate system?

Uh, yes it is, thats why its called localRotation. You still rotate around the geometries x-axis and also scale along the geometries y-axis, which is equivalent to the world z-axis after your rotation operation. You get the same result no matter in which order you do the operations which is intended and would not bet the case with the way you expect it to work.