I've been exploring this scenario where I am trying to figure out if it is possible to move a camera by adjusting the radius and diameter instead of using x, y, z positions (Vectors). Currently, I am working with a cube, but my goal is to introduce a second camera.
https://i.sstatic.net/Xsw8r.png
Considering that I know the location of the origin at 0,0,0, is there a way to translate the cube by setting the diameter or radius, while ensuring it remains fixed at the origin?
This is the code snippet I am using to move the Cube (Three.js)
var posX,posY,posZ;
var scene, camera, render;
var cubeMesh,cube_Geometry, cube_Material;
class myWorld{
/* ... Setting up the World ... */
//execute cube();
/* ... Updating and getting positions (xyz) ... */
cube(){
cube_Geometry = new THREE.BoxGeometry(20, 20, 20);
cube_Material = new THREE.MeshNormalMaterial();
cube_Mesh = new THREE.Mesh(cube_Geometry, cube_Material);
cube_Mesh.position.set(0, 100, 100);
scene.add(cube_Mesh);
}
animate(){ //loop function
//THREE.Mesh.position.set (Three.js)
cube_Mesh.position.set(posX, posY, posZ);
}
}
The desired outcome would ideally look like: https://i.sstatic.net/HwHrv.png