Hello, I’m learning three.js and I’m playing with an effect where, when a word is clicked, a splash of emoji would appear on the screen starting from the word clicked.
I’ve got my canva as desired and my emojis, but I can’t get the starting position of my emojis right. They always seem to be in the middle of the canva, no matter what value I give them in emojiMesh.position.set();
Ideally, I want to position the start at the center (y) of the clicked element and bottom to the canva for x.
Well thats because your canvas isn’t centered. Change your code with this code, if you set a color to your renderer using .setClearColor() you’ll notice that your canvas is way up from the center.
You’ll notice that the canvas bg color will change making the canvas visible.
All you have to do is just center the canvas using .css. In other words you need the three magic words, I am not the .css guy but will let you know if I got it working
Yes this is because I want to start the “fountain” from the square (2) not the circle (1). For the other button I need it in the middle of the button too and so on.
Like so, I put my class and emoji param on any text or div and the fountain start always on his middle. Like my beautiful drawing haha ^^