Comments (3)
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.
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.
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 whencamera
is undefined and two or more cameras exists.VglRenderer
should use the any camera whencamera
is undefined and only one camera exists.- same for
scene
s. - check if an error is thrown when the specified (by name) camera does not exist.
from vue-gl.
Related Issues (20)
- VueGL is not defined HOT 1
- iFrame created with vgl-renderer HOT 6
- Example of rotation? HOT 2
- TypeError: h is not a function HOT 1
- Video texture support HOT 1
- [Question] Types not found in v1.0? HOT 2
- Feature Request : WebXR support (add webxr related features and tooling)
- Vue 3 support HOT 1
- VglShape path prop improvement HOT 1
- [Question] How can use the CanvasTexture? HOT 1
- Material Array not updating HOT 2
- The raw shader material component
- Unable to use VglObjLoader : "Unknown custom element: <vgl-obj-loader>" HOT 3
- How to use VglObjLoader HOT 4
- Cannot run dev build (rollup problem?) HOT 1
- Using inside a fluid container HOT 4
- SphericalReflectionMapping error HOT 3
- Transparent Sphere
- VueGL + Nuxt: Cannot read property 'trim' of undefined HOT 1
- Is EffectComposer supported? HOT 2
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-gl.