use of com.enderio.core.common.vecmath.Matrix4d in project EnderIO by SleepyTrousers.
the class BlockSceneRenderer method applyCamera.
private void applyCamera() {
Rectangle vp = camera.getViewport();
GL11.glViewport(vp.x, vp.y, vp.width, vp.height);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
GL11.glMatrixMode(GL11.GL_PROJECTION);
final Matrix4d camaraViewMatrix = camera.getTransposeProjectionMatrix();
if (camaraViewMatrix != null) {
RenderUtil.loadMatrix(camaraViewMatrix);
}
GL11.glMatrixMode(GL11.GL_MODELVIEW);
final Matrix4d cameraViewMatrix = camera.getTransposeViewMatrix();
if (cameraViewMatrix != null) {
RenderUtil.loadMatrix(cameraViewMatrix);
}
GL11.glTranslatef(-(float) eye.x, -(float) eye.y, -(float) eye.z);
}
use of com.enderio.core.common.vecmath.Matrix4d in project EnderIO by SleepyTrousers.
the class TravelController method onRender.
@SubscribeEvent
public void onRender(@Nonnull RenderWorldLastEvent event) {
Minecraft mc = Minecraft.getMinecraft();
Vector3d eye = Util.getEyePositionEio(mc.player);
Vector3d lookAt = Util.getLookVecEio(mc.player);
lookAt.add(eye);
Matrix4d mv = VecmathUtil.createMatrixAsLookAt(eye, lookAt, new Vector3d(0, 1, 0));
float fov = Minecraft.getMinecraft().gameSettings.fovSetting;
Matrix4d pr = VecmathUtil.createProjectionMatrixAsPerspective(fov, 0.05f, mc.gameSettings.renderDistanceChunks * 16, mc.displayWidth, mc.displayHeight);
currentView.setProjectionMatrix(pr);
currentView.setViewMatrix(mv);
currentView.setViewport(0, 0, mc.displayWidth, mc.displayHeight);
fovRad = Math.toRadians(fov);
tanFovRad = Math.tanh(fovRad);
}
use of com.enderio.core.common.vecmath.Matrix4d in project EnderIO by SleepyTrousers.
the class IoConfigRenderer method applyCamera.
private void applyCamera(float partialTick) {
Rectangle vp = camera.getViewport();
GL11.glViewport(vp.x, vp.y, vp.width, vp.height);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
GL11.glMatrixMode(GL11.GL_PROJECTION);
final Matrix4d camaraViewMatrix = camera.getTransposeProjectionMatrix();
if (camaraViewMatrix != null) {
RenderUtil.loadMatrix(camaraViewMatrix);
}
GL11.glMatrixMode(GL11.GL_MODELVIEW);
final Matrix4d cameraViewMatrix = camera.getTransposeViewMatrix();
if (cameraViewMatrix != null) {
RenderUtil.loadMatrix(cameraViewMatrix);
}
GL11.glTranslatef(-(float) eye.x, -(float) eye.y, -(float) eye.z);
}
Aggregations