Skip to content

Commit

Permalink
v.2.0.5.
Browse files Browse the repository at this point in the history
Enhacements: #28, #30, #31, #33, #34, #36, #37
Bugs: #32, #35
  • Loading branch information
jscastro76 committed Aug 14, 2020
1 parent 09eea6c commit 257a0ba
Show file tree
Hide file tree
Showing 30 changed files with 4,919 additions and 437 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## 2.0.5

Minor version by [@jscastro76](https://github.com/jscastro76), some enhancements and bugs.

#### :sparkles: Enhancements

- [**#28**](https://github.com/jscastro76/threebox/issues/28) Create a realistic illumination at any given lnglat, date and time
- Added [SunCalc](https://github.com/mourner/suncalc) for sun position calculations
- Threebox can receive now a new param `realSunlight : true` at instantiation
- Threebox new method `tb.realSunlight` that sets the lights for the scene with default map center position and current datetime.
- Threebox new method `tb.getSunPosition(date, lng, lat)` that allows to get sun altitude and azimuth from [SunCalc](https://github.com/mourner/suncalc)
- Threebox new method `tb.setBuildingShadows(options)` that instantiates a new `BuildingShadows` class.
- Threebox new method `tb.setSunlight (newDate = new Date(), coords)` that calculates real Sun light position at a given datetime and lnglat calling `tb.getSunPosition(date, lng, lat)`.
- Added `this.lights` to enable access to lights configured for the scene through `defaultLights` or `realSunLight`.
- Light Helpers (if any) are now updated on `tb.update` calling `this.updateLightHelper()`, useful to see the sun direction on animations.
- [**#30**](https://github.com/jscastro76/threebox/issues/30) Shadow examples
- Added new example to demonstrate how to change style [Change map style for Eiffel Tower](https://github.com/jscastro76/threebox/blob/master/examples/stylechange.html).
- Added new example boosting @andrewharvey original sample but with real sunlight and built-in shadows [Add a 3D model](https://github.com/jscastro76/threebox/blob/master/examples/add-3d-model.html).
- Added new example to show default fill extrusion buildings shadow [Building Sun light and shadows](https://github.com/jscastro76/threebox/blob/master/examples/buildingshadow.html).
- Improved Eiffel example with real sun light slider and shadows on 3D models and Buildings extrusions [Statue of Liberty and Eiffel Tower with Shadows](https://github.com/jscastro76/threebox/blob/master/examples/eiffel.html)
- `tb.Constants` are now accessible through instance (usefull for HTML/js side calculations)
- [**#31**](https://github.com/jscastro76/threebox/issues/31) Create/Remove the shadow plane automatically on `obj.castShadow`
- [**#33**](https://github.com/jscastro76/threebox/issues/33) Refactored methods `òbj.add` and `obj.remove` to enable add an object to them (honestly this never worked as it was referring to root which is the function.)
- [**#34**](https://github.com/jscastro76/threebox/issues/34) Added shadows for fill extrusion layers
- Synced with Custom Layers `tb.setSunLight` through `tb.setBuildingShadows(options)`
- Added new example on fill-extrusion shadows.
- [**#36**](https://github.com/jscastro76/threebox/issues/36) Clean up after use. Implemented a new method `tb.clear(dispose)` that removes all the children from `tb.children`
- [**#37**](https://github.com/jscastro76/threebox/issues/37) Anchor options. Implement the option `'auto'` that won't do anything to position the anchor, so the 3D Object will use it's default anchor defined in the model itself.

#### :beetle: Bug fixes
- [**#32**](https://github.com/jscastro76/threebox/issues/32) Hide PlaneGeometry used for shadow from raycaster.
- [**#35**](https://github.com/jscastro76/threebox/issues/35) Refresh of map after map style change creating a new `tb.setStyle` that replicates `map.setStyle` and calls a new method `tb.clear`

<br>

- - -

## 2.0.4

Minor version by [@jscastro76](https://github.com/jscastro76), some enhancements and bugs.
Expand Down
28 changes: 27 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ v.0.3.0
MIT License
Copyright (c) 2017 Peter Liu

v.2.0.1 - v.2.0.4
v.2.0.1 - v.2.0.5
MIT License
Copyright (c) 2020 Jesus Serrano

Expand All @@ -23,3 +23,29 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---------------------------------------------------------------------------------------------
SunCalc (c) 2011-2015, Vladimir Agafonkin
Copyright (c) 2014, Vladimir Agafonkin
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A **[*Three.js*](https://threejs.org/)** plugin for **[*Mapbox GL JS*](https://d
- - -
## Current release

Current release is [**2.0.4**](https://github.com/jscastro76/threebox/releases/tag/v.2.0.4), please review the [**Change log**](https://github.com/jscastro76/threebox/blob/master/CHANGELOG.md#204) for more details.
Current release is [**2.0.5**](https://github.com/jscastro76/threebox/releases/tag/v.2.0.5), please review the [**Change log**](https://github.com/jscastro76/threebox/blob/master/CHANGELOG.md#205) for more details.

<br>

Expand All @@ -25,28 +25,34 @@ Current release is [**2.0.4**](https://github.com/jscastro76/threebox/releases/t
|----------|-------
|<img alt="threebox" src="./docs/LabelsOnHeight.gif" width="100%">|<img alt="threebox" src="./docs/Depth.gif" width="100%">

|Models built-in shadows|Sunlight illumination for a given datetime and lnglat
|----------|-------
|<img alt="threebox" src="./docs/MapboxShadow.gif" width="100%">|<img alt="threebox" src="./docs/EiffelShadow.gif" width="100%">

<br>

Only in this fork, there is a list of new features implemented on top of the amazing work from [@peterqliu](https://github.com/peterqliu/threebox/):
- Update to Three.js v117.
- Update to Mapbox v1.11.1.
- All the [examples](https://github.com/jscastro76/threebox/tree/master/examples) updated, and 4 more examples added with new features.
- All the [examples](https://github.com/jscastro76/threebox/tree/master/examples) updated, and 6 more examples added with new features.
- Support for multiple format objects (FBX, GLTF/GLB, Collada + OBJ/MTL).
- Support for CSS2D Labels supporting rich HTML controls through a new LabelManager.
- Support for CSS2D tooltips/title browser-like and mapbox-like.
- Support for Objects3D auto-centering, bounding box and floor projection.
- Support for built-in shadows and real Sun light positioning for a given datetime and lnglat coords.
- Support for built-in Raycaster in loaded Objects3D and fill-extrusions together.
- Support for built-in MouseOver/Mouseout, Selected, Drag&Drop, Drag&Rotate, Wireframe in loadedObjects including events.
- Support for GeoJson standard features format import and export in different layers.
- Support for Objects3D embedded animations, and combined animations on AnimationManager (i.e. translate + embedded).
- Support for multi-floor design of spaces.
- Support for style change keeping 3D models.
- Support for Non-AABB Non Axes Aligned Bounding Box and real model size.
- Support for wireframing on Objects3D, removing them from the raycast.
- Support for setLayerZoomRange and setLayoutProperty on Custom Layers (not available in Mapbox).
- Support for full dispose of Mapbox, Three and Threebox resources.
- Support for partial and full dispose of Mapbox, Three and Threebox resources.
- Optimization of Camera perspective to have Raycast with pixel-precision level.
- Adjusted positioning for Objects3D to set center and rotation axes by config.
- Check out [v2.04 change log](https://github.com/jscastro76/threebox/blob/master/CHANGELOG.md#204) for more detail.
- Check out [v2.04 change log](https://github.com/jscastro76/threebox/blob/master/CHANGELOG.md#205) for more detail.

<br>

Expand Down
17 changes: 16 additions & 1 deletion ThreeboxSolution.njsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<StartWebBrowser>True</StartWebBrowser>
<LaunchUrl>/examples/mercator.html</LaunchUrl>
<LaunchUrl>/examples/eiffel.html</LaunchUrl>
<SaveNodeJsSettingsInProjectFile>True</SaveNodeJsSettingsInProjectFile>
<NodejsPort>8080</NodejsPort>
</PropertyGroup>
Expand All @@ -25,11 +25,15 @@
<Content Include=".npmrc" />
<Content Include="docs\AnimationVideo.gif" />
<Content Include="docs\Depth.gif" />
<Content Include="docs\EiffelShadow.gif" />
<Content Include="docs\LabelsOnHeight.gif" />
<Content Include="docs\MapboxShadow.gif" />
<Content Include="docs\soldieranimation.jpg" />
<Content Include="docs\Wireframes.gif" />
<Content Include="examples\3Dbuildings.html" />
<Content Include="examples\add-3d-model.html" />
<Content Include="examples\animation.html" />
<Content Include="examples\buildingshadow.html" />
<Content Include="examples\css\fontawesome.js" />
<Content Include="examples\css\free-fa-solid-900.woff2" />
<Content Include="examples\css\free-v4-font-face-min.css" />
Expand All @@ -48,13 +52,22 @@
<Content Include="examples\models\Liberty-PortaBronzo-1.bmp" />
<Content Include="examples\models\LibertyStatue.mtl" />
<Content Include="examples\models\LibertyStatue.obj" />
<Content Include="examples\models\radar\34M_17.bin" />
<Content Include="examples\models\radar\34M_17.gltf" />
<Content Include="examples\models\radar\base_AO.png" />
<Content Include="examples\models\radar\frame_AO.png" />
<Content Include="examples\models\radar\stairs_plt_AO.png" />
<Content Include="examples\models\radar\truss_2_AO.png" />
<Content Include="examples\models\radar\truss_dish_AO.jpg" />
<Content Include="examples\models\radar\wheels_AO.png" />
<Content Include="examples\models\Soldier.glb" />
<Content Include="examples\models\Truck.mtl" />
<Content Include="examples\models\Truck.obj" />
<Content Include="examples\alignmentTest.html">
<SubType>Code</SubType>
</Content>
<Content Include="examples\plugins\jquery.min.js" />
<Content Include="examples\StyleChange.html" />
<Content Include="LICENSE.txt" />
<Content Include="package-lock.json" />
<Content Include="package.json" />
Expand All @@ -80,6 +93,7 @@
<Content Include="src\objects\tooltip.js" />
<Content Include="src\three.js" />
<Content Include="src\Threebox.js" />
<Content Include="src\utils\suncalc.js" />
<Content Include="tests\threebox-tests.html" />
<Content Include="tests\threebox-tests-bundle.js" />
<Content Include="tests\threebox-tests.js" />
Expand Down Expand Up @@ -129,6 +143,7 @@
<Folder Include="examples\geojson\" />
<Folder Include="examples\images\" />
<Folder Include="examples\models" />
<Folder Include="examples\models\radar\" />
<Folder Include="examples\old" />
<Folder Include="examples\plugins\" />
<Folder Include="src" />
Expand Down
Loading

0 comments on commit 257a0ba

Please sign in to comment.