I'm currently working on animating a sphere with increasing radii. Below are the key parts of my code:
function create_sphere(){
var sphereMaterial = new THREE.MeshLambertMaterial(
{
color: 0xCC0000
});
var radius=2,segments=50,rings=50;
sphere_geometry = new THREE.SphereGeometry(radius, segments, rings)
sphere = new THREE.Mesh(sphere_geometry,sphereMaterial);
sphere.position.y = -10;
sphere.position.needsUpdate = true;
sphere.geometry.dynamic = true;
}
Below is the animate function that I am calling:
function animate(){
sphere.position.y+=0.1;
sphere.geometry.radius +=0.1;
scene.add(sphere);
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
Although everything seems to be working fine in terms of moving the sphere in the y-direction, I'm having trouble increasing its radius. Any suggestions on what might be going wrong?