Since I need non-uniform scaling, I implemented a simple vertex controller based on the sample found under
http://www.jpct.net/forum/viewtopic.php?t=58&sid=32df672d03d554c73d05aea39064604eHowever, the apply() method gets never called (I check this via some System.out.println()). Contrary to the mentioned sample, I use this not with a plane but with a cylinder.
source parts:
Object3D tmp = new Object3D(source[n]);
tmp.build();
NUScale scaler = new NUScale(this, middle);
if(tmp.getMesh().setVertexController(scaler, IVertexController.PRESERVE_SOURCE_MESH) == false)
return(null);
// ....
public class NUScale extends GenericVertexController
{
//...
public void apply()
{
env.debug("NUScale.apply");
}
// ...
(never mind that the source looks strange - I've omitted a few things)
While we're at it: a few more questions on VertexControllers (please forgive me if some answers may be found elsewhere):
- what about other modifications applied to the object (i.e. translate() and rotate()) - are they reflected into the mesh/normals? if so, what is the order?
- are the vector coordinates in sourceMesh / sourceNormals world-coordinates or object-coordinates?
Thanks in advance