The reason why I’m asking this is because in the render function of my cube, I cannot use arguments as variables to set the position of my cube. For example, here is a snippet of my code that won’t work:
function render(xPos, yPos, zPos) {
x = xPos;
y = yPos;
z = zPos;
requestAnimationFrame(render);
cube.rotation.x = 10;
scene.add(cube);
cube.position.set(x, y, z);
renderer.render(scene, camera);
}
render(0,0,0);
Can anybody please provide some suggestions on how to fix this problem?!?! Thanks!