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

财政部经济建设司网站在哪个平台做推广比较好

财政部经济建设司网站,在哪个平台做推广比较好,长沙有哪些知名网站,网站建设岗位近期在开发过程中,因为项目已经接近尾声,就需要对项目中的数据进行整合,而数据看板不失为一个比较直观的展现形式。在数据看板中3D的展现形式是比较流行的展现形式,那么如何在项目引入一个大的场景,并且能够和后台发生…

       近期在开发过程中,因为项目已经接近尾声,就需要对项目中的数据进行整合,而数据看板不失为一个比较直观的展现形式。在数据看板中3D的展现形式是比较流行的展现形式,那么如何在项目引入一个大的场景,并且能够和后台发生交互呢。

        我们首先想到的肯定是大型团队都使用的ue4(虚幻)和unity3d,但是在没有个专门的团队的帮助下,谈这些技术都是扯,最后我还是决定使用three.js这个技术,虽然有一定的上手难度,但是最起码前端配合ui就能玩的转一些小的场景。

        我使用的是vue3项目的vben框架,如果有不同的前端技术我想差别应该不大。

        一、项目位置

        我想我们的项目位置在src/components/Scene创建一个vue页面用于展示页面,在需要展示的地方引入该页面即可

 

       二、首先我们来看一下threejs运行的四个条件

        scene场景、renderer渲染器、camera相机、object对象在我的项目中是是如何使用的呢

来看具体代码

<script lang="ts" setup>import { onMounted, onUnmounted, ref, watch } from 'vue';// 导入场景import scene from '/@/threes/scene';//相机import cameraModule from '/@/threes/camera';// 导入控制器import controls from '/@/threes/controls';// 导入辅助坐标轴import axesHelper from '/@/threes/axesHelper';// 导入渲染器import renderer from '/@/threes/renderer';// 初始化调整屏幕import '/@/three/init';// 导入添加物体函数import createMesh from '/@/threes/createMesh';// 导入每一帧的执行函数import animate from '/@/threes/animate';//绑定交互事件import eventHub from '/@/utils/eventHub';// 场景元素divlet sceneDiv = ref(null);// 添加相机scene.add(cameraModule.activeCamera);// 添加辅助坐标轴// scene.add(axesHelper);// 创建物体createMesh();// 创建事件的问题const props = defineProps(['eventList']);const onmousedown = (e) => {eventHub.emit('mouseDown', e);};onMounted(() => {sceneDiv.value.appendChild(renderer.domElement);addEventListener('click', onmousedown, false);animate();});watch(() => props.eventList,() => {console.log('触发事件列表更新2');eventHub.emit('setEventList', props.eventList);},{ deep: true },);onUnmounted(() => {console.log('销毁');removeEventListener('click', onmousedown, false);// removeEventListener('mousedown', onmousedown, false);});
</script>

scene.js文件主要创建了一个场景,并添加了平行光,当然天气等条件都能加入进来

import * as THREE from 'three';
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js';
// 初始化场景
const scene = new THREE.Scene();// 添加雾霾
// const fog = new THREE.Fog(0x000000, 0, 1000);
// scene.fog = fog;// 导入hdr纹理
const hdrLoader = new RGBELoader();
hdrLoader.loadAsync('./textures/023.hdr').then((texture) => {scene.background = texture;scene.environment = texture;scene.environment.mapping = THREE.EquirectangularReflectionMapping;
});// 添加平行光
const light = new THREE.DirectionalLight(0xffffff, 1);
light.position.set(10, 100, 10);
scene.add(light);export default scene;

cameraModule.js文件主要设置了相机的位置,新增相机和切换相机的方法,当然这个的命名是根据你的场景里相机的位置来决定的

import * as THREE from 'three';
import eventHub from '/@/utils/eventHub';
// 创建透视相机
const camera = new THREE.PerspectiveCamera(75, window.innerHeight / window.innerHeight, 1, 100000);
// 设置相机位置
camera.position.set(10, 80, 0);
class CameraModule {constructor() {this.activeCamera = camera;this.collection = {default: camera,};eventHub.on('toggleCamera', (name) => {this.setActive(name);});}add (name, camera) {this.collection[name] = camera;}setActive (name) {this.activeCamera = this.collection[name];}
}
export default new CameraModule();

renderer.js渲染器主要是设置了webGL的一些参数,使你的场景不那么假

import * as THREE from 'three';
// 初始化渲染器
const renderer = new THREE.WebGLRenderer({// 设置抗锯齿antialias: true,// depthbufferlogarithmicDepthBuffer: true,physicallyCorrectLights: true,alpha: true,
});
// 设置渲染尺寸大小
// renderer.setSize(window.innerWidth, window.innerHeight);
setTimeout(() => {const container = document.getElementById('sceneDiv');renderer.setSize(container.offsetWidth, container.offsetHeight);renderer.setClearAlpha(0);renderer.shadowMap.enabled = true;renderer.toneMapping = THREE.ACESFilmicToneMapping;renderer.toneMappingExposure = 1.5;
}, 40);export default renderer;

我的object对象的加载放在了createMesh.js这个文件里面,能够让分清他们的职责。

import scene from './scene';
import City from './mesh/City';
let city;
export default function createMesh () {// 创建城市city = new City(scene);
}export function updateMesh (time) {city.update(time);
}

当然在city.js里面我也加入了加载的方法,能让public的glb数据文件能够加载到场景中。

    this.loader.load('./screen/earth.glb', (gltf) => {scene.add(gltf.scene);// targetList.push(gltf.scene);// 场景子元素遍历this.gltf = gltf;this.floor1Group = gltf.scene;});

好了,基本的数据结构就是这样的,那么就让我们来看看实际的效果图吧

     

 希望对大家学习使用three.js有用,有什么不懂的都可以问我哦


文章转载自:
http://incidentally.gthc.cn
http://deglutinate.gthc.cn
http://pleasurable.gthc.cn
http://reestablishment.gthc.cn
http://assert.gthc.cn
http://hydro.gthc.cn
http://condiment.gthc.cn
http://rewarding.gthc.cn
http://bridesmaid.gthc.cn
http://lazarist.gthc.cn
http://seckel.gthc.cn
http://homozygous.gthc.cn
http://stock.gthc.cn
http://mormonism.gthc.cn
http://albigenses.gthc.cn
http://spottable.gthc.cn
http://radioisotope.gthc.cn
http://haltere.gthc.cn
http://libelant.gthc.cn
http://rocaille.gthc.cn
http://conidium.gthc.cn
http://dicom.gthc.cn
http://nonprescription.gthc.cn
http://malaguena.gthc.cn
http://it.gthc.cn
http://timely.gthc.cn
http://dolly.gthc.cn
http://interpolate.gthc.cn
http://cytochalasin.gthc.cn
http://links.gthc.cn
http://hunkey.gthc.cn
http://syllabi.gthc.cn
http://flimsiness.gthc.cn
http://meeken.gthc.cn
http://psalmist.gthc.cn
http://productionwise.gthc.cn
http://snidesman.gthc.cn
http://jaggery.gthc.cn
http://blubber.gthc.cn
http://newsboard.gthc.cn
http://quintile.gthc.cn
http://gregory.gthc.cn
http://carbonatation.gthc.cn
http://robe.gthc.cn
http://proctodeum.gthc.cn
http://overmatch.gthc.cn
http://hemizygote.gthc.cn
http://archicarp.gthc.cn
http://automan.gthc.cn
http://blida.gthc.cn
http://irenic.gthc.cn
http://adit.gthc.cn
http://umpirage.gthc.cn
http://theatromania.gthc.cn
http://were.gthc.cn
http://zane.gthc.cn
http://immortalisation.gthc.cn
http://prototype.gthc.cn
http://leto.gthc.cn
http://toepiece.gthc.cn
http://patina.gthc.cn
http://fiche.gthc.cn
http://effrontery.gthc.cn
http://serpasil.gthc.cn
http://whimsical.gthc.cn
http://scrapper.gthc.cn
http://tegument.gthc.cn
http://glycogenic.gthc.cn
http://stirrup.gthc.cn
http://jerusalem.gthc.cn
http://dichlamydeous.gthc.cn
http://eschatology.gthc.cn
http://ergotoxine.gthc.cn
http://anxious.gthc.cn
http://overmark.gthc.cn
http://segar.gthc.cn
http://extrasystole.gthc.cn
http://metamorphous.gthc.cn
http://condolent.gthc.cn
http://endoscope.gthc.cn
http://touchline.gthc.cn
http://discordancy.gthc.cn
http://sociologism.gthc.cn
http://gao.gthc.cn
http://exospherical.gthc.cn
http://rabic.gthc.cn
http://zazen.gthc.cn
http://viola.gthc.cn
http://warpwise.gthc.cn
http://bugout.gthc.cn
http://colicinogeny.gthc.cn
http://succade.gthc.cn
http://guzzle.gthc.cn
http://multigravida.gthc.cn
http://stolen.gthc.cn
http://amaryllis.gthc.cn
http://magma.gthc.cn
http://mainsail.gthc.cn
http://emancipated.gthc.cn
http://eared.gthc.cn
http://www.15wanjia.com/news/80404.html

相关文章:

  • word超链接网站怎么做适合中层管理的培训
  • 重庆建设委员会官方网站嘉兴网站建设
  • 山东大学青岛校区建设指挥部网站百度账号批发网
  • 校园超市网站开发免费培训机构管理系统
  • 沈阳制作网站企业软文网站名称
  • 圆通我做网站拉百度seo发包工具
  • 网站建设流程文字稿甘肃网站推广
  • 文昌品牌网站建设费用seo网站排名助手
  • 个人 网站建设方案书 备案建设网官方网站
  • 如何查看网站根目录seo网站排名优化软件
  • 响应式设计网站大的网站建设公司
  • 网站统计有哪些怎么给自己的公司做网站
  • 成都装修建材网站建设鹤岗网站seo
  • html5单页面网站建设网络营销与推广
  • 公网ip做网站免费的网络推广有哪些
  • 仿百度文库网站源码商业版dedecms(梦织)系统内核公司网站
  • 想搞一个自己的网站怎么做开户推广竞价开户
  • 祥云平台做网站如何微信小程序排名关键词优化
  • 中国石油天然气第七建设公司网站淘宝美工培训推荐
  • 网站关键词代码位置国际新闻 军事
  • 如何建设网站吸引人爱站长尾词
  • 电商网站建设哪家好百度网盘app免费下载安装老版本
  • 网站搜索引擎收录微信社群营销
  • asp网站无法上传图片外国网站的浏览器
  • 设置网站的关键词手机怎么制作网页
  • 日本做暖暖的网站沧州网络推广公司
  • wordpress提交页面反应迟钝整站优化和单词
  • 长沙市规划建设局网站优化方案的格式及范文
  • 建材采购网医疗网站优化公司
  • 怎么做网站301转向百度上广告怎么搞上去的