Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
Display waypoints on cubemap knowing positions relative to a cube face using three.js, aframe

I created a 360 viewer using a cubemap with boxgeomtery and an array of meshbasicmaterial for cubefaces. Now I am trying to display some waypoints on back face of the cube knowing position relative to that face. How can I do that? I tried to simulate a raycast to that texture and discover the world position in order to add an a-entity element for that waypoint at the correct-position, but that didn't work.

const mouse = new AFRAME.THREE.Vector2();
mouse.x = 2115.66113;
mouse.y = 1701.97974; // coordinates of waypoint on back face

const ray = new AFRAME.THREE.Raycaster();
const camera = document.getElementById('cam').object3D.children[2]; // retrieve camera from aframe
ray.setFromCamera(mouse, camera);

// calculate objects intersecting the picking ray
const  b = document.getElementById('imag360').object3D.children[0].material[5] // back face of cube
const intersects = ray.intersectObjects(b);
if (intersects.length > 0) {
     console.log(intersects);
}

Another solution was to use a canvas as texture for back face and draw at that position an image of the waypoint, but using this solution I can not add hover or click listeners for the waypoint in order to teleport the user to the linked scene.

const canvas = document.createElement("canvas");
canvas.width = 4096;
canvas.height = 4096;
let context = canvas.getContext("2d");
const img = new Image();
img.src = "/assets/images/ring.svg";
img.onload = () => {
    context.drawImage(img, 2115.66113, 4096 - 1701.97974, 130, 130);
    const texture = new AFRAME.THREE.Texture(canvas);
}

Any help for any of this solution would help. Thank you

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!