threejs使用简单形状的几何图形组装一台汽车三维模型效果代码
代码语言:html
所属分类:三维
代码描述:threejs使用简单形状的几何图形组装一台汽车三维模型效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin: 0; padding: 0; overflow: hidden; } </style> </head> <body > <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.126.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/OrbitControls.126.js"></script> <script > let camera, controls, scene, renderer; init(); animate(); function Car() { const car = new THREE.Group(); const backWheel = new THREE.Mesh( new THREE.CylinderGeometry(6, 6, 33, 64), new THREE.MeshLambertMaterial({ color: 0x333333 })); backWheel.position.z = 6; backWheel.position.x = -18; car.add(backWheel); const backWheelRim = new THREE.Mesh( new THREE.CylinderGeometry(3, 3, 34, 64), new THREE.MeshLambertMaterial({ color: 0x000000 })); backWheelRim.position.z = 6; bac.........完整代码请登录后点击上方下载按钮下载查看
网友评论0