Giter Site home page Giter Site logo

Comments (3)

h-ikeda avatar h-ikeda commented on May 26, 2024

I thought that usually one camera and one scene are set, so it would be used conveniently without naming. But as you say, it might confuse...
To achieve both of them, I'd like to handle case of the camera or scene prop is undefined.

from vue-gl.

unreal avatar unreal commented on May 26, 2024

I thought that usually one camera and one scene are set, so it would be used conveniently without naming.

I figured that was your intent as well, but I think I saw one other issue where someone had a similar experience.

What about this:

In the case where a VglRenderer does not specify a camera, it checks the VglNamespace for cameras. If there is only one defined, it uses that one regardless of the camera's name. If there is more than one it throws an error saying that the camera prop is required when more than one camera is available.

I assume (but I'm not sure) that THREE.js will throw an error if the camera prop is passed in with an invalid camera name.

I also think it would be a good idea to add methods to VglNamespace for things like adding cameras, scenes, etc. to make sure the keys are not overwritten e.g. in the case where someone has two cameras with no name prop.

from vue-gl.

h-ikeda avatar h-ikeda commented on May 26, 2024

Thank you for your suggestions.

to make sure the keys are not overwritten e.g. in the case where someone has two cameras with no name prop.

Sounds good, developer friendly.
I divided it to another issue to simplify tasks.

then,
TODO:

  • VglRenderer should throw error when camera is undefined and two or more cameras exists.
  • VglRenderer should use the any camera when camera is undefined and only one camera exists.
  • same for scenes.
  • check if an error is thrown when the specified (by name) camera does not exist.

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.