Three.js中如何显示帧速【转】

https://blog.csdn.net/hannahlwh1988/article/details/36876295

Step1:src中添加:

<script src="js/stats.min.js"></script>


Step2: function init()函数中添加:

    //建立一个统计器,位于左上角的那个~,用于显示帧数等信息
                    var stats = new Stats();
                    stats.domElement.style.position = 'absolute';
                    stats.domElement.style.top = '0px'; //显示在屏幕左上角的地方。
                    container.appendChild( stats.domElement );//添加到container之后


Step3: function animate() 函数中添加刷新统计

stats.update();//更新当前统计

原文地址:https://www.cnblogs.com/mazhenyu/p/10244318.html