Yongs
[HTML] Threejs With Angular 본문
해당 디렉토리에서
- npm install three --save
- npm install @types/three
- Add a div element in AppComponent.html: <div #rendererContainer></div>
- Import three.js in AppComponent.ts: import * as THREE from 'three';
- Get a handle to your div element with @ViewChild('rendererContainer') rendererContainer: ElementRef;
- Do the necessary setup in your constructor / lifecycle methods. Note: the ViewChild is not available until ngAfterViewInit.
Full AppComponent:import {Component, ViewChild, ElementRef} from '@angular/core';
import * as THREE from 'three';
'HTML5' 카테고리의 다른 글
[HTML] 해당 위치에서 터미널 열기 (0) | 2019.08.21 |
---|---|
[HTML] 관련 에러 (0) | 2019.08.20 |
[HTML] Angular-cli 설치 (0) | 2019.08.20 |
[HTML] HTML5 개념 (0) | 2019.08.07 |
Comments