diff options
-rw-r--r-- | ardor3d-core/src/main/java/com/ardor3d/scenegraph/extension/BillboardNode.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/extension/BillboardNode.java b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/extension/BillboardNode.java index 8a3cad5..95605f7 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/extension/BillboardNode.java +++ b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/extension/BillboardNode.java @@ -205,6 +205,7 @@ public class BillboardNode extends Node { _left.setX(_left.getX() * invLength); _left.setY(0.0); _left.setZ(_left.getZ() * invLength); + _left.normalizeLocal(); // compute the local orientation matrix for the billboard _orient.setValue(0, 0, _left.getZ()); @@ -220,13 +221,14 @@ public class BillboardNode extends Node { _left.setX(_left.getX() * invLength); _left.setY(_left.getY() * invLength); _left.setZ(0.0); + _left.normalizeLocal(); // compute the local orientation matrix for the billboard _orient.setValue(0, 0, _left.getY()); _orient.setValue(0, 1, _left.getX()); _orient.setValue(0, 2, 0); - _orient.setValue(1, 0, -_left.getY()); - _orient.setValue(1, 1, _left.getX()); + _orient.setValue(1, 0, -_left.getX()); + _orient.setValue(1, 1, _left.getY()); _orient.setValue(1, 2, 0); _orient.setValue(2, 0, 0); _orient.setValue(2, 1, 0); |