Package com.ardor3d.math

Examples of com.ardor3d.math.Matrix3.lookAt()


        SkeletalDebugger.bone.setWorldTranslation(stPnt.add(endPnt, store).divideLocal(2.0));
        Vector3.releaseTempInstance(store);

        // Orient bone to point along axis formed by start and end points.
        final Matrix3 orient = Matrix3.fetchTempInstance();
        orient.lookAt(endPnt.subtractLocal(stPnt).normalizeLocal(), Vector3.UNIT_Y);
        final Quaternion q = new Quaternion().fromRotationMatrix(orient);
        q.normalizeLocal();
        SkeletalDebugger.bone.setWorldRotation(q);

        // Offset with skin transform
View Full Code Here


                sphere.setTranslation(intersectionPoint);

                final Vector3 intersectionNormal = pickResults.getPickData(0).getIntersectionRecord()
                        .getIntersectionNormal(0);
                final Matrix3 rotation = new Matrix3();
                rotation.lookAt(intersectionNormal, Vector3.UNIT_Z);
                arrow.setRotation(rotation);
                arrow.setTranslation(intersectionPoint);
            }
        }
    }
View Full Code Here

                sphere.setTranslation(intersectionPoint);

                final Vector3 intersectionNormal = pickResults.getPickData(0).getIntersectionRecord()
                        .getIntersectionNormal(0);
                final Matrix3 rotation = new Matrix3();
                rotation.lookAt(intersectionNormal, Vector3.UNIT_Z);
                arrow.setRotation(rotation);
                arrow.setTranslation(intersectionPoint);
            }
        }
    }
View Full Code Here

            } else if (type == TransformElementType.Lookat) {
                final Vector3 pos = new Vector3(array[0], array[1], array[2]);
                final Vector3 target = new Vector3(array[3], array[4], array[5]);
                final Vector3 up = new Vector3(array[6], array[7], array[8]);
                final Matrix3 rot = new Matrix3();
                rot.lookAt(target.subtractLocal(pos), up);
                workingMat.set(rot);
                workingMat.setColumn(3, new Vector4(array[0], array[1], array[2], 1.0));
                finalMat.multiplyLocal(workingMat);
            } else {
                if (logger.isLoggable(Level.WARNING)) {
View Full Code Here

            } else if ("lookat".equals(transform.getName())) {
                final Vector3 pos = new Vector3(array[0], array[1], array[2]);
                final Vector3 target = new Vector3(array[3], array[4], array[5]);
                final Vector3 up = new Vector3(array[6], array[7], array[8]);
                final Matrix3 rot = new Matrix3();
                rot.lookAt(target.subtractLocal(pos), up);
                workingMat.set(rot);
                workingMat.setColumn(3, new Vector4(array[0], array[1], array[2], 1));
                finalMat.multiplyLocal(workingMat);
            } else {
                logger.warning("transform not currently supported: " + transform.getClass().getCanonicalName());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.