wen Posted October 12, 2018 Share Posted October 12, 2018 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; }); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.