【发布时间】:2018-05-24 05:48:32
【问题描述】:
我有一个问题,因为我不是 js 专业人士。我想动态更改传递给用javascript编写的函数的参数,但它是用我不理解的“样式”编写的,所以我正在寻求帮助。
我有一个页面,您可以在其中设置场景的一些参数,然后我使用函数“reload()”获取每个参数的值,但我不知道如何将它们传递给下一个函数将渲染场景。
Three.js 使用了一些函数,我实际上可以渲染场景,但是我不能传递参数,因为函数是这样写的:(我从网上得到的例子)
var lesson6 = {
scene: null,
camera: null,
renderer: null,
container: null,
controls: null,
clock: null,
stats: null,
init: function() { // Initialization
// create main scene
this.scene = new THREE.Scene();
this.scene.background = new THREE.Color( '0x'+sfondo_scena );
//REST OF CODE
例如,在这段代码中,我不知道如何传递“sfondo_scena”的值。
我正在使用的测试页面托管在这里(非常小的代码)Link
【问题讨论】:
标签: javascript php jquery three.js