我需要使用顏色突出顯示交點並將其投影到平面上。表面與平面(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
現在,我們只是得到投影的輪廓,你需要通過輪廓製作一張單一的臉,然後,將紋理貼到臉上,也許你需要寫一個着色器,但是,我不知道如何寫一個着色器。 –