From 02aecdfb21c6855a1a5c38518eb9006214c32933 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Mon, 19 Dec 2022 11:59:22 +0100 Subject: [PATCH] fixed textures and alignment on position 1 --- index.html | 50 +++++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/index.html b/index.html index e261f65..8cf3d7e 100644 --- a/index.html +++ b/index.html @@ -46,7 +46,7 @@ var currentGeoPose = null; // https://developer.mozilla.org/en-US/docs/Web/API/G // otherwise have 2 fallbacks via menu var positionsCurated = [ { position:[50.8365354, 4.3581719], hotspots: []}, - { shortname: "baquets", worldposition:[83.03582, -346.4272], position:[49.3516400, 0.5461600], // way heavier! + { shortname: "baquets", worldposition:[-38, 17], position:[49.3516400, 0.5461600], // way heavier! offsetLandscapePosition: "-124.32254 0.78377 -46.41836", // TODO use, might prefer something easier to compute to add e.g Vector3, or do pose (position/rotation/scale) per id // alternatively might show/hide per classname based on shortname offsetWatersimPosition: "-124.32254 0.78377 -46.41836", // TODO use @@ -194,6 +194,7 @@ function fromOSMTo3DElements( josm, el ){ //var houses = josm.elements.filter( e => (e.type == "way" && e.tags && e.tags["add:housenumber"]) ).map( e => e.geometry) var houses = josm.elements.filter( e => (e.type == "way" && e.tags && e.tags["building"]) ) .filter( i => !loadedosmways.includes(i.id) ) + .filter( i => (i.id < 561974951 || i.id > 561974997) ) // does not seem present in the model (assuming sequential OSM list, as of now) .map( e => e.geometry) houses.map( e => { makeBuilding( e, buildingHeight*(1+Math.random()), el ) }) idfound = josm.elements.filter( e => (e.type == "way" && e.tags && e.tags["building"]) ) @@ -255,7 +256,7 @@ function addWall(a, b, h, el, color=0x6d6a64){ const material = new THREE.MeshBasicMaterial({ color : new THREE.Color( 0x6d6a64 ).offsetHSL(0,0,-Math.random()/10), side: THREE.DoubleSide, - map: loader.load('Visuals/TEXTURE_BAT/TEXTURE_BAT_Base_Color.jpg'), + //map: loader.load('Visuals/TEXTURE_BAT/TEXTURE_BAT_Base_Color.jpg'), }); var mesh = new THREE.Mesh( geometry, material ); @@ -334,25 +335,19 @@ function makeWay( points, height, el, color=0xCCCCCC ){ } function makeLamp( treedata, el){ - // - var tree = document.createElement("a-entity") tree.setAttribute("position", AFRAME.utils.coordinates.stringify( pointFromCoordinates( {lat:treedata.lat, lon:treedata.lon} ) ) ) - //tree.setAttribute("gltf-model", "Visuals/EXPORTS/EXPORTS_gltf/ModelsSolo/AA_Ruelle_Lampadaire.glb" ) tree.setAttribute("instanced-mesh-member", "mesh:#meshlamp") el.appendChild( tree ) } function makeTree( treedata, el){ - // - var tree = document.createElement("a-entity") tree.setAttribute("position", AFRAME.utils.coordinates.stringify( pointFromCoordinates( {lat:treedata.lat, lon:treedata.lon} ) ) ) - //tree.setAttribute("gltf-model", "Visuals/EXPORTS/EXPORTS_gltf/AA_Ruelle_Arbre.glb" ) tree.setAttribute("instanced-mesh-member", "mesh:#meshtree") el.appendChild( tree ) } @@ -371,16 +366,6 @@ function makeBuilding( points, height, el ){ var color = new THREE.Color( 0x8F8FFF ).offsetHSL(0,0,-Math.random()); make3DRoof( poly, building, height, color ) - building.setAttribute("shadow", "")// somehow doesn't seem to receive it, only casts - /* - var inbuilding = document.createElement("a-entity") - inbuilding.className = "inbuilding" - building.appendChild( inbuilding ) - makeWalls( poly, 0.2, inbuilding ) - make3DFloor( poly, inbuilding ) - inbuilding.setAttribute("scale", "1.1 1 1.1") // adds an horizontal offset instead of being centered on building - inbuilding.setAttribute("position", "-.2 0 -.2") - */ } function makeLine( poly, h, el ){ @@ -679,8 +664,8 @@ function startExperience(){ - - + + @@ -689,22 +674,21 @@ function startExperience(){ animation__pos="property: position; from:-50 50 100; to: 50 50 100; dur: 20000; easing: linear; loop: true"> - + - - - - + + + + - - + + - - - + + +