Assets path; some view defaults

This commit is contained in:
Nicolò P 2025-09-29 18:45:17 +02:00
parent 04c51af8a8
commit ae85cf281c
3 changed files with 15 additions and 14 deletions

3
.gitignore vendored
View File

@ -3,5 +3,6 @@
# Models # Models
*.3dm *.3dm
*.gl{b,tf} *.gl*
*.obj *.obj

0
assets/.keep Normal file
View File

View File

@ -5,12 +5,9 @@
// Realize our app // Realize our app
let APP = ATON.App.realize(); let APP = ATON.App.realize();
const materialProperties = { const material = {
color: "#8993a4", color: "#e6f2ff",
//transparent: true, emissive: true,
//opacity: 0.8,
flatShading: false,
//wireframe: true,
}; };
function showEdges (object) { function showEdges (object) {
@ -31,19 +28,22 @@ APP.setup = ()=>{
// Realize base ATON and add base UI events // Realize base ATON and add base UI events
ATON.realize(); ATON.realize();
ATON.UI.addBasicEvents(); ATON.UI.addBasicEvents();
// All assets for this app are stored here
let lightProbe = new ATON.LightProbe(); ATON.setPathCollection('./assets/');
lightProbe.setPosition(2, 6, 2); ATON.setMainLightDirection(new THREE.Vector3(0.2,-0.3,-0.7));
// Load 3D model // Load 3D model
let mainNode = ATON.createSceneNode("teatro").load("nicolo/models/teatro_san_salvador.glb"); let mainNode = ATON.createSceneNode("teatro").load("teatro_san_salvador_20250926.gltf");
mainNode.setMaterial(new THREE.MeshPhongMaterial(materialProperties)); const pano = "defsky-grass.jpg";
ATON.setMainPanorama(pano);
mainNode.setMaterial(new THREE.MeshPhongMaterial(material));
mainNode.setRotation(0, 1.5, 0)
//showEdges(mainNode.children[0]); //showEdges(mainNode.children[0]);
mainNode.attachToRoot(); mainNode.attachToRoot();
lightProbe.update();
//ATON.addLightProbe(lightProbe); ATON.toggleShadows(true);
ATON.setExposure(1.3);
// If our app required ore or more flares (plugins), we can also wait for them to be ready for specific setups // If our app required ore or more flares (plugins), we can also wait for them to be ready for specific setups
ATON.on("AllFlaresReady",()=>{ ATON.on("AllFlaresReady",()=>{