简体   繁体   English

空间中的圆轮廓(threejs)(3D)

[英]Circle contour in space (threejs) (3D)

How to delete this line in this fugure http://joxi.ru/gmvl7YwT7Eg3Aa ? 如何在此fugure http://joxi.ru/gmvl7YwT7Eg3Aa中删除此行? I need only contour 我只需要轮廓

const intersection = (a, b, c, heightC) => {
    return (u, v) => {
        const height = heightC || c;
        const size = 5;

        u = u * height;
        v = 2 * v * Math.PI;

        const x = a * size * Math.sqrt(u) * Math.cos(v);
        const y = c;
        const z = b * size * Math.sqrt(u) * Math.sin(v);

        return new Three.Vector3(x, y, z);
    }
}

export const projectionIntersection = (a, b, heightC) => {
    const geom = new Three.ParametricGeometry(intersection(a, b, 1, heightC), 1, 25);
    const math = new Three.MeshPhongMaterial({ color: 0x00FF00, wireframe: true });
    const mesh = new Three.Mesh(geom, math);

    return mesh;
}

Who can help me? 谁能帮我?

parametric geometry as a mesh will create faces, which means creating linkages between the center and each point along the edge. 作为网格的参数化几何将创建面,这意味着在中心和沿边缘的每个点之间创建链接。 If you want just a line strip to draw a circle, take a look at Line Object . 如果只想用一条线画一个圆,请看一下Line Object It looks like you can do what you're doing already, just pushing the Vector3 you create to the vertices of geometry and making a Line out of it. 看起来您可以完成已经做的事情,只需将创建的Vector3推到几何图形的顶点,然后在其中绘制一条直线即可。

Cheap and rough solution with a circle: 便宜又粗糙的解决方案:

var circleGeom = new THREE.CircleGeometry(1, 32);
circleGeom.vertices.shift();
circleGeom.vertices.push(circleGeom.vertices[0].clone());
var circle = new THREE.Line(circleGeom, new THREE.LineBasicMaterial({color: "yellow"}));

jsfiddle example r85 jsfiddle示例r85

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM