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

自己做图网站网站运营优化推广

自己做图网站,网站运营优化推广,wordpress投稿vip,网站开发建设技术特点参考资料 three.js Canvas画布布局…模型加载进度条 知识点 注#xff1a;基于Three.jsv0.155.0 three.js Canvas画布布局UI交互界面与Canvas画布叠加UI交互按钮与3D场景交互Three.js背景透明度#xff1a;.setClearAlpha()方法、背景透明alpha: true、.setClearColor()方…参考资料 three.js Canvas画布布局…模型加载进度条 知识点 注基于Three.jsv0.155.0 three.js Canvas画布布局UI交互界面与Canvas画布叠加UI交互按钮与3D场景交互Three.js背景透明度.setClearAlpha()方法、背景透明alpha: true、.setClearColor()方法Three.js渲染结果保存为图片preserveDrawingBuffer:true、Cavnas方法.toDataURL()深度冲突(模型闪烁)logarithmicDepthBuffer: true模型加载进度条 代码实现 !DOCTYPE html html langen headmeta charsetUTF-8titleThree.js/title /headbodydiv styleposition:absolute; left: 10px; top: 10pxbutton idbtnChangeBgColor切换背景色/buttonbutton idbtnDownloadPhoto下载图片/button/div/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.PlaneGeometry(100, 100);// 材质 // MeshBasicMaterial不受光// MeshLambertMaterial受光const material new THREE.MeshLambertMaterial({color:0x0000ff,side: THREE.DoubleSide});// 网格模型物体const mesh new THREE.Mesh(geometry, material);mesh.position.set(0, 0, 0);scene.add(mesh);const mesh1 mesh.clone();mesh1.material mesh.material.clone();mesh1.material.color.set(0xff0000);// 设置模型宽度、高度mesh1.scale.set(2, 2, 2);mesh1.position.z 0.01;scene.add(mesh1);// 坐标系const axes new THREE.AxesHelper(200);scene.add(axes);// // 点光源// const pointLight new THREE.PointLight( 0xffffff, 1.0, 0, 0);// pointLight.position.set(-200, 200, 200 );// scene.add( pointLight );// // 辅助点光源// const pointLightHelper new THREE.PointLightHelper( pointLight, 10 );// scene.add( pointLightHelper );// 环境光const ambientLight new THREE.AmbientLight( 0xffffff, 0.2);scene.add( ambientLight );// 平行光const directionalLight new THREE.DirectionalLight( 0xffffff, 1, 0, 0);// directionalLight.position.set(100, 0, 0);// directionalLight.position.set(0, 100, 0);// directionalLight.position.set(100, 100, 100);directionalLight.position.set(100, 60, 50);directionalLight.target mesh;scene.add( directionalLight );// 辅助平行光const directionalLightHelper new THREE.DirectionalLightHelper( directionalLight, 10 );scene.add( directionalLightHelper );// 相机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({// 背景透明// alpha: true// 想把canvas画布上内容下载到本地需要设置为truepreserveDrawingBuffer: true,// 设置对数深度缓冲区优化深度冲突问题logarithmicDepthBuffer: true});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);});document.getElementById(btnChangeBgColor).addEventListener(click,function(){renderer.setClearColor(0xff0000, 0.5);renderer.render(scene, camera);})document.getElementById(btnDownloadPhoto).addEventListener(click,function(){// 创建一个a链接var link document.createElement(a);link.href renderer.domElement.toDataURL(image/png);link.download threejs.png; //下载文件名link.click();})/script /html
http://www.yutouwan.com/news/90102/

相关文章:

  • 浦东新区苏州网站建设什么语言做网站
  • 杰瑞网站建设长沙网站建设zh68
  • 网站建设和空间w网站链接如何做脚注
  • 榆林网站seo中国网站建设总部在哪里
  • 展示型网站举例网站建设都用哪些软件
  • 网站设计师培训图片进行网站开发的所有步骤
  • 产品软文范例大全seowhy问答
  • 中国室内设计网欧式seo技术培训教程
  • wordpress zzt梧州网站优化
  • 优秀的vi设计手册seo的基本内容
  • php 除了做网站网站用单页面框架做
  • 怎么制定网站上海私人网站建设
  • 福州网站建设多少钱wordpress此网页包含重定向循环
  • 网站已经收录了 但是输入公司名找不到免费qq注册入口
  • 外发加工单表格范本外贸网站优化哪家好
  • 网站制作外包牛商做网站的理念
  • 高埗镇网站建设网页设计与制作有什么感想
  • 购物网站线下推广方案技术号的网站建设
  • 网站建设 意向协议书公司网站制作范文
  • 网站发布时间更改网页打不开但是微信和qq都可以上
  • 沈阳建网站电商wordpress页面调用子页面
  • 上海做网站大的公司有哪些深圳龙华建设公司
  • 课程网站开发与设计logo设计报价明细表
  • 洛阳网站建设seo如何使用花生壳做网站
  • 网站建设价格如何深圳做分销网站的公司
  • 罗湖网站建设罗湖网站设计有哪些网站可以做店面设计软件
  • 2021年关键词排名seo如何优化排名
  • 甘肃网站建设公司电话做网站只做前端可以用吗
  • html课程教学网站模板住房和城乡建设部网站行标
  • 厦门网站建设是什么网页版微信网址