Skip to content

Commit

Permalink
- #193 Build with tinyify
Browse files Browse the repository at this point in the history
- #194 Make the build way lighter (3D models to lowpoly, images, gifs)
- #195 rename .json to .geosjon
- #196 Add in code and license.txt all the licenses and attributions for the 3D models
  • Loading branch information
jscastro76 committed Feb 3, 2021
1 parent af6ef71 commit 3da1f79
Show file tree
Hide file tree
Showing 54 changed files with 1,099 additions and 111,974 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

#### :sparkles: Enhancements
- #193 Build with tinyify
- #194 Make the build way lighter (3D models to lowpoly, images, gifs)
- #195 rename .json to .geosjon
- #196 Add in code and license.txt all the licenses and attributions for the 3D models

#### :beetle: Bug fixes
- #192 `getFeatureCenter` could change the altitude

Expand Down
42 changes: 42 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,45 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABI
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.

---------------------------------------------------------------------------------------------
3D models attributions

- Eiffel Tower
- Creative Commons License attribution: Eiffel Tower model by https://www.cgtrader.com/lefabshop
from https://www.cgtrader.com/items/108594/download-page

- Elephant
- Creative Commons NonCommercial License attribution: Asian Elephant low poly model by https://sketchfab.com/jeremielouvetz
from https://sketchfab.com/3d-models/asian-elephant-2aeeb8958bc64240962b093705abffdf

- Liberty Statue
- Creative Commons License attribution: Liberty statue model by https://sketchfab.com/hellolucy2
from https://sketchfab.com/3d-models/ellis-island-3cd765a23c5c4c7087acd00624d30590

- Plane
- Creative Commons License attribution: Plane model by https://sketchfab.com/ideehochzwei
from https://sketchfab.com/3d-models/plane-aa001f5a88f64b16b98356c042f2d5f3

- Radar
- Attribution, no License specified: Model by https://github.com/nasa/
from https://nasa3d.arc.nasa.gov/detail/jpl-vtad-dsn34

- Soldier
- Attribution: Soldier animated model by T. Choonyung at https://www.mixamo.com
from https://www.mixamo.com/#/?page=1&query=vanguard&type=Character

- Space Needle
- Creative Commons License attribution: Space Needle model by https://sketchfab.com/microsoft
from https://sketchfab.com/3d-models/space-needle-1d1325bc1ad745dd9eb34fc76e8f6e87

- Triceratops
- Creative Commons NonCommercial License attribution: Dino low poly model by https://sketchfab.com/Blender_Fox1234
from https://sketchfab.com/3d-models/triceratops-lowpoly-76beb95d0b5b41a3aae0d07c3eae99fa

- Truck & Car
- Royalty Free License: Vehicles by https://www.cgtrader.com/antonmoek
from https://www.cgtrader.com/free-3d-models/car/concept/cartoon-low-poly-city-cars-pack

- Windmill
- Creative Commons License attribution: Windmill animated model by https://sketchfab.com/data3anshow
from https://sketchfab.com/3d-models/windmill-animated-6ce5667e8d5c47068ea13196036efd52
37 changes: 12 additions & 25 deletions ThreeboxSolution.njsproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
<Content Include="examples\16-multilayer.html" />
<Content Include="examples\17-azuremaps.html" />
<Content Include="examples\20-game.html" />
<Content Include="examples\geojson\extrusion.json" />
<Content Include="examples\geojson\indoor-3d-map.json" />
<Content Include="examples\geojson\extrusion.geojson" />
<Content Include="examples\geojson\indoor-3d-map.geojson" />
<Content Include="examples\images\3dbuildings.jpg" />
<Content Include="examples\images\add-3d-model.jpg" />
<Content Include="examples\images\alignmentTest.jpg" />
Expand All @@ -111,29 +111,24 @@
<Content Include="examples\images\raycaster.jpg" />
<Content Include="examples\images\stylechange.jpg" />
<Content Include="examples\images\tube.jpg" />
<Content Include="examples\models\history\dinosaur.fbx" />
<Content Include="examples\models\history\dinosaur.glb" />
<Content Include="examples\models\history\rex.fbx" />
<Content Include="examples\models\history\rex.glb" />
<Content Include="examples\models\history\elephant.glb" />
<Content Include="examples\models\history\triceratops.fbx" />
<Content Include="examples\models\landmarks\eiffel.glb" />
<Content Include="examples\models\landmarks\libertystatue.glb" />
<Content Include="examples\models\landmarks\spaceneedle.glb" />
<Content Include="examples\models\plane\plane.glb" />
<Content Include="examples\models\radar\34M_17.glb" />
<Content Include="examples\models\vehicles\car.glb" />
<Content Include="examples\models\vehicles\truck.glb" />
<Content Include="examples\models\windmill_a\textures\material_baseColor.png" />
<Content Include="examples\models\windmill_a\windmill_a.bin" />
<Content Include="examples\models\windmill_a\windmill_a.json" />
<Content Include="examples\models\windmill_a\windmill_a.gltf" />
<Content Include="examples\15-performance.html" />
<Content Include="examples\14-buildingshadow.html" />
<Content Include="examples\07-alignmentTest.html" />
<Content Include="examples\08-3dbuildings.html" />
<Content Include="examples\12-add3dmodel.html" />
<Content Include="examples\css\threebox.css" />
<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\10-stylechange.html" />
<Content Include="examples\13-eiffel.html" />
<Content Include="examples\01-basic.html" />
Expand All @@ -142,23 +137,14 @@
<Content Include="examples\css\free-v4-font-face-min.css" />
<Content Include="examples\css\free-v4-shims.min.css" />
<Content Include="examples\css\free.min.css" />
<Content Include="examples\geojson\statue-of-liberty.json" />
<Content Include="examples\geojson\statue-of-liberty.geojson" />
<Content Include="examples\images\eiffel-tower.png" />
<Content Include="examples\images\statue-of-liberty.png" />
<Content Include="examples\02-line.html" />
<Content Include="examples\11-animation.html" />
<Content Include="examples\05-logistics.html" />
<Content Include="examples\04-mercator.html" />
<Content Include="examples\models\Eiffel.glb" />
<Content Include="examples\models\Liberty-DecorazioniMarmo-2.bmp" />
<Content Include="examples\models\Liberty-GreenBronze-1.bmp" />
<Content Include="examples\models\Liberty-MattoniBasamento-1.bmp" />
<Content Include="examples\models\Liberty-Pavimentazione-1.bmp" />
<Content Include="examples\models\Liberty-PortaBronzo-1.bmp" />
<Content Include="examples\models\LibertyStatue.mtl" />
<Content Include="examples\models\LibertyStatue.obj" />
<Content Include="examples\models\Soldier.glb" />
<Content Include="examples\models\statueofliberty.glb" />
<Content Include="examples\models\Truck.mtl" />
<Content Include="examples\models\Truck.obj" />
<Content Include="examples\06-object3d.html" />
Expand Down Expand Up @@ -204,6 +190,7 @@
<Folder Include="examples\geojson\" />
<Folder Include="examples\models\landmarks\" />
<Folder Include="examples\models\history\" />
<Folder Include="examples\models\vehicles\" />
<Folder Include="examples\models\plane\" />
<Folder Include="examples\models\radar\" />
<Folder Include="examples\models\windmill_a\" />
Expand Down
86 changes: 1 addition & 85 deletions dist/threebox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/01-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<title>Sphere Example</title>
<script src="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.css" rel="stylesheet" />
<script src="../dist/threebox.js" type="text/javascript"></script>
<script src="../dist/threebox.min.js" type="text/javascript"></script>
<link href="../dist/threebox.css" rel="stylesheet" type="text/css" />
<script src="config.js"></script>
<style>
Expand Down
2 changes: 1 addition & 1 deletion examples/02-line.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<head>
<title>Line Example</title>
<script src="../dist/threebox.js" type="text/javascript"></script>
<script src="../dist/threebox.min.js" type="text/javascript"></script>
<link href="../dist/threebox.css" rel="stylesheet" />
<script src="config.js"></script>
<script src="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js"></script>
Expand Down
12 changes: 6 additions & 6 deletions examples/05-logistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@
}
);

// import truck from an external obj file, scaling up its size 10x
// Royalty Free License: Vehicles by https://www.cgtrader.com/antonmoek
// from https://www.cgtrader.com/free-3d-models/car/concept/cartoon-low-poly-city-cars-pack
var options = {
type: 'mtl',
obj: 'models/Truck.obj',
mtl: 'models/Truck.mtl',
scale: 20,
type: 'gltf',
obj: 'models/vehicles/truck.glb',
scale: 40,
units: 'meters',
anchor: "bottom",
rotation: { x: 90, y: 180, z: 0 }, //rotation to postiion the truck and heading properly
rotation: { x: 90, y: 90, z: 0 }, //rotation to postiion the truck and heading properly

}

Expand Down
3 changes: 3 additions & 0 deletions examples/06-object3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
// import soldier from an external glb file, scaling up its size 20x
// IMPORTANT: .glb is not a standard MIME TYPE, you'll have to add it to your web server config,
// otherwise you'll receive a 404 error

// Attribution: Soldier animated model by T. Choonyung at https://www.mixamo.com
// from https://www.mixamo.com/#/?page=1&query=vanguard&type=Character
var options = {
obj: './models/soldier.glb',
type: 'gltf',
Expand Down
39 changes: 21 additions & 18 deletions examples/07-alignmentTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

mapboxgl.accessToken = config.accessToken;

let origin = [-87.61694, 41.86625];
let originRex = [-87.616191, 41.866212];
let origin = [-87.616938, 41.866222];
let originRex = [-87.616194, 41.866194];
let origin1 = [-87.61726, 41.865559];

let map = new mapboxgl.Map({
Expand Down Expand Up @@ -76,7 +76,7 @@
map,
map.getCanvas().getContext('webgl'),
{
defaultLights: true
realSunlight: true
}
);

Expand All @@ -90,7 +90,7 @@
// GeoJSON Data source used in vector tiles, documented at
// https://gist.github.com/ryanbaumann/a7d970386ce59d11c16278b90dde094d
'type': 'geojson',
'data': './geojson/indoor-3d-map.json'
'data': './geojson/indoor-3d-map.geojson'
});

map.addLayer({
Expand Down Expand Up @@ -134,30 +134,33 @@
tube.setCoords(origin1);
tb.add(tube);

let dino = {
type: 'fbx', //'gltf'/'mtl'
obj: './models/history/dinosaur.fbx', //model url
bin: '', //replace by mtl attribute

// Creative Commons NonCommercial License attribution: Asian Elephant low poly model by https://sketchfab.com/jeremielouvetz
// https://sketchfab.com/3d-models/asian-elephant-2aeeb8958bc64240962b093705abffdf
let elephant = {
type: 'glb',
obj: './models/history/elephant.glb', //model url
units: 'meters', //units in the default values are always in meters
scale: 60,
rotation: { x: 90, y: 0, z: 0 }, //default rotation
scale: 20,
rotation: { x: 90, y: 180, z: 0 }, //default rotation
anchor: 'center'
}
tb.loadObj(dino, function (model) {
tb.loadObj(elephant, function (model) {
model.setCoords([origin[0], origin[1], 0]);
tb.add(model);
});

let rex = {
type: 'fbx', //'gltf'/'mtl'
obj: './models/history/rex.fbx', //model url
bin: '', //replace by mtl attribute
// Creative Commons NonCommercial License attribution: Dino low poly model by https://sketchfab.com/Blender_Fox1234
// https://sketchfab.com/3d-models/triceratops-lowpoly-76beb95d0b5b41a3aae0d07c3eae99fa
let dino = {
type: 'fbx',
obj: './models/history/triceratops.fbx', //model url
units: 'meters', //units in the default values are always in meters
scale: 50,
rotation: { x: 90, y: 0, z: 0 }, //default rotation
scale: 0.15,
rotation: { x: 90, y: 90, z: 0 }, //default rotation
anchor: 'center'
}
tb.loadObj(rex, function (model) {
tb.loadObj(dino, function (model) {
model.setCoords(originRex);
tb.add(model);
});
Expand Down
3 changes: 3 additions & 0 deletions examples/09-raycaster.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
// import soldier from an external glb file, scaling up its size 20x
// IMPORTANT: .glb is not a standard MIME TYPE, you'll have to add it to your web server config,
// otherwise you'll receive a 404 error

// Attribution: Soldier animated model by T. Choonyung at https://www.mixamo.com
// from https://www.mixamo.com/#/?page=1&query=vanguard&type=Character
var options = {
obj: './models/soldier.glb',
type: 'gltf',
Expand Down
12 changes: 6 additions & 6 deletions examples/10-stylechange.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
mapboxgl.accessToken = config.accessToken;

let mapConfig = {
NYC: { origin: [-74.044514, 40.689259, 47], center: [-74.044803, 40.690183, 0], zoom: 17.7, pitch: 60, bearing: -10, scale: 44, timezone: 'America/New_York' },
PAR: { origin: [2.294514, 48.857475, 0], center: [2.294625, 48.861085, 0], zoom: 15.95, pitch: 60, bearing: 0, scale: 0.01029, timezone: 'Europe/Paris' },
names: {
PAR: { origin: [2.294514, 48.857475, 0], center: [2.294625, 48.861085, 0], zoom: 15.95, pitch: 60, bearing: 0, scale: { x: 5621.06, y: 6480.4, z: 5621.06 }, timezone: 'Europe/Paris' },
names: {
customLayer: "custom-layer"
}
}
Expand Down Expand Up @@ -105,13 +104,14 @@
type: 'custom',
renderingMode: '3d',
onAdd: function (map, mbxContext) {

// Creative Commons License attribution: Eiffel Tower model by https://www.cgtrader.com/lefabshop
// https://www.cgtrader.com/items/108594/download-page
let options = {
obj: './models/eiffel.glb',
obj: './models/landmarks/eiffel.glb',
type: 'gltf',
scale: mapConfig.PAR.scale,
units: 'meters',
//adjustment: { x: -0.5, y: -0.5, z: 0 } // model center is displaced
rotation: { x: 90, y: 0, z: 0 }, //default rotation
}

tb.loadObj(options, function (model) {
Expand Down
3 changes: 3 additions & 0 deletions examples/11-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
// import soldier from an external glb file, scaling up its size 20x
// IMPORTANT: .glb is not a standard MIME TYPE, you'll have to add it to your web server config,
// otherwise you'll receive a 404 error

// Attribution: Soldier animated model by T. Choonyung at https://www.mixamo.com
// from https://www.mixamo.com/#/?page=1&query=vanguard&type=Character
var options = {
obj: 'models/soldier.glb',
type: 'gltf',
Expand Down
8 changes: 4 additions & 4 deletions examples/12-add3dmodel.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@
type: 'custom',
renderingMode: '3d',
onAdd: function (map, gl) {

// Attribution, no License specified: Model by https://github.com/nasa/
// https://nasa3d.arc.nasa.gov/detail/jpl-vtad-dsn34
let options = {
type: 'gltf', //'gltf'/'mtl'
obj: './models/radar/34M_17.gltf', //model url
bin: '', //replace by mtl attribute
obj: './models/radar/34M_17.glb', //model url
units: 'meters', //units in the default values are always in meters
scale: 1,
scale: 333.22,
rotation: { x: 90, y: 180, z: 0 }, //default rotation
anchor: 'center'
}
Expand Down
Loading

0 comments on commit 3da1f79

Please sign in to comment.