當前位置: 首頁>>代碼示例>>Java>>正文


Java Matrix4f.rotate方法代碼示例

本文整理匯總了Java中org.lwjgl.util.vector.Matrix4f.rotate方法的典型用法代碼示例。如果您正苦於以下問題:Java Matrix4f.rotate方法的具體用法?Java Matrix4f.rotate怎麽用?Java Matrix4f.rotate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.util.vector.Matrix4f的用法示例。


在下文中一共展示了Matrix4f.rotate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createTransformationMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static Matrix4f createTransformationMatrix(final Vector3f translation, final float rx, final float ry, final float rz, final float scale) {
    final Matrix4f matrix = new Matrix4f();
    matrix.setIdentity();
    Matrix4f.translate(translation, matrix, matrix);
    Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1, 0, 0), matrix, matrix);
    Matrix4f.rotate((float) Math.toRadians(ry), new Vector3f(0, 1, 0), matrix, matrix);
    Matrix4f.rotate((float) Math.toRadians(rz), new Vector3f(0, 0, 1), matrix, matrix);
    Matrix4f.scale(new Vector3f(scale, scale, scale), matrix, matrix);
    return matrix;
}
 
開發者ID:Biacode,項目名稱:bia-engine,代碼行數:11,代碼來源:Maths.java

示例2: createTransformationMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static Matrix4f createTransformationMatrix(Vector3f translation, float rx, float ry, float rz, float scale) {
	Matrix4f matrix = new Matrix4f();
	matrix.setIdentity();
	Matrix4f.translate(translation, matrix, matrix);
	Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1, 0, 0), matrix, matrix);
	Matrix4f.rotate((float) Math.toRadians(ry), new Vector3f(0, 1, 0), matrix, matrix);
	Matrix4f.rotate((float) Math.toRadians(rz), new Vector3f(0, 0, 1), matrix, matrix);
	Matrix4f.scale(new Vector3f(scale, scale, scale), matrix, matrix);
	return matrix;
}
 
開發者ID:marcioz98,項目名稱:MRCEngine,代碼行數:11,代碼來源:Maths.java

示例3: updateViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
private void updateViewMatrix() {
	viewMatrix.setIdentity();
	Matrix4f.rotate((float) Math.toRadians(180), new Vector3f(0, 0, 1), viewMatrix, viewMatrix);
	Matrix4f.rotate((float) Math.toRadians(pitch), new Vector3f(1, 0, 0), viewMatrix, viewMatrix);
	Matrix4f.rotate((float) Math.toRadians(yaw), new Vector3f(0, 1, 0), viewMatrix, viewMatrix);
	Vector3f negativeCameraPos = new Vector3f(-center.x, -center.y, -center.z);
	Matrix4f.translate(negativeCameraPos, viewMatrix, viewMatrix);

	Matrix4f.mul(projectionMatrix, viewMatrix, projectionViewMatrix);
}
 
開發者ID:TheThinMatrix,項目名稱:OcclusionQueries,代碼行數:11,代碼來源:CubeMapCamera.java

示例4: createViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static Matrix4f createViewMatrix(final Camera camera) {
    final Matrix4f matrix = new Matrix4f();
    matrix.setIdentity();
    Matrix4f.rotate((float) Math.toRadians(camera.getPitch()), new Vector3f(1, 0, 0), matrix, matrix);
    Matrix4f.rotate((float) Math.toRadians(camera.getYaw()), new Vector3f(0, 1, 0), matrix, matrix);
    final Vector3f cameraPos = camera.getPosition();
    final Vector3f negativeCameraPos = new Vector3f(-cameraPos.x, -cameraPos.y, -cameraPos.z);
    Matrix4f.translate(negativeCameraPos, matrix, matrix);
    return matrix;
}
 
開發者ID:Biacode,項目名稱:bia-engine,代碼行數:11,代碼來源:Maths.java

示例5: updateViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static void updateViewMatrix(Matrix4f viewMatrix, float x, float y, float z, float pitch, float yaw){
	viewMatrix.setIdentity();
	Matrix4f.rotate((float) Math.toRadians(pitch), new Vector3f(1, 0, 0), viewMatrix, viewMatrix);
	Matrix4f.rotate((float) Math.toRadians(yaw), new Vector3f(0, 1, 0), viewMatrix, viewMatrix);
	Vector3f negativeCameraPos = new Vector3f(-x, -y, -z);
	Matrix4f.translate(negativeCameraPos, viewMatrix, viewMatrix);
}
 
開發者ID:TheThinMatrix,項目名稱:LowPolyWater,代碼行數:8,代碼來源:Maths.java

示例6: createTransformationMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
/**
 * Creates transformation matrix for models in rendering.
 * @param translation - Translation
 * @param rx - Rotation on the x axis
 * @param ry - Rotation on the y axis
 * @param rz - Rotation on the z axis
 * @param scale - Scale
 * @return - Transformation matrix
 */
public static Matrix4f createTransformationMatrix(Vector3f translation, float rx, float ry, float rz, float scale) {
	Matrix4f matrix = new Matrix4f();
	matrix.setIdentity();
	Matrix4f.translate(translation, matrix, matrix);
	Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1, 0, 0), matrix, matrix);
	Matrix4f.rotate((float) Math.toRadians(ry), new Vector3f(0, 1, 0), matrix, matrix);
	Matrix4f.rotate((float) Math.toRadians(rz), new Vector3f(0, 0, 1), matrix, matrix);
	Matrix4f.scale(new Vector3f(scale, scale, scale), matrix, matrix);

	return matrix;
}
 
開發者ID:Essentria,項目名稱:Elgin-Plant-Game,代碼行數:21,代碼來源:Maths.java

示例7: createViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
/**
 * Creates view matrix based off camera for rendering
 * @param camera - camera to base view matrix
 * @return - New view matrix
 */
public static Matrix4f createViewMatrix(Camera camera) {
	Matrix4f viewMatrix = new Matrix4f();
	viewMatrix.setIdentity();
	Matrix4f.rotate((float) Math.toRadians(camera.getPitch()), new Vector3f(1, 0, 0), viewMatrix, viewMatrix);
	Matrix4f.rotate((float) Math.toRadians(camera.getYaw()), new Vector3f(0, 1, 0), viewMatrix, viewMatrix);
	Vector3f cameraPos = camera.getPosition();
	Vector3f negativeCameraPos = new Vector3f(-cameraPos.x, -cameraPos.y, -cameraPos.z);
	Matrix4f.translate(negativeCameraPos, viewMatrix, viewMatrix);
	return viewMatrix;
}
 
開發者ID:Essentria,項目名稱:Elgin-Plant-Game,代碼行數:16,代碼來源:Maths.java

示例8: updateViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
private void updateViewMatrix() {
	viewMatrix.setIdentity();
	Matrix4f.rotate((float) Math.toRadians(pitch), new Vector3f(1, 0, 0), viewMatrix,
			viewMatrix);
	Matrix4f.rotate((float) Math.toRadians(yaw), new Vector3f(0, 1, 0), viewMatrix, viewMatrix);
	Vector3f negativeCameraPos = new Vector3f(-position.x,-position.y,-position.z);
	Matrix4f.translate(negativeCameraPos, viewMatrix, viewMatrix);
}
 
開發者ID:TheThinMatrix,項目名稱:OcclusionQueries,代碼行數:9,代碼來源:Camera.java

示例9: createViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static Matrix4f createViewMatrix(Camera camera) {
	Matrix4f viewMatrix = new Matrix4f();
	viewMatrix.setIdentity();
	Matrix4f.rotate((float) Math.toRadians(camera.getPitch()), new Vector3f(1, 0, 0), viewMatrix, viewMatrix);
	Matrix4f.rotate((float) Math.toRadians(camera.getYaw()), new Vector3f(0, 1, 0), viewMatrix, viewMatrix);
	Vector3f cameraPos = camera.getPosition();
	Vector3f negativeCameraPos = new Vector3f(-cameraPos.x, -cameraPos.y, -cameraPos.z);
	Matrix4f.translate(negativeCameraPos, viewMatrix, viewMatrix);
	return viewMatrix;
}
 
開發者ID:DevipriyaSarkar,項目名稱:Terrain,代碼行數:11,代碼來源:Maths.java

示例10: updateViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
private void updateViewMatrix() {
	viewMatrix.setIdentity();
	Matrix4f.rotate((float) Math.toRadians(pitch.get()), new Vector3f(1, 0, 0), viewMatrix, viewMatrix);
	Matrix4f.rotate((float) Math.toRadians(yaw), new Vector3f(0, 1, 0), viewMatrix, viewMatrix);
	Vector3f negativeCameraPos = new Vector3f(-position.x, -position.y, -position.z);
	Matrix4f.translate(negativeCameraPos, viewMatrix, viewMatrix);
}
 
開發者ID:TheThinMatrix,項目名稱:OpenGL-Animation,代碼行數:8,代碼來源:Camera.java

示例11: updateViewMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static void updateViewMatrix(Matrix4f viewMatrix, float x, float y, float z, float pitch, float yaw) {
    viewMatrix.setIdentity();
    Matrix4f.rotate((float) Math.toRadians(pitch), new Vector3f(1, 0, 0), viewMatrix, viewMatrix);
    Matrix4f.rotate((float) Math.toRadians(yaw), new Vector3f(0, 1, 0), viewMatrix, viewMatrix);
    Vector3f negativeCameraPos = new Vector3f(-x, -y, -z);
    Matrix4f.translate(negativeCameraPos, viewMatrix, viewMatrix);
}
 
開發者ID:GryPLOfficial,項目名稱:EcoSystem-Official,代碼行數:8,代碼來源:Maths.java

示例12: rotateX

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static Matrix4f rotateX(Matrix4f mat, float angle){
	return mat.rotate(angle, X_AXIS);
}
 
開發者ID:LapisSea,項目名稱:OpenGL-Bullet-engine,代碼行數:4,代碼來源:MatrixUtil.java

示例13: rotateY

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
public static Matrix4f rotateY(Matrix4f mat, float angle){
	return mat.rotate(angle, Y_AXIS);
}
 
開發者ID:LapisSea,項目名稱:OpenGL-Bullet-engine,代碼行數:4,代碼來源:MatrixUtil.java

示例14: rotatePart

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
private void rotatePart(Vector3f p_178407_1_, @Nullable BlockPartRotation partRotation)
{
    if (partRotation != null)
    {
        Matrix4f matrix4f = this.getMatrixIdentity();
        Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);

        switch (partRotation.axis)
        {
            case X:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(0.0F, 1.0F, 1.0F);
                break;
            case Y:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 0.0F, 1.0F);
                break;
            case Z:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 0.0F, 1.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 1.0F, 0.0F);
        }

        if (partRotation.rescale)
        {
            if (Math.abs(partRotation.angle) == 22.5F)
            {
                vector3f.scale(SCALE_ROTATION_22_5);
            }
            else
            {
                vector3f.scale(SCALE_ROTATION_GENERAL);
            }

            Vector3f.add(vector3f, new Vector3f(1.0F, 1.0F, 1.0F), vector3f);
        }
        else
        {
            vector3f.set(1.0F, 1.0F, 1.0F);
        }

        this.rotateScale(p_178407_1_, new Vector3f(partRotation.origin), matrix4f, vector3f);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:44,代碼來源:FaceBakery.java

示例15: func_178407_a

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
private void func_178407_a(Vector3f p_178407_1_, BlockPartRotation partRotation)
{
    if (partRotation != null)
    {
        Matrix4f matrix4f = this.getMatrixIdentity();
        Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);

        switch (partRotation.axis)
        {
            case X:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(0.0F, 1.0F, 1.0F);
                break;

            case Y:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 0.0F, 1.0F);
                break;

            case Z:
                Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 0.0F, 1.0F), matrix4f, matrix4f);
                vector3f.set(1.0F, 1.0F, 0.0F);
        }

        if (partRotation.rescale)
        {
            if (Math.abs(partRotation.angle) == 22.5F)
            {
                vector3f.scale(field_178418_a);
            }
            else
            {
                vector3f.scale(field_178417_b);
            }

            Vector3f.add(vector3f, new Vector3f(1.0F, 1.0F, 1.0F), vector3f);
        }
        else
        {
            vector3f.set(1.0F, 1.0F, 1.0F);
        }

        this.rotateScale(p_178407_1_, new Vector3f(partRotation.origin), matrix4f, vector3f);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:46,代碼來源:FaceBakery.java


注:本文中的org.lwjgl.util.vector.Matrix4f.rotate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。