Ray casting code seems wrong

So my raycasting code seems wrong…
I copy and pasted the code from Three Js website and it yes…works when turning color to red…
I tried to add a function so when you clicked on the box…it would take you to another website…what would I do to make that work?

Set an onPointerDown method with tan event listener, check for any intersection, like you did when setting the color to red. If there is an intersection call window.open(myLink)

Here is a demo:

Wow! Thanks so much… I’m used to figuring it out on my own.

1 Like