Closed ex-tag closed 2 years ago
How do I register a geometry? Trying to use AFRAME.registerGeometry...
'AFRAME' is not defined
import 'aframe'; import 'aframe-extras'; import 'aframe-particle-system-component'; import 'aframe-gradient-sky'; import { Scene, Entity } from 'aframe-react'; import React, { Component, Fragment } from 'react'; import { BoxGeometry } from 'three'; AFRAME.registerGeometry('box', { schema: { depth: { default: 1, min: 0 }, height: { default: 1, min: 0 }, width: { default: 1, min: 0 }, segmentsHeight: { default: 1, min: 1, max: 20, type: 'int' }, segmentsWidth: { default: 1, min: 1, max: 20, type: 'int' }, segmentsDepth: { default: 1, min: 1, max: 20, type: 'int' } }, init: data => { this.geometry = new BoxGeometry(data.width, data.height, data.depth); } });
include this at the top of your code: const AFRAME = window.AFRAME;
const AFRAME = window.AFRAME;
How do I register a geometry? Trying to use AFRAME.registerGeometry...