How to show side view and back view of a object in three js?

I have a perspective view of an object i need to make side view and back view of that object.
how to calculate the position?

You can maybe use an approach often seen in model viewers. The idea is to compute the AABB of your model and use it to properly position your camera. I suggest you study how the following three.js based gltf-viewer implements this approach in the setContent() method.

The relevant code section of the camera transformation is:

You can use the same approach to position a camera on each side of the bounding box and then use lookAt() in order to orient the camera towards the model’s center point.

1 Like

hello, I need for kids also a possibilty to show objects front, sideview an topview… but how exactly can I use this code… where to paste into? thanks to help. this idea https://codepen.io/karelrosseel-prive/pen/JjYERpB