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

3D shape properties are not updated #104

Open
ceruulean opened this issue Dec 7, 2020 · 3 comments
Open

3D shape properties are not updated #104

ceruulean opened this issue Dec 7, 2020 · 3 comments

Comments

@ceruulean
Copy link

Bug: If you set the 'backface' or 'length' properties of a Cylinder after render, it will not update. Same with Box object. I suspect the other derived shapes may have some issues (hemisphere's backface updates correctly, but changing diameter will not recalculate the backface area)

Test case: https://codepen.io/ceruulean/pen/xxEVeyY

@sebinsuresh
Copy link

I haven't delved into the source code, but I kind of got around this issue by setting the "backface" property of the .children[0].children[1] of the cylinder shape element.

The backface of the cylinder seems to be stored as a separate shape, as a grand-child of the cylinder shape itself.

@desandro
Copy link
Member

Thanks for reporting this issue. Yeah, this is an issue — there's no straight-forward way to update interior shapes of composite shapes like Cylinder base. The closest thing is updatePath, but I'm not sure if that will work in this case.

@waruyama
Copy link

waruyama commented Nov 21, 2022

Old issue, but times have changed and this would be an ideal case for using the reactivity functionality from Vue 3. Vue is certainly a bit of an overkill, but that functionality is really cool. It wraps objects in proxies thus allowing you to get notified if anything in the object changes (=making them reactive), even nested deep below if you wish. On notification of the change you could then simply update the scene.

I am not sure if there is any package available that only provides the reactivity part of vue, but if you are using Vue anyway, this should work.

Edit: In other words,this does have to be part of zdog, but could be solved with an external library providing reactivity.

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

No branches or pull requests

4 participants