gpt4 book ai didi

javascript - Three.js - 地面/地板上的反射

转载 作者:行者123 更新时间:2023-12-03 10:43:00 33 4
gpt4 key购买 nike

我想做同样的事情:(没有复制球体)

http://people.mozilla.org/~sicking/webgl/ray.html

我做到了,它有效,但反射太大:/

var groundTexture = THREE.ImageUtils.loadTexture( "files/checkerboard.jpg" );
groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
groundTexture.repeat.set( 25, 25 );
groundTexture.anisotropy = 16;

mirrorGroundCamera = new THREE.CubeCamera( 0.1, 5000, 512 );
scene.add( mirrorGroundCamera );

var mirrorGroundMaterial = new THREE.MeshBasicMaterial( { map: groundTexture, side: THREE.DoubleSide, envMap: mirrorGroundCamera.renderTarget } );
mirrorGround = new THREE.Mesh( groundGeometry, mirrorGroundMaterial );
mirrorGround.position.y = -0.5;
mirrorGround.rotation.x = - Math.PI / 2;
mirrorGroundCamera.position = mirrorGround.position;
scene.add(mirrorGround);

最佳答案

Three.js 中的环境映射是一个近似值,并假设环境“无限”遥远。

参见http://threejs.org/examples/webgl_mirror.html有关如何在 Three.js 中处理镜像反射的示例。

三.js r.70

关于javascript - Three.js - 地面/地板上的反射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28693206/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com