问题
Is it possible to increase the scale of a cylinder on the Y-axis from a specific point.
As instead of the cylinder growing from its origin up and down to the new scale, growing from the top upwards/downwards only like a bar chart.
Current code :
function animate() {
render();
cylinder.scale.y += 0.1;
requestAnimationFrame(animate);
}
回答1:
You can create a intermediary Object3D
to achieve this:
var cylinder = new THREE.Object3D();
scene.add( cylinder );
var cylinderMesh = new THREE.Mesh(geometry.material);
cylinder.add(cylinderMesh);
cylinderMesh.position.y = 2; // move pivot up
cylinder.scale.y += 0.1;
来源:https://stackoverflow.com/questions/26463244/three-js-scale-cylinder-from-point