Skip to content Skip to sidebar Skip to footer

How I Can Turn A Figure That Is Upside Down?

I am creating a map using a json file. of d3.js to Three.js. When shown, it is shown upside down. As I can turn him?. I'm not sure which is the best way to flip. I want to recomme

Solution 1:

No telling what a lot of your parameters are external to this snippet, but if you create a flip matrix at the same time as you create material e.g.

var material= newArray(); // you already have thisvar flip = newTHREE.Matrix4().makeScale(1,-1,1);

then apply it to shape3d just before calling new THREE.Mesh():

shape3d.applyMatrix(flip);

That should do the trick.

Also: You should be careful also here, you are using LineBasicMaterial when really you should use MeshBasicMaterial and set the sides and wireframe attributes appropriately.

Post a Comment for "How I Can Turn A Figure That Is Upside Down?"