What determines the size of the world?

Pardon the noob question but I either completely forgot or never really new what determines the “size” of my virtual world (i.e. - the dimensions of the entire world in virtual units given in X, Y, and z)? I looked at my code where I create floor and I see that the texture is set to repeat, but I can’t figure out what dimensions ThreeJS uses to decide how many times to repeat the texture, which I assume is governed by the size of the world?

    const urlToFloor = '/images/floor/lavatile-alt-blue.jpg';

    let floorTexture = new THREE.ImageUtils.loadTexture(urlToFloor);
    floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping;
    floorTexture.repeat.set(20, 20);
    // let floorMaterial = new THREE.MeshBasicMaterial({map: floorTexture, side: THREE.DoubleSide});
    let floorMaterial = new THREE.MeshPhongMaterial({map: floorTexture, side: THREE.DoubleSide});
    let floorGeometry = new THREE.PlaneGeometry(1000, 1000, 10, 10);
    let floor = new THREE.Mesh(floorGeometry, floorMaterial);
    floor.position.y = -0.5;
    floor.position.z = -350; // -450;
    floor.rotation.x = Math.PI / 2;
    floor.receiveShadow = true;
    g_ThreeJsScene.add(floor);

1 unit 1 meter
PlaneGeometry(1000 meters, 1000 meters, 10, 10);

1 Like

That is not correct, 1 unit is 1 meter if you decide so, but the units are not predefined. In Blender it is defined as 1 m by default, but you can change it.

Texture.repeat is the number of times the image is repeated. If you set it to ( 3, 3 ) then the texture will be tiled in a 3x3 grid.
https://threejs.org/docs/index.html?q=texture#api/en/textures/Texture.repeat

1 Like