# How to make a CombinedCamera?

**URL:** <https://discourse.threejs.org/t/how-to-make-a-combinedcamera/10422>\
**Category:** Questions\
**Tags:** camera\
**Created:** [October 23, 2019, 1:04pm UTC](https://discourse.threejs.org/t/how-to-make-a-combinedcamera/10422 "2019-10-23T13:04:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToniFF](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/toniff/32/7604_2.png) [@ToniFF](https://discourse.threejs.org/u/ToniFF)\
**Post date:** [October 23, 2019, 1:04pm UTC](https://discourse.threejs.org/t/how-to-make-a-combinedcamera/10422/1 "2019-10-23T13:04:40Z")

</div>

I need to switch between `Perspective` and `Orthographic` frequently. The removed `CombinedCamera` seems nice. I copied the old code to TypeScript version, and change `inPerspectiveMode` to `isPerspectiveCamera` to make `Raycaster` and `OrbitControls` accept it.

After I replace my `PerpectiveCamera` to the `CombinedCamera`, I get the error “Unable to preventDefault inside passive event listener due to target being treated as passive.” from `OrbitControls` on mouse wheel.  
To get rid of the errors, I repelace `event.preventDefault();` to

> if (event.cancelable) {  
> if (!event.defaultPrevented) {  
> event.preventDefault();  
> }  
> }

The `OrbitControls` can work but `dat.gui` can’t be clicked on pull-down menus anymore. And the slider of Chrome moves when I rotate the scene by `OrbitControls`. The `Raycaster` can’t get proper result anymore.

The code of `CombinedCamera` is [here](https://paste.ubuntu.com/p/8JpWb6Yh22/).  
Look forward to any kind of help.😣

---

<div class="post-metadata">

**Author:** ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)\
**Post date:** [October 23, 2019, 1:35pm UTC](https://discourse.threejs.org/t/how-to-make-a-combinedcamera/10422/2 "2019-10-23T13:35:58Z")

</div>

> [@ToniFF](#):
>
> The `OrbitControls` can work but `dat.gui` can’t be clicked on pull-down menus anymore

What are you passing as the second argument to the controls? Try:

```javascript
const controls = new OrbitControls( camera, renderer.domElement );

```

---

<div class="post-metadata">

**Author:** ![ToniFF](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/toniff/32/7604_2.png) [@ToniFF](https://discourse.threejs.org/u/ToniFF)\
**Post date:** [October 24, 2019, 1:59am UTC](https://discourse.threejs.org/t/how-to-make-a-combinedcamera/10422/3 "2019-10-24T01:59:07Z")

</div>

I did pass `renderer.domElement`.🤔
