Hi im developing a chess game and im trying to move a piece model, lets say a king to a square on the board.
Each square is a seperate model as is each piece so i figured i could just get the ceter point of the square and transate the king to it. simple!
But im getting some strange effects the king is moving but not to the center point of the square, it seems to be offset by a lot for some reason here is the code i’m using
public void movePiece(Node sourcePiece, Node targetSquare){
Transform3D translate = new Transform3D();
Vector3f move = new Vector3f (targetSquare.getVworldBounds().getCenter());
translate.setTranslation(move);
sourcePiece.getTransformGroup().setTransform(translate);
}
The models im using are .ase exported from 3dmax and im loading them with an ase loader as supllied with the convert coords to xith3D option true.
all help is greatly appriciated as this is for a college project which needs to be finished fairly soon. thanks
