如何在Threejs Geometry中添加拖动选项?

时间:2018-12-24 09:25:13

标签: javascript pythreejs

我将ejs几何图形用于3d-force-graph进行节点样式设置,因此问题是我无法拖动该节点。所以请告诉我任何人如何在此处添加拖动选项。

.nodeThreeObject(({{type})=> {

        var pictureMaterial = new THREE.MeshBasicMaterial({
            map: THREE.ImageUtils.loadTexture('../images/planets/land_ocean_ice_cloud_2048.jpg');
        });

        var colorMaterial = new THREE.MeshBasicMaterial({
            transparent: true,
            opacity: 0.75 ,
            color: colors[type]
        });

        var GlobeMaterial = [
        pictureMaterial, // Left side
        colorMaterial, // Right side
        colorMaterial, // Top side   ---> THIS IS THE FRONT
        colorMaterial, // Bottom side --> THIS IS THE BACK
        pictureMaterial, // Front side
        colorMaterial  // Back side
        ];
        var Globegeometry = new THREE.SphereGeometry(30,20,20);

        var GlobegeometryShape = new THREE.Mesh(Globegeometry, GlobeMaterial);

        var scene = new THREE.Scene();

        var sprite = new SpriteText('?');
        sprite.color = colors[1];
        sprite.textHeight = 50;
        sprite.position.set(0,50,0);

        scene.add(GlobegeometryShape);
        scene.add(sprite);


        return scene;
    }

在没有场景的情况下,我可以拖动该节点,但是每当在此处添加场景时,都会禁用拖动选项。所以请告诉我,有人,如何在此处添加拖动选项。

0 个答案:

没有答案