logo资料库

前端技术+黄勇+酷家乐+Virtual+DOM在3D渲染中的应用——类ReactJS库的实现及3D应用+.pdf

第1页 / 共24页
第2页 / 共24页
第3页 / 共24页
第4页 / 共24页
第5页 / 共24页
第6页 / 共24页
第7页 / 共24页
第8页 / 共24页
资料共24页,剩余部分请下载后查看
Virtual DOM在3D渲染中的应用 类ReactJS库的实现及3D应用 黄勇
DOM WebGL
黄勇 2006~2012: 武汉大学 5年前端开发经验 2016年8月加入酷家乐,花名佚名 HTML5工具前端负责人 设计并实现HTML5版本的家装设计工具
普通的3D程序 var geometry = new THREE.BoxGeometry( 1, 1, 1 ); var material = new THREE.MeshBasicMaterial( { color: 不便之处 var cube = new THREE.Mesh( geometry, material ); // ● 命令式:手动的创建、添加和更新 scene.add( cube ); // add camera.position.z = 5; var animate = function () { ● 组合性差 requestAnimationFrame( animate ); ReactJS cube.rotation.x += 0.1; // update cube.rotation.y += 0.1; renderer.render(scene, camera); ● 声明式 ● 良好的可组合性 };
DOM WebGL
ReactJS? ● render()只能返回一个节点 ● 多renderer不能共存 ● 用
来包裹自定义组件?
ReactJS? With React: 30FPS Without React: 60FPS
我们的解决方案 vdom + threejs
分享到:
收藏