N
N
ncoxall2016-09-28 07:15:11
JavaScript
ncoxall, 2016-09-28 07:15:11

How to transfer geometry from one object to a new one?

Let's say there is an object

var sphere = new THREE.SphereGeometry(111.65, 32, 32);
var sphereMesh = new THREE.Mesh(sphere);

We can get its geometry
var geo = sphereMesh.geometry.toJSON();

But how do I create a new mesh with geo geometry
If I just paste:
var mesh = new THREE.Mesh(geo, new THREE.MeshPhongMaterial({color: 0xFF0000}));
scene.add(mesh);

we get an error:
Cannot read property 'center' of undefined

How to be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question