Comments (9)
Do you have a working example? I am not sure I understand what you want to do...
What I have in mind is that:
https://www.youtube.com/watch?v=PS4oMLPyYfI
But I am far from reproducing it with vue-babylonjs at the moment :/
from vue-babylonjs.
@Nodragem that YouTube example is not far off from what this library is already capable of. What does your build process look like? Are you using Webpack with vue-loader? Hot reload needs to be enabled on the webpack-dev-server for that to work. As for the editable properties in Vue devtools, I've never tried it, but this library doesn't use data in components and I don't know if props are editable or not.
@DigitTwin position binding is already reactive. If you bind to position on components that support transformations they will change xyz coordinates accordingly. Additionally as of beta.6
I expose all observables as listeners, so you may be able to use onAfterWorldMatrixUpdateObservable
which is exposed as @after-world-matrix-update$
on the component. See https://doc.babylonjs.com/api/classes/babylon.transformnode for details on that Observable.
from vue-babylonjs.
That's a good idea. I don't think I'll be able to jump into that right away since my goals are working on bugs, tests, and features at the moment, However, I'm happy to look at any pull requests for docs. I recently refactored the docs site code to be a bit friendlier to newcomers.
from vue-babylonjs.
@DigitTwin I am not sure the example you are giving would be very impressive as you can already do a slider that controls a 3D object without Vue.js ...
Here an example with dat.gui, but the slider could be made with Babylon.GUI too:
https://www.babylonjs-playground.com/#NGS9AU#1
A maybe better example of the power of Vue.js would be code hot swapping for game developers, such as here:
https://www.youtube.com/watch?v=PS4oMLPyYfI
That would totally impress game developers, as you could tweak your game without reloading the game!
from vue-babylonjs.
Speaking of reactivity, I tried the Vue dev-tool. They say that we can edit the properties of the objects in the Scene in real time with Chrome debugger. That sounds very great and is a step towards a code hot swapping as illustrated in the Youtube link I sent above.
However, I can't edit the values of the properties for some reason when I run the vue-babylonjs example here:
https://glitch.com/edit/#!/misty-dive?path=index.js:7:13
I was expecting to get editable fields in the vue dev-tool, as seen here:
vuejs/devtools#484
It seems that we still can edit the values using this method:
https://medium.com/fabricgroup/debugging-vuejs-in-chrome-console-d27ecbf3960c
But it is less elegant.
from vue-babylonjs.
from vue-babylonjs.
from vue-babylonjs.
@BrainBacon I had a look at the doc, and I am not exactly sure how the reactivity of vue.js translates in vue-babylonjs. As far as I understand, BabylonJs, being a game engine, is already reactive. For instance, you can link an object position to a slider in a two-way binding, each updating the other. What vue.js seems to add is that any game object data is watched by default and can be updated at runtime, through the debug console (or the vue.js devtool, that I can't get to work).
However, it seems that vue.js could only update game object data at runtime, and can't update game object logic. I believe that you could update the game object logic with HMR in webpack if your game object logic is in a separate file than the game loop. But I guess it would work also when using BabylonJS without vue-babylonjs.
Am I right? I have to admit that I am totally unsure whether what I am saying is correct.
from vue-babylonjs.
from vue-babylonjs.
Related Issues (20)
- can't load gtlf model HOT 3
- Two Issues with <camera>. It changes the colour of the object & props not working on <asset> by not having <camera>. HOT 2
- Hot Reload often breaks Animation HOT 1
- Loading multiple 3d models to the canvas and assign clickable events HOT 1
- GUI HOT 4
- Add a ready event for asset component / Compile error HOT 3
- PolygonMesh example
- OBJ files uploader HOT 1
- Rotating mesh around its local axis
- Cannot split scene into a separate component (ERR: too much recursion!)
- Cannot import library for testing HOT 1
- Documentation API needs more to be added HOT 1
- Does Not Run on Mobile HOT 1
- Creating Ribbon - path[j].subtract function not found
- Obj assets load textures
- Opening an Obj File with material and Texture from base64 string
- a button with onPointerUpObservable need to be pressed two times
- Port to Vue3? HOT 1
- About supported languages for development documentation
- why Asset tag is not supporting separate mtl file for obj, we can improve it by minicking from janusvr
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-babylonjs.