Reputation: 1132
In my three.js projet i se my scene and camera like thisone:
var container = document.getElementById('container');
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setAnimationLoop(render);
renderer.outputEncoding = THREE.sRGBEncoding;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.25;
container.appendChild(renderer.domElement);
window.addEventListener('resize', onWindowResize, false);
stats = new Stats();
container.appendChild(stats.dom);
//
camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 0.1, 100);
camera.position.set(3.5, 2, - 2.5);
controls = new OrbitControls(camera, container);
controls.target.set(0, 0.5, 0);
controls.update();
scene = new THREE.Scene();
scene.background = new THREE.Color(0xeeeeee);
scene.environment = new RoomEnvironment(renderer);
scene.fog = new THREE.Fog(0xeeeeee, 10, 50);
...
well my scene start like this:
i would like to start doubled my object, like this:
i try:
camera.zoom.set(2);
but nothing happens So i try to define a vector3 (2,2,2) and scale my object:
myobj.scale.set(myVector3);
nothing.
Someone can help me about starting my scene with my object more big?
So many thanks in advance
Upvotes: 1
Views: 198
Reputation: 31076
If you do:
camera.zoom.set(2);
You have to ensure to update the project matrix like so:
camera.updateProjectionMatrix();
Regarding the other issue, Vector3.set()
only accepts three scalars as parameters. You can't use the method with a single argument of type Vector3
. So you can do:
myobj.scale.set(myVector3.x, myVector3.y, myVector3.z);
or even better:
myobj.scale.copy(myVector3);
Upvotes: 1