tizzle/aframe-sprite-component

Is it possible to change the sprite's rotation point?

Closed this issue · 3 comments

Question / Feature Request

Right now, the rotation point of the sprites seems to be right at their center (horizontal and vertical). Is it possible to have it at the mid point of their base?

I am dealing with sprites of people. The way they face the camera in left/right movement is just fine, but when the camera moves up/down, it looks like the people are spinning in the air.

this component simply wraps THREE.SpriteMaterial, which doesn't seem to have that feature.

Easy fix would be to make the height 2x the size, paste the image on the top half and leave the bottom half transparent. You might need to enable some of the options here to fix transparency issues: #6

If you need further help, it would be super helpful if you can create an example on codepen/glitch/etc to describe the issue. Otherwise I currently don't have capacity to look into the issue.

Thank you for trying to help. I have no trouble with transparency. But I did try the fix you proposed, and still don't get satisfying results. You can check it out here. The man in the center is part of the a-sky picture, and has the expected behavior, while moving the camera around. The man on the right is a default sprite, set up accordingly to the instalation guide. With the man on the left, I tried your fix.

@GoldenPunk In that case, I'm not sure if this component is what you are looking for, because the sprites you set up are behaving as expected (in terms of how THREE.SpriteMaterial is designed).

You probably need to make your own component that monitors the angle between the plane's normal and the camera's lookAt direction, and rotates the plane according to your desired behavior. But unfortunately this is beyond what we can help (if I'm wrong feel free to reopen the issue)