brianpeiris / RiftSketch

A virtual reality live-coding environment based on WebXR
https://brianpeiris.github.io/RiftSketch
MIT License
888 stars 100 forks source link

Preserve scene state when editing #42

Open anthonye2007 opened 9 years ago

anthonye2007 commented 9 years ago

Say I have a ball that starts behind the camera and moves in a circle around the camera. If I update the size of the ball in the code, the ball will get bigger but will also reset to its initial position.

I want to change the size of the ball as it passes in front of me without it having to reset.

brianpeiris commented 9 years ago

Ideally, it would be implemented something like the Khan Academy editor: http://youtu.be/2sEvlJKAuos?t=15m49s

But that might be overkill for an experiment. If your experiment is simple or scripted enough, you might be able to get away with persisting the objects in the scene and modifying their state instead of clearing them out (https://github.com/brianpeiris/RiftSketch/blob/13652ed3424f26b261bc06521afe5a44d1ba99c1/js/RiftSandbox.js#L116-L121)