当前位置: 首页>>代码示例>>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;未经允许,请勿转载。