-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending parameters and methods for ThreejsRenderer #143
Conversation
Now with the jsonObjParser you can inject custom config also with an obj, in this way: const configs = {
"addPath": "",
"cameraPara": "examples/Data/camera_para.dat",
"videoSettings": {
"width": {
"min": 640,
"max": 800
},
"height": {
"min": 480,
"max": 600
},
"facingMode": "environment"
},
"loading": {
"logo": {
"src": "Data/arNFT-logo.gif",
"alt": "arNFT.js logo"
},
"loadingMessage": "Loading, please wait..."
},
"renderer": {
"type": "three",
"alpha": true,
"antialias": true,
"precision": "mediump"
}
}
ARnft.ARnft.init(640, 480, "examples/DataNFT/pinball", configs, true) |
Probably the rendering is affected because the camera used is very basic: ARnft/src/renderers/ThreejsRenderer.js Line 15 in 6920704
i will try with a PerspectiveCamera. |
@brettkromkamp I'm reflecting if i should create another EventListener to dispatch a general object with renderer, scene and camera; this event will be created inside the initRenderer function ARnft/src/renderers/ThreejsRenderer.js Line 18 in 6920704
Just i need verify if it is possible or not... |
I think i will delete the getRenderer method: _renderGet(ev) {
this.renderer = ev.detail
console.log(this.renderer);
}
getRenderer () {
document.addEventListener('getThreejsRenderer', this._renderGet)
} not very useful, and i didn't achieve what i had in mind. |
Maybe |
I can also add another listener in the draw section, but maybe i can add this after this PR. |
@brettkromkamp I think i am fine with it. I wil probably merge this late evening or tomorrow. If you make some test, i would appreciate it. 🙂 |
i'm merging in dev branch. If we will found some bugs we will fix them in dev. |
ThreejsRenderer improvement
Introduction
As discussed in #139 we will add in this PR other parameters and functionalities to ThreejsRenderer.
We can also add the option to import the rendering options, instead in a separate
config.json
file, as an json object directly in the ARnft init() function:ARnft/src/ARnft.js
Lines 85 to 87 in 6920704
something like (not tested):
List of added features:
onInitThreejsRendering
it spawn only the renderer obj.