其实多场景非常简单,只需要两步:
第一步
//启用或禁用剪裁检测. 若启用,则只有在所定义的裁剪区域内的像素才会受之后的渲染器影响
renderer.setScissorTest( true );
第二步
// setScissor 将剪裁区域设为(x, y)到(x + width, y + height)
renderer.setScissor( x, y, w , h );
第一步是在创建渲染器的时候开启设置。第二步是在渲染器渲染场景与相机之前设置渲染区域。
下面就看完整的案例吧
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="../js/three.js"></script>
<script src="../js/OrbitControls.js"></script>
<script src="