当前位置:网站首页>Three. Based on ply format point cloud voxel model JS upload interface writing
Three. Based on ply format point cloud voxel model JS upload interface writing
2022-04-23 20:21:00 【Install a sound 77】
I checked the relevant materials and found the content of voxels , May be studied more thoroughly , The relevant documents are too few to find .
With a point cloud PLY File as an example ,ply You can save some clouds and his patches , It can also be used to preserve voxels .
But in three.js in Although it comes with one PLYloader As shown in the figure below :
But this PLYloader Load only Faceted ply file , For voxelized ply The file can read relevant information , But it can't be displayed in the browser . The reason is that voxels ply And dough ply The data form of is a little different .
Let's open two different ply File comparison ( Be careful ,ply The document needs to be binary Binary to ascii Format , Otherwise, it can't be used txt open )
On the left is voxelized ply file , Relatively normal in the back Ply A few parameters are missing, and the connection information of the patch is useless .( Open this and see for yourself )
Point out Voxel model focuses on that 6 In figures The first three digits represent XYZ, The last three digits represent 255 Of RGB.
Now there are coordinates and colors In fact, voxels can be generated , Of course, we need to generate in the browser .
const file_loader = new THREE.FileLoader();
file_loader.load("LOOK.ply",function (data){
ply_data.file_data =data
ply_data.point_list = ply_data.file_data.split('end_header\n')[1].split("\n")
//console.log(ply_data.point_list)
let positons = []
let colors= []
let num;
num = ply_data.point_list[1]
// in the light of ply_data.point_list Data cleansing
ply_data.point_list.length -= 1;
// Delete two items
ply_data.point_list.shift();
ply_data.point_list.shift();
for (let point_str of ply_data.point_list){
//console.log(point_str)
let str_list = point_str.split(" ")
positons.push(str_list[0],str_list[1],str_list[2])
colors.push(str_list[3]/255,str_list[4]/255,str_list[5]/255)
// Make a rectangle
var material2 = new THREE.MeshBasicMaterial( );
var cubeGeometry2 = new THREE.BoxGeometry(1,1,1);
var cube =new THREE.Mesh(cubeGeometry2, material2)
cube.position.x =str_list[0]
cube.position.y =str_list[1]
cube.position.z =str_list[2]
cube.material.color.r=str_list[3]/255
cube.material.color.g=str_list[4]/255
cube.material.color.b=str_list[5]/255
scene.add(cube)
}
So with three.js Write an interface , The principle is right txt File segmentation , Find the content of each paragraph , The rectangle is generated by itself , I used it here mesh Generate , Can't find setAttribute This method of , I think PCDloader This method is used to load point clouds in batch , But in the mesh I didn't find it in the cube ... So loop generated , It should affect the speed of loading .
The result of the last load :
Disadvantages of voxel model , Because the browser load is too stretched , Without optimization Can't generate too many small squares ( Optimization estimation is also important ), Otherwise, it's easy to get stuck , This is also three.js The reason why voxels are not used very much in .
版权声明
本文为[Install a sound 77]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210551491079.html
边栏推荐
- 使用 WPAD/PAC 和 JScript在win11中进行远程代码执行1
- 16MySQL之DCL 中 COMMIT和ROllBACK
- nc基础用法3
- AQS learning
- 使用 WPAD/PAC 和 JScript在win11中进行远程代码执行
- SIGIR'22 "Microsoft" CTR estimation: using context information to promote feature representation learning
- Some basic configurations in interlij idea
- STM32 Basics
- SQL Server Connectors By Thread Pool | DTSQLServerTP 插件使用说明
- Wave field Dao new species end up, how does usdd break the situation and stabilize the currency market?
猜你喜欢
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
JDBC tool class jdbcfiledateutil uploads files and date format conversion, including the latest, simplest and easiest way to upload single files and multiple files
Livego + ffmpeg + RTMP + flvjs to realize live video
Don't bother tensorflow learning notes (10-12) -- Constructing a simple neural network and its visualization
SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
ArcGIS JS version military landmark drawing (dovetail arrow, pincer arrow, assembly area) fan and other custom graphics
Sqoop imports tinyint type fields to boolean type
CVPR 2022 | QueryDet:使用级联稀疏query加速高分辨率下的小目标检测
Handwritten Google's first generation distributed computing framework MapReduce
随机推荐
R language uses econocrats package to create microeconomic or macroeconomic map, visualize indifference function indifference curve, customize calculation intersection, and customize the parameters of
After route link navigation, the sub page does not display the navigation style problem
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
Browser - learning notes
CVPR 2022 | QueryDet:使用级联稀疏query加速高分辨率下的小目标检测
DTMF dual tone multi frequency signal simulation demonstration system
NC basic usage 1
Commit and rollback in DCL of 16 MySQL
Change the material of unity model as a whole
Rédaction de thèses 19: différences entre les thèses de conférence et les thèses périodiques
go-zero框架数据库方面避坑指南
Azkaban recompile, solve: could not connect to SMTP host: SMTP 163.com, port: 465 [January 10, 2022]
NC basic usage 3
[graph theory brush question-4] force deduction 778 Swimming in a rising pool
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
nc基础用法1
16MySQL之DCL 中 COMMIT和ROllBACK
AQS learning
NC basic usage 4
SQL Server connectors by thread pool 𞓜 instructions for dtsqlservertp plug-in