I have a scene with two individual meshes. It looks like this:
this.loadFiles("gras", (gras) => {
var particleMaterial = new THREE.MeshPhongMaterial();
particleMaterial.map = THREE.ImageUtils.loadTexture("models/planets/gras.jpg");
particleMaterial.side = THREE.DoubleSide;
this.mesh = new THREE.Mesh(gras,particleMaterial);
this.loadFiles("rocks", (rocks) => {
var particleMaterial = new THREE.MeshPhongMaterial();
particleMaterial.map = THREE.ImageUtils.loadTexture("models/planets/rocks.jpg");
particleMaterial.side = THREE.DoubleSide;
this.rocks = new THREE.Mesh(rocks,particleMaterial);
callback(this);
});
});
Now I want to merge the meshes together. But how can i combine the textures?
this.loadFiles("gras", (gras) => {
this.loadFiles("rocks", (rocks) => {
var geometry = new THREE.Geometry;
THREE.GeometryUtils.merge(geometry,gras);
THREE.GeometryUtils.merge(geometry,rocks);
var particleMaterial = new THREE.MeshPhongMaterial();
particleMaterial.map = THREE.ImageUtils.loadTexture("models/planets/gras.jpg");
particleMaterial.side = THREE.DoubleSide;
this.mesh = new THREE.Mesh(geometry,particleMaterial);
callback(this);
});
});