首页 新闻 搜索 专区 学院

js 利用三维坐标数组转绘制3D不规则图形

0
悬赏园豆:100 [已解决问题] 解决于 2020-03-05 16:22

数组 [[162,81,10],[162,704,10],[773,704,20],[773,145,20]]
求个demo ()

予以暖杀风的主页 予以暖杀风 | 初学一级 | 园豆:116
提问于:2018-08-06 15:50
< >
分享
最佳答案
0
收获园豆:100
ycyzharry | 高人七级 |园豆:22051 | 2018-08-06 16:15
其他回答(2)
0

用Three.js画?

MrNice | 园豆:3023 (老鸟四级) | 2018-08-06 15:51

可以,有demo么

支持(0) 反对(0) 予以暖杀风 | 园豆:116 (初学一级) | 2018-08-06 15:52
0
 1 // 初始化几何形状
 2 var geometry = new THREE.Geometry();
 3 //
 4 geometry.vertices.push(new THREE.Vector3(-1, 2, -1));
 5 geometry.vertices.push(new THREE.Vector3(1, 2, -1));
 6 geometry.vertices.push(new THREE.Vector3(1, 2, 1));
 7 geometry.vertices.push(new THREE.Vector3(-1, 2, 1));
 8 //
 9 geometry.faces.push(new THREE.Face4(0, 1, 2, 3));
10  var material = new THREE.MeshBasicMaterial({
11                 color: 0xffff00,
12                 wireframe: true
13 
14             });
15 
16             var mesh = new THREE.Mesh(geometry, material);
17             mesh.drawMode = THREE.TrianglesDrawMode; //default
18 
19             scene.add(mesh);
20             renderer.render(scene, camera);
予以暖杀风 | 园豆:116 (初学一级) | 2018-08-08 17:13
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册