Search the Community
Showing results for tags 'imported'.
-
Hi everybody ! I'm importing .obj files in my application, and I want to change their color. However, the color seems to be changed when the page is loading, but when it's finally loaded the mesh still has its basic grey material (so while the whole scene is loading we can see the mesh being pink for half a second and then takes back its basic color/texture/material). I've seen something about UV maps etc.. but I checked it in Blender and it is activated when I import into obj. Here's a pg trying to reproduce my problem ( first you will need to help me importing my object into the pg because it doesn't seem to be working, I can't see it on scene); I added a skull.babylon to show that the code I provide is supposed to work : https://www.babylonjs-playground.com/#V9KE7I#7 Thanks for your time !
-
Hi fellow Babylonians, I tried to import a mesh of a boat, but i want to change the color of its material. I cannot change it for some reason. here is the part of code: let boat = new BABYLON.AbstractMesh("boat", scene); boatMaterial = new BABYLON.StandardMaterial("boatMat", scene); boatMaterial.diffuseColor = new BABYLON.Color3(1.0, 0.2, 0.5); BABYLON.SceneLoader.ImportMesh("", "assets/", "speedboat.babylon", scene, (meshes, particleSystems) => { meshes[0].material = boatMaterial; boat = meshes[0]; }); let boatSpeed = 1; boat.position = new BABYLON.Vector3(-10, 0, 100); But bright side, experience on babylon has been great so far. But just need help on this.