public void updateWithDelta(long dt) { final float secsPerMove = 2.0f * ONE_SEC; float movement = (float)(Math.sin(System.currentTimeMillis() * 2 * Math.PI / secsPerMove)); // move camera Matrix4f camera = new Matrix4f(); camera.translate(0.0f, -1.0f * movement, -15.0f); camera.rotate(360.0f * movement, 0.0f, 0.0f, 1.0f); camera.scale(movement, movement, movement); square.setCamera(camera); square.draw(dt); }
@Override public void onSurfaceChanged(GL10 gl10, int w, int h) { GLES20.glViewport(0, 0, w, h); Matrix4f perspective = new Matrix4f(); perspective.loadPerspective(85.0f, (float)w / (float)h, 1.0f, -150.0f); if(cube != null) { cube.setProjection(perspective); } }
@Override public void onSurfaceChanged(GL10 gl10, int w, int h) { GLES20.glViewport(0, 0, w, h); if(square != null) { Matrix4f perspective = new Matrix4f(); perspective.loadPerspective(85.0f, (float)w / (float)h, 1.0f, -150.0f); square.setProjection(perspective); } }
@Override public void onSurfaceChanged(GL10 gl10, int w, int h) { GLES20.glViewport(0, 0, w, h); Matrix4f perspective = new Matrix4f(); perspective.loadPerspective(85.0f, (float)w / (float)h, 1.0f, -150.0f); if(cube != null) { cube.setProjection(perspective); } }
@Override public void onSurfaceChanged(GL10 gl10, int w, int h) { GLES20.glViewport(0, 0, w, h); Matrix4f perspective = new Matrix4f(); perspective.loadPerspective(85.0f, (float)w / (float)h, 1.0f, -150.0f); if(cube != null) { cube.setProjection(perspective); } }
@Override public void onSurfaceChanged(GL10 gl10, int w, int h) { GLES20.glViewport(0, 0, w, h); Matrix4f perspective = new Matrix4f(); perspective.loadPerspective(85.0f, (float)w / (float)h, 1.0f, -150.0f); if(cube != null) { cube.setProjection(perspective); } }
public void updateWithDelta(long dt) { Matrix4f camera = new Matrix4f(); camera.translate(0.0f, 0.0f, -5.0f); zombie.setCamera(camera); frame.setCamera(camera); zombie.draw(dt); final float secsPerMove = 2.0f * ONE_SEC; float movement = (float) (Math.sin(System.currentTimeMillis() * 2 * Math.PI / secsPerMove)); frame.setPosition(new Float3(movement, frame.position.y, frame.position.z)); frame.draw(dt); }
@Override public void onSurfaceChanged(GL10 gl10, int w, int h) { GLES20.glViewport(0, 0, w, h); Matrix4f perspective = new Matrix4f(); perspective.loadPerspective(85.0f, (float)w / (float)h, 1.0f, -150.0f); if(zombie != null) { zombie.setProjection(perspective); } if(frame != null) { frame.setProjection(perspective); } }
public void updateWithDelta(long dt) { Matrix4f camera2 = new Matrix4f(); camera2.translate(0.0f, 0.0f, -5.0f); cube.setCamera(camera2); cube.setRotationY((float)( cube.rotationY + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.setRotationZ((float)( cube.rotationZ + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.draw(dt); }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public void updateWithDelta(long dt) { Matrix4f camera2 = new Matrix4f(); camera2.translate(0.0f, 0.0f, -5.0f); cube.setCamera(camera2); cube.setRotationY((float)( cube.rotationY + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.setRotationZ((float)( cube.rotationZ + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.draw(dt); }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public void updateWithDelta(long dt) { Matrix4f camera2 = new Matrix4f(); camera2.translate(0.0f, 0.0f, -5.0f); cube.setCamera(camera2); cube.setRotationY((float)( cube.rotationY + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.setRotationZ((float)( cube.rotationZ + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.draw(dt); }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public Matrix4f modelMatrix() { Matrix4f mat = new Matrix4f(); // make a new identitiy 4x4 matrix mat.translate(position.x, position.y, position.z); mat.rotate(rotationX, 1.0f, 0.0f, 0.0f); mat.rotate(rotationY, 0.0f, 1.0f, 0.0f); mat.rotate(rotationZ, 0.0f, 0.0f, 1.0f); mat.scale(scale, scale, scale); return mat; }
public void updateWithDelta(long dt) { Matrix4f camera2 = new Matrix4f(); camera2.translate(0.0f, 0.0f, -5.0f); cube.setCamera(camera2); cube.setRotationY((float)( cube.rotationY + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.setRotationZ((float)( cube.rotationZ + Math.PI * dt / (ONE_SEC * 0.1f) )); cube.draw(dt); }