AFrame Developing with three.js
Being a framework based on three.js, A-Frame provides full access to the three.js API. We’ll go over how to access the underlying three.js scene, objects, and API that lay underneath A-Frame.
A-Frameはthree.jsをベースにしたフレームワークであるため、three.jsのAPIに完全にアクセスすることができます。ここでは、A-Frameの下にあるthree.jsのシーン、オブジェクト、APIにアクセスする方法を説明します。
THREE.Mesh
Class representing triangular polygon mesh based objects. Also serves as a base for other classes such as SkinnedMesh.
const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
Material
Abstract base class for materials.
Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
The following properties and methods are inherited by all other material types (although they may have different defaults).
マテリアルの抽象的な基本クラスです。
マテリアルはオブジェクトの外観を表現します。これらは(ほとんど)レンダラーに依存しない方法で定義されているので、異なるレンダラーを使用することになっても、マテリアルを書き換える必要はありません。
以下のプロパティとメソッドは、他のすべてのマテリアルタイプに継承されます(ただし、デフォルトは異なる場合があります)。