Three.js + Threex + Javascript:“fromArray不是函数”?(Three.js + Threex + Javascript: “fromArray is not a function”?)
我真的尽我所能,通过我自己的研究来解决这个问题,但不幸的是,我是一个绝对的新手,拥有three.js和javascript,我真的需要一些帮助。
我试图从threex(谷歌threex - 我不能发布另一个链接)到我的three.js场景中导入模型。 不幸的是,当我按如下方式添加代码时:
var spaceship = null; THREEx.SpaceShips.loadSpaceFighter03(function(object3d){ scene.add(object3d) spaceship = object3d })
我结束了一个空白的场景,并在我的JavaScript控制台中出现这个错误:
Uncaught TypeError :(中间值).fromArray不是函数。:8000/bower_components/threex.spaceships/examples/vendor/three.js/examples/js/loaders/MTLLoader.js:299
这导致了我在MTLLoader.js(无论那个文件是什么)中(可能是)有问题的代码行。
params[ 'ambient' ] = new THREE.Color().fromArray( value );
我不知道发生了什么,我想我的头脑有点过头了。 有人知道如何解决这个问题吗?
我正在学习本教程: https : //www.youtube.com/watch?v = vw5_YyM4hn8 (如果有帮助,本教程的这个部分的示例代码可以在这里找到: https : //github.com/jeromeetienne /flying-spaceship-minigame/blob/master/step1-01-naked-spaceship.html - 我看不到任何问题 - 至今我都试图非常仔细地遵循这些步骤。)
提前致谢。
I've really tried my best to solve this with my own research, but unfortunately I'm an absolute novice with three.js and javascript and I really need some help.
I am trying to import a model from threex (google threex -- I can't post another link) into my three.js scene. Unfortunately, when I add the code to do so as follows:
var spaceship = null; THREEx.SpaceShips.loadSpaceFighter03(function(object3d){ scene.add(object3d) spaceship = object3d })
I end up with a blank scene, and this error in my javascript console:
Uncaught TypeError: (intermediate value).fromArray is not a function.:8000/bower_components/threex.spaceships/examples/vendor/three.js/examples/js/loaders/MTLLoader.js:299
Which leads me to the (supposedly) offending line of code in MTLLoader.js (whatever that file is.)
params[ 'ambient' ] = new THREE.Color().fromArray( value );
I don't know what's happening, and I'm in a bit over my head I think. Does anybody know how to fix this?
I am working off of this tutorial: https://www.youtube.com/watch?v=vw5_YyM4hn8 (if it helps, the sample code for that segment of the tutorial is found here: https://github.com/jeromeetienne/flying-spaceship-minigame/blob/master/step1-01-naked-spaceship.html -- I can't see any problems -- I've so far tried to follow the steps very closely.)
Thanks in advance.
原文:https://stackoverflow.com/questions/30002500
最满意答案
我解决了使用另一个端口这样的事情
server { listen 85 ; listen [::]:85 ; server_name ip:85 ; root /var/www/html/projectfolder1; } server { listen 90 ; listen [::]:90 ; server_name ip:90 ; root /var/www/projectfolder2; }
希望帮助一些人
I solved using another port some thing like that
server { listen 85 ; listen [::]:85 ; server_name ip:85 ; root /var/www/html/projectfolder1; } server { listen 90 ; listen [::]:90 ; server_name ip:90 ; root /var/www/projectfolder2; }
hope that help some one
相关问答
更多-
NGINX更改配置位置(NGINX change config location)[2022-03-16]
无论您是在shell中启动nginx还是使用守护进程服务(只是命令行API的包装),答案都在命令行API中 。 如你所知,默认位置nginx寻找配置文件是/etc/nginx/nginx.conf,但你可以用-c标志传入任意路径。 例如: $ nginx -c /usr/local/nginx/conf 其他一些说明: 我怀疑在你的服务器块中重复“index.html”有什么好的理由。 我会将你的配置文件命名为“nginx.conf”(你目前表明它只是名为“conf”)。 这是标准。 熟悉另一个命令行标志 ... -
尝试 location ~ ^/(first/location|second/location)/ { ... } 〜表示使用正则表达式的url。 ^表示从第一个字符检查。 这将寻找一个/后面的任一位置,然后另一个/。 Try location ~ ^/(first/location|second/location)/ { ... } The ~ means to use a regular expression for the url. The ^ means to check from th ...
-
你的第一次捕获可能太贪心了,你应该通过使用来限制它: rewrite ^(/[^/]+/[^/]+)/(.*)$ $1/index.php?$2 last; 在正则表达式上查看此有用资源 。 Your first capture is probably too greedy, you should limit it by using: rewrite ^(/[^/]+/[^/]+)/(.*)$ $1/index.php?$2 last; See this useful resource on regul ...
-
尝试颠倒目录结构时更新nginx配置(Updating nginx config while attempting to invert directory structure)[2022-06-18]
假设父目录是www ,我认为下面的配置(从这篇文章 )将工作: server { # ... root /var/www/legacy; index index.php index.html index.htm; location / { try_files $uri $uri/ $uri.html $uri.php?$query_string; } location /laravel { alias /var/www/pu ... -
我解决了使用另一个端口这样的事情 server { listen 85 ; listen [::]:85 ; server_name ip:85 ; root /var/www/html/projectfolder1; } server { listen 90 ; listen [::]:90 ; server_name ip:90 ; root /var/www/projectfolder2; } 希望帮助一些人 I solved using another port some thing like t ...
-
好吧所以这个问题比我想象的要简单。 我正在使用不支持ssl的免费cloudflare dns指向。 我切换到使用namescheap dns,它开始工作。 okay so the problem was simpler than I thought. I was using the free cloudflare dns pointing which didn't support ssl. I switched to using the namescheap dns and it started worki ...
-
laravel的nginx配置(nginx configuration for laravel)[2024-05-27]
大多数文件夹应该是正常的“ 755 ”和文件,“ 644 ”。 对于基于nix的操作系统。 使用以下内容。 sudo chgrp -R www-data storage bootstrap/cache sudo chmod -R ug+rwx storage bootstrap/cache Most folders should be normal "755" and files, "644". For nix based OSs. Use the following . sudo chgrp -R ww ... -
版本5.4和5.5( 发行说明 )之间的Laravel加密代码没有向后不兼容的更改,因此只要您使用相同的APP_KEY和相同的加密算法,您就可以在应用程序中解密数据。 There's no backward incompatible changes in Laravel Encryption code between versions 5.4 and 5.5 (release notes) so as long as you use the same APP_KEY and the same encrypt ...
-
没有办法自动执行此操作, 如果您使用的是相同版本的Laravel。 您可以通过移动您编辑的文件手动合并,例如模型,控制器,任何中间件,您的视图,迁移,您需要的公用文件夹中的任何文件。 一步一步,你最终将合并它们。 There is no way to do this automatically, If you are using the same version of Laravel. you can merge manually by moving the files you edited, for ex ...
-
项目的放置没有真正的标准。 也就是说,您最常找到以下建议: /var/www/ (或者,最近, /var/www/html/ ) 这是Debian衍生品(如Mint)上的Apache寻找“默认”网站的默认位置。 许多人,一旦他们禁用了“默认”网站,只需将他们所有的网站都放在这个位置。 这也意味着如果保留默认网站,则可以将项目作为其子文件夹进行访问。 (但请注意,为了利用这一点,您的应用程序必须构建为具有多个路径的访问权限。) /srv/www/ /srv在FHS中定义为“由系统提供的站点特定数据”。 这可能 ...