Skip to content

PlaneMeshDesc

The PlaneMeshDesc class is a mesh descriptor for drawing plane geometry. You can create a plane by specifying width and height.

In addition to the properties below, all common properties from the base class (position, rotation, scale, matrix, matrixWorld, pickable, visible) are available. See MeshDesc for details.

Type: number

Description: Specifies the width of the plane.

Default: 1

Example:

{
plane: {
width: 1000,
}
}

Type: number

Description: Specifies the height of the plane.

Default: 1

Example:

{
plane: {
height: 1000,
}
}

Type: number

Description: Specifies the number of segments along the width.

Default: 1

Example:

{
plane: {
widthSegments: 10,
}
}

Type: number

Description: Specifies the number of segments along the height.

Default: 1

Example:

{
plane: {
heightSegments: 10,
}
}

Type: Color

Description: Specifies the color of the plane using a Color instance. The Color class supports hexadecimal color codes and CSS-style color specifications.

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

Example:

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

Type: boolean

Description: Specifies whether the plane casts shadows.

Default: false

Example:

{
plane: {
castShadow: true,
}
}

Type: boolean

Description: Specifies whether the plane receives shadows.

Default: false

Example:

{
plane: {
receiveShadow: true,
}
}

Type: Color

Description: Specifies the emissive color of the plane using a Color instance.

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

Example:

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

Type: number

Description: Specifies the emissive intensity.

Default: 0

Example:

{
plane: {
emissiveIntensity: 1.0,
}
}

Type: number

Description: Specifies the opacity of the plane in the range of 0.0 to 1.0. transparent must be set to true.

Default: 1

Example:

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

Type: boolean

Description: Specifies whether to make the plane semi-transparent.

Default: false

Example:

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

Type: string[] (optional)

Description: Specifies an array of selective effect descriptor IDs to apply to this mesh.

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 },
});