vasturiano / 3d-force-graph

3D force-directed graph component using ThreeJS/WebGL
https://vasturiano.github.io/3d-force-graph/example/large-graph/
MIT License
4.8k stars 831 forks source link

3d group demo #271

Open cmdares opened 4 years ago

cmdares commented 4 years ago

ref:https://js.cytoscape.org/demos/compound-nodes/ In complex network, node grouping is an important analysis method. How to implement with 3d? Box as a cube. When dragging the node over there, the cube needs to detect collision and expand dynamically.

Sent with GitHawk

vasturiano commented 4 years ago

@cmdares you can use nodeThreeObject and linkThreeObject to change the shape of your nodes and links. So you can make them visually look like cubes or any other 3D object you're interested on.

As for the collisions, there is a bounding box collision force: https://github.com/emeeks/d3-bboxCollide , but that only works in 2D. That d3-force plugin would have to be converted to the 3D domain before it can be used with 3d-force-graph.

Alexithemia commented 4 years ago

@vasturiano Didn't you do something with collision in your example? https://vasturiano.github.io/3d-force-graph/example/collision-detection/ https://github.com/vasturiano/3d-force-graph/blob/master/example/collision-detection/index.html

vasturiano commented 4 years ago

@Alexithemia yes, but that's collision between spheres and against fixed straight planes. Collision between cuboids requires a dedicated logic, and to my knowledge there is no existing available d3-force-3d plugin. It would require a 3D version of the above mentioned d3-bboxCollide.

4nmolChaudhary commented 2 years ago

@vasturiano can we use Blender model (.glb,gltf) as node ?