Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Matrix4f.rotate()


  }

  public static void glRotatef(final float angle, final float x, final float y, final float z) {
    final Matrix4f m = getCurrentMatrix();
    v3f.set(x, y, z);
    m.rotate((float)toRadians(angle), v3f);
  }

  public static void glOrtho(final float l, final float r, final float b, final float t, final float n, final float f) {
    final Matrix4f m = m4f;
    m.setIdentity();
View Full Code Here


    Matrix4f matrix = new Matrix4f();

    matrix.translate(new Vector3f(-position.x, -position.y, -position.z));

    // convert angles from degrees to radians
    matrix.rotate((float) ((-rotX) * Math.PI / 180.0), new Vector3f(1.0f, 0.0f, 0.0f));
    matrix.rotate((float) ((-rotY) * Math.PI / 180.0), new Vector3f(0.0f, 1.0f, 0.0f));
    matrix.rotate((float) ((-rotZ) * Math.PI / 180.0), new Vector3f(0.0f, 0.0f, 1.0f));

    return matrix;
  }
View Full Code Here

    matrix.translate(new Vector3f(-position.x, -position.y, -position.z));

    // convert angles from degrees to radians
    matrix.rotate((float) ((-rotX) * Math.PI / 180.0), new Vector3f(1.0f, 0.0f, 0.0f));
    matrix.rotate((float) ((-rotY) * Math.PI / 180.0), new Vector3f(0.0f, 1.0f, 0.0f));
    matrix.rotate((float) ((-rotZ) * Math.PI / 180.0), new Vector3f(0.0f, 0.0f, 1.0f));

    return matrix;
  }

View Full Code Here

    matrix.translate(new Vector3f(-position.x, -position.y, -position.z));

    // convert angles from degrees to radians
    matrix.rotate((float) ((-rotX) * Math.PI / 180.0), new Vector3f(1.0f, 0.0f, 0.0f));
    matrix.rotate((float) ((-rotY) * Math.PI / 180.0), new Vector3f(0.0f, 1.0f, 0.0f));
    matrix.rotate((float) ((-rotZ) * Math.PI / 180.0), new Vector3f(0.0f, 0.0f, 1.0f));

    return matrix;
  }

  public static void setPosition(Vector3f position) {
View Full Code Here

       
        /* Populate msh list with right .obj meshes */
        switch(trackType){
          case EW_STRAIGHT:
            mRotation -= 90f;
            rotMat.rotate((float) Math.toRadians(mRotation), new Vector3f(0, 1, 0));
          case NS_STRAIGHT:
            //msh.add(trackStraight);
            msh.add(objMeshes.get("res/mesh/track.obj"));
            break;

View Full Code Here

            mRotation -= 90f;
          case NW_CURVE:
            mRotation -= 90f;
          case SW_CURVE:
            mRotation -= 90f;
            rotMat.rotate((float) Math.toRadians(mRotation), new Vector3f(0, 1, 0));
          case SE_CURVE:
            //msh.add(track90Corner);
            msh.add(objMeshes.get("res/mesh/track_90_corner.obj"));
            break;
View Full Code Here

            mRotation -= 90f;
          case SWN_CROSS:
            mRotation -= 90f;
          case ESW_CROSS:
            mRotation -= 90f;
            rotMat.rotate((float) Math.toRadians(mRotation), new Vector3f(0, 1, 0));
          case NES_CROSS:
            //msh.add(trackTCrossing);
            msh.add(objMeshes.get("res/mesh/track_t_cross.obj"));
            break;
View Full Code Here

            msh.add(objMeshes.get("res/mesh/track_t_cross.obj"));
            break;

          case EW_STATION:
            mRotation -= 90f;
            rotMat.rotate((float) Math.toRadians(mRotation), new Vector3f(0, 1, 0));
          case NS_STATION:
            //msh.add(trackStraight);
            //msh.add(station);
            msh.add(objMeshes.get("res/mesh/track.obj"));
            msh.add(objMeshes.get("res/mesh/station2.obj"));
View Full Code Here

            mRotation -= 90f;
          case SWN_STATION:
            mRotation -= 90f;
          case ESW_STATION:
            mRotation -= 90f;
            rotMat.rotate((float) Math.toRadians(mRotation), new Vector3f(0, 1, 0));
          case NES_STATION:
            //msh.add(trackTCrossing);
            //msh.add(station);
            msh.add(objMeshes.get("res/mesh/track_t_cross.obj"));
            msh.add(objMeshes.get("res/mesh/station2.obj"));
View Full Code Here

            }
            break;
           
          case TREE:
            transMat.translate(new Vector3f(((float)Math.random()-0.5f)*0.8f, 0, ((float)Math.random()-0.5f)*0.8f));
            rotMat.rotate((float) Math.toRadians(Math.random()*360.0), new Vector3f(0, 1, 0));
            msh.add(objMeshes.get("res/mesh/cactus_trunk.obj"));
            if(rand.nextFloat() > 0.15f){
              msh.add(objMeshes.get("res/mesh/cactus_branch1.obj"));
            }
            if(rand.nextFloat() > 0.15f){
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.