I have a group of objects based out of a BoxGeometry (the speaker) and a ConeGeometry ( the propagation of the sound).
Appart from the fact I’m having problems rotating/translating the cone to be at the center and perpendicular to the speaker I would like to know how I could rotate all groups that are dispersed onto a convex hull to point to [0,0,0]. I’ve tried lookAt but it didn’t worked ( maybe It comes from the rotation/translation)
To describe a bit more, the sound propagation which is front of the speaker (from the top to bottom of the cone) should have the bottom pointing to [0,0,0]
Any help is greatly appreciated
(This is what I’ve done so far)
put it in a fiddle homie.
1 Like
@manthrax Thank you for your answer I’ll try that tomorrow.
https://verbose-jasper-engine.glitch.me
let plane = new THREE.Mesh(
new THREE.PlaneGeometry(),
new THREE.MeshBasicMaterial({ wireframe: true })
);
let sphere = new THREE.Mesh(
new THREE.SphereGeometry(),
new THREE.MeshBasicMaterial({ wireframe: true })
);
for (let i = 0; i < 10; i++) {
let cone = new THREE.Mesh(
new THREE.CylinderGeometry(0.5, 0.001),
new THREE.MeshStandardMaterial({ wireframe: false })
);
cone.geometry.translate(0, -0.5, 0);
cone.geometry.scale(0.5, 0.5, 0.5);
cone.geometry.rotateX(Math.PI * 0.5);
cone.position.randomDirection();
cone.lookAt(sphere.position);
scene.add(cone);
}
scene.add(plane, sphere);
3 Likes
@manthrax again thanks for your time. First I was thinking rotateX was in degree.
Also for some unknown reason I was able to reproduce the desired effet by doing
cone.rotateX( - Math.PI * 0.5 );
great help
1 Like