Package com.jme3.math

Examples of com.jme3.math.Vector3f.dot()


        for (int i = 0, pointIndex = 0; i < positions.length; i += 9) {
            triangle.set(0, positions[i], positions[i + 1], positions[i + 2]);
            triangle.set(1, positions[i + 3], positions[i + 4], positions[i + 5]);
            triangle.set(2, positions[i + 6], positions[i + 7], positions[i + 8]);
            Vector3f n = triangle.getNormal();
            float dotNX = Math.abs(n.dot(x));
            float dorNY = Math.abs(n.dot(y));
            float dotNZ = Math.abs(n.dot(z));
            if (dotNX > borderAngle) {
                if (dotNZ < borderAngle) {// discard X-coordinate
                    uvCoordinates[pointIndex++] = (triangle.get1().y - min.y) / ext[1];
View Full Code Here


            triangle.set(0, positions[i], positions[i + 1], positions[i + 2]);
            triangle.set(1, positions[i + 3], positions[i + 4], positions[i + 5]);
            triangle.set(2, positions[i + 6], positions[i + 7], positions[i + 8]);
            Vector3f n = triangle.getNormal();
            float dotNX = Math.abs(n.dot(x));
            float dorNY = Math.abs(n.dot(y));
            float dotNZ = Math.abs(n.dot(z));
            if (dotNX > borderAngle) {
                if (dotNZ < borderAngle) {// discard X-coordinate
                    uvCoordinates[pointIndex++] = (triangle.get1().y - min.y) / ext[1];
                    uvCoordinates[pointIndex++] = (triangle.get1().z - min.z) / ext[2];
View Full Code Here

            triangle.set(1, positions[i + 3], positions[i + 4], positions[i + 5]);
            triangle.set(2, positions[i + 6], positions[i + 7], positions[i + 8]);
            Vector3f n = triangle.getNormal();
            float dotNX = Math.abs(n.dot(x));
            float dorNY = Math.abs(n.dot(y));
            float dotNZ = Math.abs(n.dot(z));
            if (dotNX > borderAngle) {
                if (dotNZ < borderAngle) {// discard X-coordinate
                    uvCoordinates[pointIndex++] = (triangle.get1().y - min.y) / ext[1];
                    uvCoordinates[pointIndex++] = (triangle.get1().z - min.z) / ext[2];
                    uvCoordinates[pointIndex++] = (triangle.get2().y - min.y) / ext[1];
View Full Code Here

    rootNode.addLight(sun);
  }

  private void initStarGate() {
    Vector3f waterLocation = new Vector3f(0, -6, 0);
    waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y, waterLocation.dot(Vector3f.UNIT_Y)));

    Node ship = new Node("Carrier");

    Spatial center = assetManager.loadModel("spaceobject/gates/stargate/center.mesh.xml");
    center.setShadowMode(ShadowMode.Receive);
View Full Code Here

        Vector3f v1 = new Vector3f(f1[0], f1[1], f1[2]);
        Vector3f v2 = new Vector3f(f2[0], f2[1], f2[2]);
        Vector3f v3 = new Vector3f(f3[0], f3[1], f3[2]);

        Vector3f cross = v1.cross(v2);
        float result = cross.dot(v3);

        if(result > 0)
          geom.getMaterial().getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
        else
          geom.getMaterial().getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
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.