Place object right outside of the view


I want to place an cube/box always righthandside outside camera´s view/frustum… is there a proper way of doing so?


My approach would be to calculate width of camera view by distance, then set cube position to (camera position + half view width + half cube width):

var distance = new THREE.Vector3(0, 0, cube.geometry.parameters.depth/2).length();  // distance between camera and mesh back left edge
var verticalFOV = THREE.Math.degToRad( camera.fov );
var visibleHeight = 2 * Math.tan( verticalFOV / 2 ) * distance;
var visibleWidth = visibleHeight * camera.aspect;

var render = function () {
  requestAnimationFrame( render );

  cube.position.set(camera.position.x+(visibleWidth+cube.geometry.parameters.width)/2, camera.position.y, camera.position.z);

  renderer.render(scene, camera);