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

Html网页threejs显示obj,ply三维图像实例

程序示例精选
Html网页threejs显示obj,ply三维图像实例
如需安装运行环境或远程调试,见文章底部个人QQ名片,由专业技术人员远程协助!

前言

这篇博客针对《Html网页threejs显示obj,ply三维图像实例》编写代码,代码整洁,规则,易读。 学习与应用推荐首选。


运行结果

在这里插入图片描述


文章目录

一、所需工具软件
二、使用步骤
       1. 主要代码
       2. 运行结果
三、在线协助

一、所需工具软件

       1. VS2019, Qt
       2. C++

二、使用步骤

代码如下(示例):

<!DOCTYPE html>
<html lang="en"><head><title>three.js webgl - loaders - OBJ MTL loader</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"><style>body {font-family: Monospace;background-color: #000;color: #fff;margin: 0px;overflow: hidden;}#info {color: #fff;position: absolute;top: 10px;width: 100%;text-align: center;z-index: 100;display:block;}#info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }</style></head><body><div id="info"><a href="http://threejs.org" target="_blank">three.js</a> - OBJMTLLoader test</div><script src="js/three.min.js"></script><script src="js/MTLLoader.js"></script><script src="js/OBJMTLLoader.js"></script><script>var container, stats;var camera, scene, renderer;var mouseX = 0, mouseY = 0;init();animate();function init() {container = document.createElement( 'div' );document.body.appendChild( container );camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );camera.position.z = 1.5;                //̹��40// scenescene = new THREE.Scene();var ambien = new THREE.AmbientLight( 0x444444 );
THREE.DirectionalLight( 0xffeedd );directionalLight.position.set( 0, 0, 1 ).normalize();scene.add( directionalLight );// modelvar onProgress = function ( xhr ) {if ( xhr.lengthComputable ) {var percentComplete = xhr.loaded / xhr.total * 100;console.log( Math.round(percentComplete, 2) + '% downloaded' );}};var onError = function ( xhr ) {};var loader = new THREE.OBJMTLLoader();loader.load('js/LQ.obj', 'js/LQ.mtl', function (object) {object.position.y = -0.4;                //   0 ̹��tank     -0.6  ����LQscene.add(object);var start = new Date().getTime(), delta;}, onProgress, onError );//function onWindowResize() {windowHalfX = window.innerWidth / 2;windowHalfY = window.innerHeight / 2;camera.aspect = window.innerWidth / window.innerHeight;camera.updateProjectionMatrix();renderer.setSize( window.innerWidth, window.innerHeight );}//function animate() {requestAnimationFrame( animate );render();}</script></body>
</html>
运行结果

在这里插入图片描述
在这里插入图片描述

三、在线协助:

如需安装运行环境或远程调试,见文章底部个人 QQ 名片,由专业技术人员远程协助!

1)远程安装运行环境,代码调试
2)Visual Studio, Qt, C++, Python编程语言入门指导
3)界面美化
4)软件制作
5)云服务器申请
6)网站制作

当前文章连接:https://blog.csdn.net/alicema1111/article/details/132666851
个人博客主页:https://blog.csdn.net/alicema1111?type=blog
博主所有文章点这里:https://blog.csdn.net/alicema1111?type=blog

博主推荐:
Python人脸识别考勤打卡系统:
https://blog.csdn.net/alicema1111/article/details/133434445
Python果树水果识别:https://blog.csdn.net/alicema1111/article/details/130862842
Python+Yolov8+Deepsort入口人流量统计:https://blog.csdn.net/alicema1111/article/details/130454430
Python+Qt人脸识别门禁管理系统:https://blog.csdn.net/alicema1111/article/details/130353433
Python+Qt指纹录入识别考勤系统:https://blog.csdn.net/alicema1111/article/details/129338432
Python Yolov5火焰烟雾识别源码分享:https://blog.csdn.net/alicema1111/article/details/128420453
Python+Yolov8路面桥梁墙体裂缝识别:https://blog.csdn.net/alicema1111/article/details/133434445

http://www.lryc.cn/news/247091.html

相关文章:

  • Windows平台下的oracle 11G-11.2.0.4补丁升级操作指南
  • MFC居中显示文字及其应用
  • 50-75GHz大功率六倍频源设计
  • Qt 软件调试(一) Log日志调试
  • docker network容器网络通信
  • CVE-2022-4886 ingress命令注入复现与分析
  • Oracle整体架构
  • webpack具体实现--未完
  • 【Git】修改提交信息(单次、批量)
  • Grafana Panel组件跳转、交互实现
  • 人工智能|机器学习——感知器算法原理与python实现
  • 【论文阅读笔记】Prompt-to-Prompt Image Editing with Cross-Attention Control
  • Echarts legend图例配置项 设置位置 显示隐藏
  • C#每天复习一个重要小知识day3:随机数的生成
  • Java后端使用XWPFDocument生成word文档,踩坑
  • asp.net core HttpContextAccessor类
  • 微服务--04--SpringCloudGateway 网关
  • Java程序连接 nacos集群
  • 【深度学习】参数优化和训练技巧
  • CeresPCL 曲线拟合之三次多项式
  • 小白备战蓝桥杯:Java基础语法
  • C#面向对象
  • 智能优化算法应用:基于蝙蝠算法无线传感器网络(WSN)覆盖优化 - 附代码
  • 【栈和队列(1)(逆波兰表达式)】
  • Blazor Table 实现获取当前选中行的功能
  • Flask Echarts 实现历史图形查询
  • 【漫谈】信创
  • linux wget --no-check-certificate
  • mysql命令行连接数据库
  • 计算机丢失vcomp140.dll是什么意思,如何解决与修复(附教程)