小编Prz*_*iec的帖子

Three.js - 3D 空间中的 2D 对象(由 Vertices)

我有个问题:

我有一组 3D 点。如何在 3D 空间中绘制由顶点给出的 2D 平面对象?我想从 Points[0] 到 Points[1],从 Points[1] 到 Points[2] 等等画线......现在我有以下解决方案:

var geometry = new THREE.BufferGeometry();

var vertices = faceToTriangles( VerticesArray );  // my function

var uvs = new Float32Array([
    0.0, 0.0,
    1.0, 0.0,
    1.0, 1.0,

    0.0, 0.0,
    1.0, 1.0,
    0.0, 1.0
]);


geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
var material = new THREE.MeshLambertMaterial( {color: 'red' } );
material.side = THREE.DoubleSide;
var mesh = new THREE.Mesh( …
Run Code Online (Sandbox Code Playgroud)

3d geometry 2d three.js

1
推荐指数
1
解决办法
1812
查看次数

标签 统计

2d ×1

3d ×1

geometry ×1

three.js ×1