As I embark on my coding journey and delve into three.js, I've been eager to create interactive geometries. After some searching, I stumbled upon a code snippet (the links don't open in the snippet for some reason):
var container, stats;
var camera, scene, projector, renderer;
var particleMaterial;
var objects = [];
init();
animate();
... // Code continues here
Feeling adventurous, I decided to make things more challenging by creating an interactive demo using particles instead of cubes. Inspired by a Three.js demo, I began exploring:
var mouseX = 0, mouseY = 0,
windowHalfX = window.innerWidth / 2,
windowHalfY = window.innerHeight / 2,
SEPARATION = 200,
AMOUNTX = 10,
AMOUNTY = 10,
camera, scene, renderer;
init();
animate();
... // Code continues here
My next experiment involved making each spherical vertice clickable, leading to different URLs. Despite a week of effort, I can't seem to crack it:
var container;
var camera, scene, renderer;
var raycaster;
var mouse;
var PI2 = Math.PI * 2;
var programStroke = function (context) {
...
Although the results are not exactly what I envisioned, at least I have clickable particles now. But how do I assign multiple random links to these particles upon click?
I came across an example in the Three.js library , but it's not quite what I need. I tried modifying elements to be clickable with no success.
Any suggestions or insights would be greatly appreciated!
Thank you