我需要使用颜色突出显示交点并将其投影到平面上。表面与平面(threejs)相交并将其投影到平面XoY(3D)上
EllipticParaboloid:
const init = (a, b) => {
return (u, v) => {
const height = 100;
const size = 5;
u = u * height;
v = 2 * v * Math.PI;
const x = a * size * Math.sqrt(u) * Math.cos(v);
const y = u;
const z = b * size * Math.sqrt(u) * Math.sin(v);
return new Three.Vector3(x, y, z);
}
}
const ellipticParaboloid = (a, b) => {
const geom = new Three.ParametricGeometry(init(a, b), 25, 25);
const mat = new Three.MeshPhongMaterial({ color: 0xcc3333a, wireframe: true });
const mesh = new Three.Mesh(geom, mat);
return mesh;
}
飞机:
const init = (c) => {
return (u, v) => {
const height = 300;
const size = 1;
u = u * height;
v = v * height;
const x = size * u - height/2;
const y = c;
const z = size * v - height/2;
return new Three.Vector3(x, y, z);
}
}
const levelSurface = (c) => {
const geom = new Three.ParametricGeometry(init(c), 25, 25);
const mat = new Three.MeshPhongMaterial({ color: 0x00ff0000, wireframe: true });
const mesh = new Three.Mesh(geom, mat);
return mesh;
}
也许路口的一些公式我能得到什么? 它看起来像这样:http://joxi.ru/L21GRWau5vKzrX 但我需要投射在平面XOY此交汇:http://joxi.ru/RmzozYwcq7aK2O
我可怎么办呢?也许一些例子(这对我来说很好)或者一些材料
我可以制作此项目的功能梯度吗? https://en.wikipedia.org/wiki/Gradient。两个变量的函数,如z = 2x^2 + 3y^2。 – Daxik
现在,我们只是得到投影的轮廓,你需要通过轮廓制作一张单一的脸,然后,将纹理贴到脸上,也许你需要写一个着色器,但是,我不知道如何写一个着色器。 –