javascript - load vrml in an angular project using three-full
问题描述
I am trying to load vrml(wrl) file in browser using three-full and angular 6.
import {Component, ViewChild, ElementRef} from '@angular/core';
import * as THREEFULL from 'three-full';
import * as THREE from 'three';
//var STLLoader = require('three-stl-loader')(THREE);
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
@ViewChild('rendererContainer') rendererContainer: ElementRef;
@ViewChild('inset') inset: ElementRef;
ngOnInit() {
// var loader = new STLLoader();
// loader.load('assets/stls/Chiller.stl', data=>{});
var loader = new THREEFULL.VRMLLoader();
loader.load('assets/stls/house.wrl', data=>{});
}
}
But I get the following error:
ERROR TypeError: Cannot read property 'isRecordingFaces' of undefined
at parseProperty (Three.es.js:79995)
at getTree (Three.es.js:80315)
at parseV2 (Three.es.js:80799)
at VRMLLoader.parse (Three.es.js:80866)
at Object.onLoad (Three.es.js:79822)
at XMLHttpRequest. (Three.es.js:21802)
at ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.es5.js:3881)
at ZoneDelegate.invokeTask (zone.js:424) at Zone.runTask (zone.js:192)
It seems that loading a wrl file causes already the error. Can someone help me?
Thank you!
解决方案
推荐阅读
- r - RShiny - 去年同期
- java - 如何将 log4j 输出消息分配给变量
- android - 如何检测软键盘是否在 Android 的 adjustPan 配置(仅限)中被关闭?
- html - 带有 UTF8 补充字符的 HTML 输入的最大长度
- python - 如何使用 Pycharm 安装 tkinter?
- firebase - 如何在 ionic 中从 Firebase 函数向客户端获取响应
- react-native - 在 react-native 中,为什么我无法定义组件的宽度?
- r - r-markdown 和 kableExtra pdf 输出的错误
- sql - 1 年内 2 周内按星期几的总计
- printing - 在while循环后打印语句不打印