G
G
Gleb2020-05-26 16:22:04
WebGL
Gleb, 2020-05-26 16:22:04

How to draw a 3D webgl and three.js surface?

Tried to draw such a figure ( https://en.wikipedia.org/wiki/Monkey_saddle ) using THREE.ParametricGeometry() with transition to polar coordinates and without success, black screen.
those. asked

monkeySaddle = function (u, v) {
            var r = 50;

            var x = Math.cos(u) * r;
            var y = Math.sin(u) * r;
            var z = x**3 - 3*x*y**2;

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

        var mesh = createMesh(new THREE.ParametricGeometry(monkeySaddle, 120, 120, false));
        scene.add(mesh);

I read Dirkens "Three.js" and did not find an answer for myself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RAX7, 2020-05-26
@shevzoom

It is not clear why polar coordinates are used, it is possible without them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question