Search the Community
Showing results for tags 'direction to rotation'.
Found 1 result
Hi gang! I'm still having problems "aiming" mesh in some direction (vector). I know, I know, I should have this mastered and memorized, but, not yet. https://www.babylonjs-playground.com/#BFM7EX#24 I have TWO cones that need to be set per the direction of a spotlight. #1. The green cone (arrow1) needs its POINT aimed the same direction as the spotlight. (-1, -1, -1) #2. The curiously black-sided blue cone (spotcone) needs its WIDE-END... aimed in same direction as spotlight. I added the spotlight so I could "see" a -1, -1, -1 direction... and I know spotlights do direction correctly. I could "steal" example code from spotlight direction-setting code, but that direction-setting code... rotates no mesh. It only creates light directions, and lights aren't mesh. The spotlight is positioned where the two cones meet. And again, the spot is aimed -1, -1, -1, and it appears to be using that direction properly. Feel free to turn-off animation in lines 101-102. They are there only to prove that I have my pivot points set correctly for the two types of cones. There are two un-coded important functions. Lines 73-75 to set arrow1 aiming, and lines 80-82 to set spotcone aiming. Lines 95 and 96 are where both do-nothing functions are called-from. Can someone please assist me in coding arrow.setDirection(direction) [line 73] and spotcone.setDirection(direction) [line 80] ? That would be great. Currently, cam is aiming +z. We already knew that, because the -1, -1, -1 spotlight direction... is down, left, and backwards toward the cam. Thanks again for any/all assistance/consideration.