本文整理汇总了Java中org.joml.Matrix4f.m31方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix4f.m31方法的具体用法?Java Matrix4f.m31怎么用?Java Matrix4f.m31使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.joml.Matrix4f
的用法示例。
在下文中一共展示了Matrix4f.m31方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderSkyBox
import org.joml.Matrix4f; //导入方法依赖的package包/类
/**
*
* @param screen
* @param camera
* @param scene
*/
private void renderSkyBox(Screen screen, Camera camera, Scene scene) {
SkyBox skyBox = scene.getSkyBox();
if (skyBox != null) {
this.skyBoxShaderProgram.use();
this.skyBoxShaderProgram.setUniform(("texture_sampler"), 0);
Matrix4f projectionMatrix = screen.getProjectionMatrix();
this.skyBoxShaderProgram.setUniform(("projectionMatrix"), projectionMatrix);
Matrix4f viewMatrix = camera.getViewMatrix();
float m30 = viewMatrix.m30();
viewMatrix.m30(0);
float m31 = viewMatrix.m31();
viewMatrix.m31(0);
float m32 = viewMatrix.m32();
viewMatrix.m32(0);
Mesh mesh = skyBox.getMesh();
Matrix4f modelViewMatrix = this.transformation.buildModelViewMatrix(skyBox, viewMatrix);
this.skyBoxShaderProgram.setUniform(("modelViewMatrix"), modelViewMatrix);
this.skyBoxShaderProgram.setUniform(("ambientLight"), scene.getSceneLight().getAmbientLight());
this.skyBoxShaderProgram.setUniform(("color"), mesh.getMaterial().getAmbientColor());
this.skyBoxShaderProgram.setUniform(("hasTexture"), mesh.getMaterial().isTextured() ? 1 : 0);
mesh.render();
viewMatrix.m30(m30);
viewMatrix.m31(m31);
viewMatrix.m32(m32);
this.skyBoxShaderProgram.stopUse();
}
}
示例2: renderSkyBox
import org.joml.Matrix4f; //导入方法依赖的package包/类
private void renderSkyBox(Window window, Camera camera, Scene scene) {
SkyBox skyBox = scene.getSkyBox();
if (skyBox != null) {
skyBoxShaderProgram.bind();
skyBoxShaderProgram.setUniform("texture_sampler", 0);
Matrix4f projectionMatrix = window.getProjectionMatrix();
skyBoxShaderProgram.setUniform("projectionMatrix", projectionMatrix);
Matrix4f viewMatrix = camera.getViewMatrix();
float m30 = viewMatrix.m30();
viewMatrix.m30(0);
float m31 = viewMatrix.m31();
viewMatrix.m31(0);
float m32 = viewMatrix.m32();
viewMatrix.m32(0);
Mesh mesh = skyBox.getMesh();
Matrix4f modelViewMatrix = transformation.buildModelViewMatrix(skyBox, viewMatrix);
skyBoxShaderProgram.setUniform("modelViewMatrix", modelViewMatrix);
skyBoxShaderProgram.setUniform("ambientLight", scene.getSceneLight().getSkyBoxLight());
skyBoxShaderProgram.setUniform("colour", mesh.getMaterial().getColour());
skyBoxShaderProgram.setUniform("hasTexture", mesh.getMaterial().isTextured() ? 1 : 0);
mesh.render();
viewMatrix.m30(m30);
viewMatrix.m31(m31);
viewMatrix.m32(m32);
skyBoxShaderProgram.unbind();
}
}