vasturiano / 3d-force-graph-vr

3D force-directed graph component in VR
https://vasturiano.github.io/3d-force-graph-vr/example/large-graph/
MIT License
214 stars 51 forks source link

"Raycaster.camera" needs to be set in order to raycast against sprites. #21

Closed kylekanouse closed 2 years ago

kylekanouse commented 3 years ago

Describe the bug Web example using images for nodes is broken and does not render properly

console error message:

Raycaster.camera" needs to be set in order to raycast against sprites.

aslo

Uncaught TypeError: Cannot read property 'matrixWorld' of null
    at kl.raycast (3d-force-graph-vr:2)
    at up (3d-force-graph-vr:2)
    at up (3d-force-graph-vr:2)
    at lp.intersectObjects (3d-force-graph-vr:2)
    at n.checkIntersections (3d-force-graph-vr:83)
    at n.tock (3d-force-graph-vr:83)
    at HTMLElement.value (3d-force-graph-vr:83)
    at t.object3D.onAfterRender (3d-force-graph-vr:83)
    at dl.render (3d-force-graph-vr:2)
    at HTMLElement.value (3d-force-graph-vr:83)

To Reproduce Steps to reproduce the behavior:

  1. Go to https://vasturiano.github.io/3d-force-graph-vr/example/img-nodes/

I am also able to reproduce in a local environment

Expected behavior Should render graph with image icons for nodes as exampled here

Desktop (please complete the following information):

Thank you as I really appreciate this project.

ghost commented 2 years ago

Any hope of getting this fixed? I found that using an older version which i had magickally saved works. I love your work btw!

antonkulaga commented 2 years ago

Looks like it is the same bug as I reported https://github.com/vasturiano/three-spritetext/issues/31 @vasturiano can you take a look at this? It breakes a lot of projects :(

From What I understand the problem is integration of laser raycaster controls that came instead of cursor

antonkulaga commented 2 years ago

I checked when regression appeared, the last version that works properly is 1.35.6

vasturiano commented 2 years ago

The cause of the issue is that Aframe has trouble raycasting against Sprite type objects.

I've made a patch to this module that disables raycasting unless any of the interaction props are set (node/link click/hover methods). This will allow you to get around this issue, by not setting any click/hover interaction when using sprites for nodes.

Please use the latest published version: 2.0.7.