Can I add a SpatialTransformer to an object that is already in the scene graph?
All the demos have this order:
(pseudocode)
Box box=new Box;
SpatialTransformer st=new SpatialTransformer;
st.setRepeatType(SpatialTransformer.RT_WRAP);
st.setObject(box,0,0);
st.setPosition(0,0,new Vector3f(0,0,0));
st.setPosition(0,4,new Vector3f(4,0,0));
st.interpolateMissing();
box.addControler(st);
rootNode.attachChild(box);
when I try to add a controler to an object that's already in the tree, nothing happens:
SpatialTransformer objrotate = new SpatialTransformer(1);
objrotate.setObject(rootNode.getChild("scene0"),0,0);
Quaternion x0=new Quaternion();
x0.fromAngleAxis(0,new Vector3f(0,1,0));
Quaternion x90=new Quaternion();
x90.fromAngleAxis((float) (Math.PI/2),new Vector3f(0,1,0));
Quaternion x180=new Quaternion();
x180.fromAngleAxis((float) (Math.PI),new Vector3f(0,1,0));
Quaternion x270=new Quaternion();
x270.fromAngleAxis((float) (3*Math.PI/2),new Vector3f(0,1,0));
objrotate.setRotation(0,0,x0);
objrotate.setRotation(0,4,x90);
objrotate.setRotation(0,8,x180);
objrotate.setRotation(0,12,x270);
objrotate.setRotation(0,16,x0);
objrotate.interpolateMissing();
objrotate.setRepeatType(Controller.RT_WRAP);
rootNode.getChild("scene0").addController(objrotate);
thanks
i think i hold the best record on this forum: 3 posts with 0 replies
I have no idea what SpatialTransformer does, I just wanted to reply to break your no reply streak
thanks. i appreciate the moral support.