【问题标题】:How to add vertex or point geometry in webgl scene using three.js?如何使用three.js在webgl场景中添加顶点或点几何?
【发布时间】:2013-09-24 23:37:45
【问题描述】:

我是 webgl 和 three.js 的新手,所以对它了解不多。 谁能告诉我如何使用 three.js 在 webgl 场景中添加顶点或点几何?

【问题讨论】:

标签: three.js


【解决方案1】:

这是从头开始创建三角形几何图形的代码。

var geo = new THREE.Geometry();
geo.vertices.push( new THREE.Vector3(100,   0,   0) );
geo.vertices.push( new THREE.Vector3(  0, 100,   0) );
geo.vertices.push( new THREE.Vector3(  0,   0, 100) );
geo.faces.push( new THREE.Face3(0,1,2) );
geo.computeFaceNormals();
geo.computeVertexNormals();

希望这会有所帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-03
    • 1970-01-01
    • 2017-05-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-11
    • 2012-11-01
    相关资源
    最近更新 更多