arbiterpan
arbiterpan

Reputation: 21

How to Draw the ellipsoid using three.js

Three.js only have functions that draw ellipses,but I want to draw the ellipsoid, please help me!

I want to draw the ellipsoid using three.js

Upvotes: 1

Views: 836

Answers (1)

Rabbid76
Rabbid76

Reputation: 210968

You can construct an ellipsoid by scaling a sphere:

const ellipsoidGeometry = new THREE.SphereGeometry(0.5, 32, 16);
ellipsoidGeometry.rotateZ(Math.PI/2);
ellipsoidGeometry.scale(2, 1, 1);
const ellipsoidMesh = new THREE.Mesh(ellipsoidGeometry, yourMaterial);

Upvotes: 2

Related Questions