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

网站官网建设的价格推广搜索引擎

网站官网建设的价格,推广搜索引擎,西安编程培训机构,网站开发属于什么费用这里主要用到了 一个方法 obj.getWorldDirection(); obj.getWorldDirection()表示的获取obj对象自身z轴正方向在世界坐标空间中的方向。 按下 W键前进运动#xff1b; templatedivel-containerel-maindiv classbox-card-left… 这里主要用到了 一个方法   obj.getWorldDirection();   obj.getWorldDirection()表示的获取obj对象自身z轴正方向在世界坐标空间中的方向。 按下 W键前进运动 templatedivel-containerel-maindiv classbox-card-leftdiv idthreejs/div{{ movementX }}/div/el-main/el-container/div /templates script // 引入轨道控制器扩展库OrbitControls.js import { OrbitControls } from three/examples/jsm/controls/OrbitControls.js; import { GLTFLoader } from three/examples/jsm/loaders/GLTFLoader.js; import TWEEN from tweenjs/tween.js; export default {data() {return {scene: null,camera: null,renderer: null,res1: null,res2: null,clock: null,left_mouse_down: false,keyState: {W: false,S: false,A: false,D: false,},left_rotation: true, // 向左旋转的标志right_rotation: true, // 向右旋转的标志VW: new this.$three.Vector3(0, 0, 0),VS: new this.$three.Vector3(0, 0, 0),curr_v: new this.$three.Vector3(0, 0, 0),person: null,movementX: null,deltaTime: 0,a: 60, // 加速度damping: -0.04,};},created() {},mounted() {this.init();},methods: {goBack() {this.$router.go(-1);},init() {// 创建场景对象this.scene new this.$three.Scene();// 创建坐标轴辅助对象const axesHelper new this.$three.AxesHelper(100);this.scene.add(axesHelper);// 创建时钟对象this.clock new this.$three.Clock();// 创建环境光对象const ambientLight new this.$three.AmbientLight(0xffffff, 6);this.scene.add(ambientLight);// this.createMesh();// 创建相机对象this.camera new this.$three.PerspectiveCamera(60,1,0.01,2000);// this.camera.position.set(0,5,-5);// this.camera.lookAt(0,0,0);// 创建渲染器对象this.renderer new this.$three.WebGLRenderer();this.renderer.setSize(1000,800);// 创建gltfLoader加载器对象const gltfLoader new GLTFLoader();gltfLoader.load(models/gltf/person2/scene.gltf, gltf {this.person gltf.scene;// 将相机添加到人物模型上this.person.add(this.camera);// 调整相机位置this.camera.position.add(new this.$three.Vector3(0,5,-6));this.camera.translateZ(-1);let camera_look_position this.person.position.clone().add(new this.$three.Vector3(0,4,0));// 设置相机指向this.camera.lookAt(camera_look_position);this.scene.add(gltf.scene);this.renderer.render(this.scene, this.camera);window.document.getElementById(threejs).appendChild(this.renderer.domElement);})// 监听事件方法this.addEventListenerFn();this.renderLoop();},createMesh() {const geometry new this.$three.BoxGeometry(1,1,1);const material new this.$three.MeshBasicMaterial({color: 0xffaadd});const mesh new this.$three.Mesh(geometry, material);// mesh.rotateY(Math.PI / 2);const dir new this.$three.Vector3();mesh.getWorldDirection(dir);this.scene.add(mesh);console.log(dir, dir);},addEventListenerFn() {document.addEventListener(mousemove, e {// 鼠标左键按下的情况if(this.left_mouse_down) {this.movementX e.movementX;this.person.rotation.y - e.movementX / 100;// this.camera.rotateY(e.movementX / 100);const dir new this.$three.Vector3();this.person.children[0].getWorldDirection(dir);this.renderer.render(this.scene, this.camera);}})document.addEventListener(mousedown, e {// e.button 0 左键e.button 2 右键if(e.button 0) {this.left_mouse_down true;}})document.addEventListener(mouseup, e {// e.button 0 左键e.button 2 右键if(e.button 0) {this.left_mouse_down false;}})// 监听键盘按下document.addEventListener(keydown, e {// 如果按下的是 w键if(e.code KeyW) {this.keyState.W true;}if(e.code KeyS) {this.keyState.S true;}})// 监听键盘弹起document.addEventListener(keyup, e {// 如果按下的是 w键if(e.code KeyW) {this.keyState.W false;}if(e.code KeyS) {this.keyState.S false;}})},renderLoop() {let deltaTime this.clock.getDelta();if(this.keyState.W) {const front new this.$three.Vector3();this.person.getWorldDirection(front);let person_v this.curr_v.clone().add(front.multiplyScalar(deltaTime * this.a));const pos person_v.clone().multiplyScalar(deltaTime);this.person.position.add(pos);}if(this.keyState.S) {const front new this.$three.Vector3();this.person.getWorldDirection(front);let person_v this.curr_v.clone().add(front.multiplyScalar(deltaTime * (-this.a)));const pos person_v.clone().multiplyScalar(deltaTime);this.person.position.add(pos);}this.renderer.render(this.scene, this.camera);window.requestAnimationFrame(this.renderLoop);},}, }; /script style langless scoped .box-card-left {display: flex;align-items: flex-start;flex-direction: row;width: 100%;.box-right {img {width: 500px;user-select: none;}} } /style
http://www.w-s-a.com/news/453501/

相关文章:

  • 重庆网站建设帝维科技网站做定向的作用
  • 网站建设工作室wp主题模板做污事网站
  • 网站建设 深圳 凡科重庆家居网站制作公司
  • 自己也可以免费轻松创建一个网站企业收录网站有什么用
  • 帮别人做网站违法导航网站开发工具
  • seo网站外包公司字画价格网站建设方案
  • 网站国内空间价格销售技巧
  • 广安建设企业网站qq互联网站备案号
  • 京东网站建设的要求vs2010做的网站
  • wordpress 新闻杂志主题佛山企业网站排名优化
  • 选服务好的网站建设金华市开发区人才网
  • 广州建站商城南阳高质量建设大城市网站
  • 网站建设合同封面模板做代炼的网站
  • 外贸网站建站要多少钱南昌优化排名推广
  • 做公司网站的尺寸一般是多大企业管理网站
  • 苏州网站设计公司兴田德润i简介做签证宾馆订单用啥网站
  • 网站页面设计工具做网站租空间
  • 做智能网站系统百度提交入口
  • 网站建设代理商电话网站规划和建设方案
  • 双桥区网站制作seo 首页
  • 电子商务网站建设前期准备wordpress域名指向二级目录
  • 汕头建站网站模板淮北做网站电话
  • 手机做logo用什么网站服务器安全防护
  • 课程分销的网站怎么做北京企业网站建设方案
  • 吴兴区建设局网站湖北企业网站建设
  • 网页与网站的区别是什么2023年8月份新冠
  • 唐山网站建设外包公司安卓手机怎么搭建网页
  • 国内做网站最大的公司计量检测网站平台建设方案
  • 重庆沛宣网站建设网页制作初学者
  • php网站漂浮广告代码网络营销跟网站推广有啥区别