wen

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. wen

    Obj Material

    Hi, I am new to Babylon JS. I have successfully imported the obj file but how do I add texture to it? I tried the following codes but to no avail: var material = new BABYLON.StandardMaterial("goldMaterial", this.scene); material.diffuseTexture = new BABYLON.Texture("textures/gold.jpeg", this.scene); material.specularColor = BABYLON.Color3.Black(); material.emissiveColor = BABYLON.Color3.White(); BABYLON.SceneLoader.ImportMesh(null, "models/", "majahapitGold.obj", this.scene, (meshes) => { var room = meshes[0]; room.scaling = 0.001; room.position = new BABYLON.Vector3.Zero(0, 5,0) room.material = material; this.camera.radius = 3000; });