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

网站优化软件开发wordpress绑定网站

网站优化软件开发,wordpress绑定网站,wordpress5.2自动保存,网页前端开发培训我的建议是使用这个库 https://github.com/deepkolos/three-platformize 为什么?我试了uniapp推荐的和threejs-miniprogram这个小程序官方库,都加载不出来我的obj模型。所有我推荐不要用obj模型最好,挺多都支持GLTF模型的,但是我不…

我的建议是使用这个库
https://github.com/deepkolos/three-platformize
为什么?我试了uniapp推荐的和threejs-miniprogram这个小程序官方库,都加载不出来我的obj模型。所有我推荐不要用obj模型最好,挺多都支持GLTF模型的,但是我不能改。

安装,使用pnpm比较快

pnpm install three-platformize

以下是完整代码

<template><view class="content"><canvas type="webgl" id="webgl" style="width: 100vw; height: 100vh;" @touchstart="touchStart"@touchmove="touchMove" @touchend="touchEnd" /></view>
</template><script>import {WechatPlatform} from 'three-platformize/src/WechatPlatform';import * as THREE from 'three-platformize';//轨道控制器import {OrbitControls} from 'three-platformize/examples/jsm/controls/OrbitControls'export default {data() {return {platform: ''};},mounted() {uni.createSelectorQuery().in(this).select('#webgl').fields({node: true}).exec(res => {console.log('res', res[0].node);const canvas = res[0].node;console.log('canvas', canvas);const platform = new WechatPlatform(canvas); // webgl canvasconsole.log('1111', platform);platform.enableDeviceOrientation('game'); // 开启DeviceOrientationTHREE.PLATFORM.set(platform);this.platform = platform;var scene = new THREE.Scene();var camera = new THREE.PerspectiveCamera(75, canvas.width / canvas.height, 0.1, 1000);camera.position.set(0, 0, 10);scene.add(camera);const geometry = new THREE.BoxGeometry(1, 1, 1);const materials = new THREE.MeshBasicMaterial();const cube = new THREE.Mesh(geometry, materials);scene.add(cube);const light = new THREE.AmbientLight(0xffffff);scene.add(light);//注意,这里必须要添加一个{ canvas: canvas },不然会报createElementNS错误const renderer = new THREE.WebGLRenderer({canvas: canvas});renderer.setSize(canvas.width, canvas.height);const controls = new OrbitControls(camera, renderer.domElement);function animate() {//这里不再是requestAnimationFrame而是canvas.requestAnimationFramecanvas.requestAnimationFrame(animate);renderer.render(scene, camera);}animate();});},methods: {touchStart(e) {this.platform.dispatchTouchEvent(e);},touchMove(e) {this.platform.dispatchTouchEvent(e);},touchEnd(e) {this.platform.dispatchTouchEvent(e);}}}
</script><style></style>

http://www.yayakq.cn/news/432359/

相关文章:

  • 广州网站建设菲利宾深圳市市场监督管理局
  • 企业建设网站好吗黄埔网站建设价格
  • 织梦网站上传保存文档做网站的平台
  • 上海外贸营销网站建设地址装修网平台
  • 做网站需要关注哪些pc端网站未来
  • 西安做一个企业网站要多少钱建设搜索引擎友好的网站
  • 展示型网站建设公司网站开发的技术意义
  • 网站开发各年的前景建站系统和构建系统
  • 网站内页产品做跳转济南互联网网络营销
  • 网站推广策划公司短视频获客
  • 个人网站的服务器环境安装网站源码提取
  • 网站建设公司网站建设专业品牌网站名字重复
  • 网站开发有哪些方式网络营销案例论文3000字
  • 用vs2015做网站教程免费看舆情网站
  • 做软件好还是做网站好建行打95533能改密码吗
  • 做网站5年工资多少做网站首页多少钱
  • 网站app充值记账凭证怎么做手机怎么分享wordpress
  • 响应式网站建设多少钱文成网站建设
  • 帝国做双语网站免费域名的网站有哪些
  • 小企业网站建设有多少iis 建立子网站
  • 极速云建站淘金企业网站建设服务
  • 网站制作 建站php网站开发什么
  • 辽宁自适应网站建设公司提高网站权重的作用
  • 电子商务网站建设的技术综述关于医疗保障局门户网站建设
  • jquery 的网站模板深圳网站建设者
  • 3g小说网站中国网站排名网官网
  • 泉州住房建设局网站给学校建网站那个系统好
  • 专业手机网站开发wordpress 直接连接数据库文件
  • 做网站域名后缀选择成都户外网站建设
  • 汕头seo建站wordpress购物模板