You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #154 Mapbox-gl-js doesn’t have an orthographic camera option, indeed the FOV is hardcoded internally to Math.atan(3/4). Despite this FOV is not an init param of the map, is accessible through a private variable of map.transformation._fov, there’s a risk that Mapbox will convert this into a non-accessible member in the future. Three.js has a pure OrthographicCamera object, but if we use it then the depth calculations for the matrixes and raycast will be wrong as they are developed for PerspectiveCamera
So, the best option seems to change first Mapbox camera FOV to mimic the Orthographic camera view in the best way possible and then replicate this view with Three.js PerspectiveCamera that will keep the right transformation matrixes and depth calculations
The text was updated successfully, but these errors were encountered:
After many different tests and approaches, and considering Mapbox does not fully support an orthographic camera, we will add two different options:
To have a full orthographic view through an init param orthographic: true, this will create a THREE.OrthographicCamera and related calculated Matrixes. It will adjust the map.transform.fov to the minimum possible (can't be 0 due to Mapbox limitations). IMPORTANT NOTE This view will present issues with fill-extrusion layers as this .
To have any desired FOV perspective provided in degrees, from 0.2 to 1.0 values. It will keep the THREE.PerspectiveCamera and current view through another init param fov: _degrees_
Minor version by [@jscastro76](https://github.com/jscastro76), some enhancements and bugs.
#### ✨ Enhancements
- #111 Show the dimensions of a model
- #151 Remove auxiliary test method on `CameraSync` used to debug #145
- #156 Create an Orthographic view mode
- #159 Create an example for FOV and Orthographic.
- Added to [09-raycaster.html](https://github.com/jscastro76/threebox/blob/master/examples/09-raycaster.html) as it impacts in raycast and shows fill-extrusions and 3D models together
- #161 Remove obsolete code that is avoiding to be used from React
#### 🪲 Bug fixes
- #152 `obj.raycasted` is ignored when an object is hidden and again visible.
- #157 Bug draggging after removing an object.
- #160 Bug using `utils.equal`
#### 📝 Documentation
- #158 MERCATOR_A constant unused, added an code comment to explain why it was deprecated (nor removed)
- Updated [documentation](/docs/Threebox.md) (`tb.orthographic`, `tb.fov`)
- Updated [README.md](/).
- Updated [Examples](/examples) documentation.
Related to #154
Mapbox-gl-js doesn’t have an orthographic camera option, indeed the FOV is hardcoded internally to
Math.atan(3/4)
. Despite this FOV is not an init param of the map, is accessible through a private variable ofmap.transformation._fov
, there’s a risk that Mapbox will convert this into a non-accessible member in the future.Three.js has a pure
OrthographicCamera
object, but if we use it then the depth calculations for the matrixes and raycast will be wrong as they are developed forPerspectiveCamera
So, the best option seems to change first Mapbox camera FOV to mimic the Orthographic camera view in the best way possible and then replicate this view with Three.js
PerspectiveCamera
that will keep the right transformation matrixes and depth calculationsThe text was updated successfully, but these errors were encountered: