Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove look-at without resetting rotation #181

Open
llanginger opened this issue Aug 7, 2018 · 2 comments
Open

Remove look-at without resetting rotation #181

llanginger opened this issue Aug 7, 2018 · 2 comments

Comments

@llanginger
Copy link

Hi there,

I'm using look-at to on my camera to track an element moving through my scene and I'm trying to figure out how (or if it is possible at all) to programmatically remove the look-at component at a given point in time (once the element has left the scene, for instance)

el.removeAttribute("look-at") causes the camera to snap back to rotation="0 0 0".
I've tried el.setAttribute("look-at", "") which does not appear to break the "connection" between the camera and the element.

Any help would be appreciated!

@ngokevin
Copy link
Collaborator

ngokevin commented Aug 7, 2018

You could store the rotation right before you remove it, and then set it? We could also set it to not snap back on removal if that makes more sense...

@llanginger
Copy link
Author

Thanks so much for responding so fast!

I think the ability to set to not snap back would be a great feature, I can see the use case for both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants