当前位置: 首页 > news >正文

网站公告建设方案潍坊网站建设报价

网站公告建设方案,潍坊网站建设报价,电商网站建设的重要性,wordpress 函数大全参考资料 Vector3与模型位置、缩放属性…模型隐藏或显示 知识点 注#xff1a;基于Three.jsv0.155.0 Group#xff1a;add()遍历模型树结构、查询模型节点#xff1a;name、traverse、getObjectByName()本地坐标和世界坐标#xff1a;getWorldPosition()改变模型相对局…参考资料 Vector3与模型位置、缩放属性…模型隐藏或显示 知识点 注基于Three.jsv0.155.0 Groupadd()遍历模型树结构、查询模型节点name、traverse、getObjectByName()本地坐标和世界坐标getWorldPosition()改变模型相对局部坐标原点位置移除对象.remove()模型隐藏或显示visible 代码实现 !DOCTYPE html html langen headmeta charsetUTF-8titleThree.js/title /headbody/body!-- 具体路径配置你根据自己文件目录设置我的是课件中源码形式 --script typeimportmap{imports: {three: ./js/three.module.js,three/addons/: ../three.js/examples/jsm/}}/scriptscript typemoduleimport * as THREE from three;import { OrbitControls } from three/addons/controls/OrbitControls.js;const width 800const height 500// 场景const scene new THREE.Scene();// 几何体const geometry new THREE.BoxGeometry(20, 50, 20);// 材质 const material new THREE.MeshLambertMaterial({color:0x0000ff,});const mesh0 new THREE.Mesh(geometry, material);scene.add(mesh0);// 网格模型物体const mesh new THREE.Mesh(geometry, material);mesh.name 1号楼;const mesh2 new THREE.Mesh(geometry, material);mesh2.material mesh.material.clone();mesh2.position.x 40;mesh2.name 2号楼;// ********** 本章知识点示例代码 Start **********// 组const group new THREE.Group();// const group new THREE.Object3D();group.add(mesh, mesh2);group.position.y 20;scene.add(group);group.name 小区;// 遍历所有的物体group.traverse(child {console.log( ~ file: 4层级模型.html:52 ~ child:, child.name)if (child.isMesh) {child.material.color.set(0xff0000);}});// 根据名称获取物体const mashByName group.getObjectByName(1号楼);mashByName.material.color.set(0x00ff00);// 本地坐标和世界坐标mesh.position.x 10;group.position.x 100;// 获取世界坐标const vector new THREE.Vector3();mesh.getWorldPosition(vector);console.log( ~ file: 4层级模型.html:71 ~ vector:, vector) // 110,20,0const vector2 new THREE.Vector3();mesh2.getWorldPosition(vector2);console.log( ~ file: 4层级模型.html:75 ~ vector2:, vector2) // 140,20,0//可视化mesh2的局部坐标系const meshAxesHelper new THREE.AxesHelper(50);mesh2.add(meshAxesHelper);// 平移几何体的顶点坐标,改变几何体自身相对局部坐标原点的位置geometry.translate(10, 0, 0);// 移除group.remove(mesh);// 隐藏// mesh2.visible false;mesh2.material.visible false;// ********** 本章知识点示例代码 End **********// 光源const pointLight new THREE.PointLight(0xffffff, 1.0, 0, 0);pointLight.position.set(200, 200, 200 );scene.add(pointLight);// 坐标系const axes new THREE.AxesHelper(200);scene.add(axes);// 相机const camera new THREE.PerspectiveCamera(75, width/height, 0.1, 1000);camera.position.set(200, 200, 200);camera.lookAt(scene.position);// 渲染器const renderer new THREE.WebGLRenderer();renderer.setSize(width, height);renderer.render(scene, camera);document.body.appendChild(renderer.domElement);// 控制器const controls new OrbitControls(camera, renderer.domElement);controls.addEventListener(change, () {renderer.render(scene, camera);});// 渲染循环function render() {mesh.rotateY(0.01);// mesh旋转动画// 同步mesh2和mesh的姿态角度一样不管mesh姿态角度怎么变化mesh2始终保持同步mesh2.rotation.copy(mesh.rotation);mesh0.rotation.copy(mesh.rotation);renderer.render(scene, camera);requestAnimationFrame(render);}render();/script /html
http://www.yutouwan.com/news/312948/

相关文章:

  • 做家纺的网站营销网络营销
  • 做博客网站需要工具吗公司管理信息系统
  • 连云港百度推广网站建设营销点子
  • 网站建站步骤企业seo网站推广公司
  • 开发者门户网站是什么意思设计手机网站页面尺寸大小
  • 大学生网站开发比赛桂林市自来水公司网站
  • 专业做网站官网今天重庆新闻头条
  • 荥阳网站建设公司建网页的软件
  • 网站规划设计的一般流程官网站站
  • 开封市住房和城乡建设网站wordpress ftp服务器
  • 北京建设网站哪里好建设部网站监理工程师查询
  • asp sqlite网站空间网站建设需要什么技能
  • 重庆市住房和城乡建设厅网站首页wordpress插件找回
  • 适合做公司网站的cms做网站用什么牌子电脑
  • 中国建设银行登录入口绍兴网站推广优化
  • 专门做封面的网站青岛网站建设eoe
  • 网站能不能自己做如何建立自己的云服务器
  • 怎么做类似淘宝一样的网站吗福建百度开户
  • 广州哪里有做网站的怎么看网站是否织梦
  • 浙江电商网站建设销售大数据网络营销
  • 江苏高校品牌专业建设工程网站网站正在建设中的素材动图
  • 网站建设备案需要材料优质做网站哪家好
  • 西安 网站 公司在线编辑软件
  • 厦门市建设局网站 限价房360建筑网怎么注册
  • 做门户网站需要准备什么西安刚刚宣布
  • 网站做gzip压缩优秀营销软文100篇
  • 12306的网站多少钱做的深圳网络营销模式
  • 中国航天建设集团有限公司网站合肥比较好的设计公司
  • 江苏集团网站建设自助建站之星
  • 地方网站怎么做的做租凭网站是经营性吗