# Incorrect Positioning of camera

**URL:** <https://discourse.threejs.org/t/incorrect-positioning-of-camera/12378>\
**Category:** Questions\
**Tags:** camera\
**Created:** [January 28, 2020, 11:31am UTC](https://discourse.threejs.org/t/incorrect-positioning-of-camera/12378 "2020-01-28T11:31:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThreejsNewbie](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/threejsnewbie/32/7975_2.png) [@ThreejsNewbie](https://discourse.threejs.org/u/ThreejsNewbie)\
**Post date:** [January 28, 2020, 11:31am UTC](https://discourse.threejs.org/t/incorrect-positioning-of-camera/12378/1 "2020-01-28T11:31:16Z")

</div>

Hi,

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/e/e0884ad158fe77f1108e580d4feeca6c9602219b.jpeg)  
Due to camera settings the object is not at the center of the screen

is there anyway to make the model appear like the below image

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/7/7409d1637a7191042fdc9895f7563525c4fffc3d.jpeg)

please find the below code

```auto
	camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 3500 );
	camera.position.z = -1000;
	camera.position.y = 0;
	camera.position.x = - 1000;// added to get a better control on screen
//	camera.lookAt( new THREE.Vector3( 0, 0, 0 ) );

	renderer = new THREE.WebGLRenderer( { antialias: true } );
	renderer.setClearColor( "#e5e5e5" ); //setting a grey color on the screen
	renderer.setPixelRatio( window.devicePixelRatio );
	renderer.setSize( window.innerWidth, window.innerHeight ); //adjusting the black screen on the browser
	
	document.body.appendChild( renderer.domElement );

```

Thanks

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [January 28, 2020, 3:11pm UTC](https://discourse.threejs.org/t/incorrect-positioning-of-camera/12378/2 "2020-01-28T15:11:03Z")

</div>

Similar question were asked multiple times and we often refer to the code of the open source [gltf-viewer](https://gltf-viewer.donmccurdy.com/). I suggest you study how the method `setContent()` is implemented. You can use the following code section to do two things:

- Center an object based on its bounding box
- Use the bounding box to derive optimal camera parameters

Especially the latter one could solve your issue.

> <https://github.com/donmccurdy/three-gltf-viewer/blob/5fa407408de685fa29520d97902c9b5d82f0c4a3/src/viewer.js#L254-L281>
