コンテンツにスキップ

PlaneMeshDesc

PlaneMeshDescクラスは、平面(Plane)ジオメトリを描画するためのメッシュです。幅・高さを指定して平面を作成できます。

以下のプロパティに加えて、基底クラスの共通プロパティ(positionrotationscalematrixmatrixWorldgeodeticpickablevisible)が利用できます。詳細は MeshDesc を参照してください。

Type: number

Description: 平面の幅を指定します。

Default: 1

Example:

{
plane: {
width: 1000,
}
}

Type: number

Description: 平面の高さを指定します。

Default: 1

Example:

{
plane: {
height: 1000,
}
}

Type: number

Description: 幅方向のセグメント数を指定します。

Default: 1

Example:

{
plane: {
widthSegments: 10,
}
}

Type: number

Description: 高さ方向のセグメント数を指定します。

Default: 1

Example:

{
plane: {
heightSegments: 10,
}
}

Type: Color

Description: 平面の色をColorインスタンスで指定します。Colorクラスは16進数カラーコードやCSS形式の色指定をサポートします。

Default: new Color().setStyle("#ffffff")

Example:

import { Color } from "@navaramap/three";
{
plane: {
color: new Color().setHex(0x00aa00),
}
}

Type: boolean

Description: 平面が影を投影するかどうかを指定します。

Default: false

Example:

{
plane: {
castShadow: true,
}
}

Type: boolean

Description: 平面が影を受けるかどうかを指定します。

Default: false

Example:

{
plane: {
receiveShadow: true,
}
}

Type: Color

Description: 平面の発光色をColorインスタンスで指定します。

Default: new Color().setHex(0x000000)

Example:

import { Color } from "@navaramap/three";
{
plane: {
emissiveColor: new Color().setHex(0x0000ff),
}
}

Type: number

Description: 発光の強度を指定します。

Default: 1

Example:

{
plane: {
emissiveIntensity: 1.0,
}
}

Type: number

Description: 平面の不透明度を0.0から1.0の範囲で指定します。transparenttrueに設定する必要があります。

Default: 1

Example:

{
plane: {
opacity: 0.5,
transparent: true,
}
}

Type: boolean

Description: 平面を半透明にするかどうかを指定します。

Default: false

Example:

{
plane: {
transparent: true,
opacity: 0.5,
}
}

Type: string[] (optional)

Description: このメッシュに適用するセレクティブエフェクトIDの配列を指定します。

Example:

{
plane: {
effectIds: ["bloom-effect", "outline-effect"],
}
}
import ThreeView, { Color } from "@navaramap/three";
import { PlaneMeshDesc } from "@navaramap/three-default-descs";
const view = new ThreeView();
view.registerMesh("plane", PlaneMeshDesc);
await view.init();
const planeDesc = view.addMesh<PlaneMeshDesc>({
plane: {
width: 1000,
height: 1000,
color: new Color().setHex(0x00aa00),
receiveShadow: true,
},
position: { x: 0, y: 0, z: 0 },
rotation: { x: -Math.PI / 2, y: 0, z: 0 },
});