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


Java Matrix4f.scale方法代碼示例

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


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

示例4: calculateMvpMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
private Matrix4f calculateMvpMatrix(Sun sun, ICamera camera) {
	Matrix4f modelMatrix = new Matrix4f();
	Vector3f sunPos = sun.getWorldPosition(camera.getPosition());
	Matrix4f.translate(sunPos, modelMatrix, modelMatrix);
	Matrix4f modelViewMat = applyViewMatrix(modelMatrix, camera.getViewMatrix());
	Matrix4f.scale(new Vector3f(sun.getScale(), sun.getScale(), sun.getScale()), modelViewMat, modelViewMat);
	return Matrix4f.mul(camera.getProjectionMatrix(), modelViewMat, null);
}
 
開發者ID:TheThinMatrix,項目名稱:OcclusionQueries,代碼行數:9,代碼來源:SunRenderer.java

示例5: createModelMatrix

import org.lwjgl.util.vector.Matrix4f; //導入方法依賴的package包/類
private Matrix4f createModelMatrix(float x, float y, float z, float scale) {
	Matrix4f modelMatrix = new Matrix4f();
	Matrix4f.translate(new Vector3f(x, y, z), modelMatrix, modelMatrix);
	Matrix4f.scale(new Vector3f(scale, scale, scale), modelMatrix, modelMatrix);
	return modelMatrix;
}
 
開發者ID:TheThinMatrix,項目名稱:OcclusionQueries,代碼行數:7,代碼來源:WaterRenderer.java


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