Giter Site home page Giter Site logo

Comments (4)

h-ikeda avatar h-ikeda commented on June 6, 2024 1

I simply associate threejs classes to our components.
Inheritance relations are represented by component mixins.
ex) AmbientLight class inherits Light class → VglAmbientLight component has VglLight component as mixin.
Component props are corresponding threejs class property.

WebGL objects are not DOM elements, so you have to implement watchers for props to be reactive.
Every modification has to call VglNamespace's update method. It flashes beforeRender queue and calls render method of the WebGLRenderers. Many classes inherit an abstract class which calls update method on beforeUpdate (like this), then we don't have to call it explicitly.
I made the beforeRender queue because some objects need another object's information to calculate their properties.
ex) Light helpers must calculate properties after setting lights. (source)

Object tree relationship is represented by provide/inject system. An object component in the slot of another object component would be a child object.

So first, create the component with mixin. Then implement props and watchers.
If it's a simple component, that's all. But some property needs anomalous implementation.

Note that we use vuedoc, it will automatically create documents from comments.
If you want to create an example, create a file in the docs/examples directory. After bundle install, yarn start will start jekyll server for checking the documentation. The example will appear in the component reference page.

I hope it will help your contribution.

from vue-gl.

h-ikeda avatar h-ikeda commented on June 6, 2024

We appreciate your support, and look forward to your PR!
#195

from vue-gl.

3kynox avatar 3kynox commented on June 6, 2024

Is it possible to have a brief explanation on how you build usually your vue component based on a ThreeJs functionality?

from vue-gl.

3kynox avatar 3kynox commented on June 6, 2024

Thanks for explanations, it does help!

from vue-gl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.