PointMaterial
PointMaterialは、ポイントジオメトリレンダリング用のマテリアルを表します。
Properties
Section titled “Properties”backfaceCulling
Section titled “backfaceCulling”Type: boolean | undefined
Description: 裏側から見たときにポイントを非表示にするかどうかを指定します。false の場合はポイントの両面を描画し、true の場合は表側のみを描画します。
カメラに追従して立っているポイント(デフォルト)は常に表側が見えるため、影響はありません。影響があるのは次の 2 つの場合です。rotateWithCamera が false のポイントは裏側から見えることがあり、その場合は左右反転して表示されますが、この設定を有効にすると非表示になります。pointFacing が "flat" のポイントは地球の外側を表側としているため、この設定を有効にすると、大きなポイントのうち地平線の向こう側に回り込んだ部分も非表示になります。
Default: false
Example:
{ point: { pointFacing: "flat", backfaceCulling: true }}center
Section titled “center”Type: { x: number, y: number }
Description: 中心からのシフト量を指定します。範囲は 0 から 1 の間です。単位は、ポイントの丸に対する相対位置です。
Default: Required
Example:
{ point: { center: { x: 0.5, y: 0.5 } }}clampToGround
Section titled “clampToGround”Type: boolean
Description: 地面に張り付けるかどうかを指定します。
Default: Required
Example:
{ point: { clampToGround: true }}Type: Color
Description: ポイントの色をColorインスタンスで指定します。
Default: Required
Example:
import { Color } from "@navaramap/three";
{ point: { color: new Color().setHex(0xff0000) }}declutter
Section titled “declutter”Type: boolean | undefined
Description: 画面空間でのデクラッター(重なり除去)に参加します。ラベルやスプライトが画面上で重なった場合、優先度の低いものが非表示になります。デフォルトで有効です。すべてのラベルを無条件に描画するには false を設定します。
Default: true
Example:
{ point: { declutter: false }}declutterPriority
Section titled “declutterPriority”Type: number | undefined
Description: デクラッターの配置優先度です。値が大きいほど重なりの競合に勝ちます。declutter が有効な場合にのみ意味を持ちます。FeatureEvaluator.evaluate() で地物ごとに上書きできます。
Default: 0.0
Example:
{ point: { declutter: true, declutterPriority: 1 }}depthTest
Section titled “depthTest”Type: boolean | undefined
Description: 前面のモデルが背面のモデルを隠すかどうかを決定する変数です。
Default: true
Example:
{ point: { depthTest: true }}effectIds
Section titled “effectIds”Type: string[] | undefined
Description: 適用する Selective Effect の ID を指定します(例: “bloom”, “outline”)。SelectiveBloomEffectDesc や SelectiveOutlineEffectDesc と連携して使用します。
Default: undefined
Example:
{ point: { effectIds: ["bloom", "outline"] }}emissiveColor
Section titled “emissiveColor”Type: Color | undefined
Description: 発光色をColorインスタンスで指定します。
Default: undefined
Example:
import { Color } from "@navaramap/three";
{ point: { emissiveColor: new Color().setHex(0xff0000) }}emissiveIntensity
Section titled “emissiveIntensity”Type: number | undefined
Description: 発光の強度を指定します。
Default: undefined
Example:
{ point: { emissiveIntensity: 0.5 }}geometryTypes
Section titled “geometryTypes”Type: ("point" | "line" | "polygon")[] | undefined
Description: このマテリアルが消費するソースジオメトリのカテゴリーです。"line" を含めるとラインの頂点ごとに、"polygon" を含めるとポリゴンリングの頂点ごとに 1 つのポイントを描画します(リングを閉じる重複頂点はスキップされます)。配列を指定するとデフォルトは置き換えられるため、ポイントジオメトリも描画し続けたい場合は "point" を含めてください。このオプションはジオメトリ構築時に適用されます。レイヤー作成時に指定してください。layer.update() で変更しても読み込み済みのタイルには反映されず、変更後に読み込まれたタイルにのみ適用されます(すべてに反映するにはレイヤーを作り直してください)。
Default: ["point"]
Example:
{ point: { geometryTypes: ["point", "polygon"] }}height
Section titled “height”Type: number
Description: 高さを指定します。単位はメートルです。
Default: Required
Example:
{ point: { height: 100 // 100メートル }}offsetDepth
Section titled “offsetDepth”Type: boolean | undefined
Description: 地球表面との重なりを回避します。ポイントが地球表面にめり込まないようにする場合に使用します。
Default: undefined
Example:
{ point: { offsetDepth: true }}opacity
Section titled “opacity”Type: number | undefined
Description: ポイントの不透明度を指定します。有効範囲は 0.0(完全に透明)から 1.0(完全に不透明)です。
Default: 1.0
Example:
{ point: { transparent: true, opacity: 0.5 // 50%の不透明度 }}sizeInMeters
Section titled “sizeInMeters”Type: boolean | undefined
Description: サイズをメートル単位で指定するかどうか。false の場合、サイズはピクセル単位です。
Default: true
Example:
{ point: { sizeInMeters: true }}pointFacing
Section titled “pointFacing”Type: "upright" | "flat" | undefined
Description: ポイントを立てて表示するか、地球表面に寝かせて表示するかを指定します。"upright" は立てた状態に保ちます。"flat" はアンカー位置の周辺で地球の曲率に沿って地表に配置するため、地表に描かれているように見え、カメラのピッチに応じて短縮されます。
rotateWithCamera との組み合わせで、次の 4 通りの表示になります。
pointFacing | rotateWithCamera | 表示 |
|---|---|---|
"upright" | true | 画面に正対するビルボード。短縮されません(デフォルト) |
"upright" | false | 地表に立ち、方位は固定されます |
"flat" | true | 地表に描かれ、常に視点の方を向くように回転します |
"flat" | false | 地表に描かれ、北を上にして地図とともに回転します |
FeatureEvaluator から facing として地物ごとに指定することもできます。
Default: "upright"
Example:
{ point: { pointFacing: "flat" }}rotateWithCamera
Section titled “rotateWithCamera”Type: boolean | undefined
Description: ポイントをカメラに追従して回転させるかどうかを指定します。true の場合は常に視点の方を向きます。false の場合はアンカー位置のローカルな東・北・上の座標系に固定され、カメラを動かしても向きは変わりません。"upright" では地表に立って南を向くため、真上から見ると縁しか見えずに消え、裏側からは鏡像になります。
FeatureEvaluator から地物ごとに指定することもできます。
Default: true
Example:
{ point: { pointFacing: "upright", rotateWithCamera: false }}rotation
Section titled “rotation”Type: number | undefined
Description: ポイントを自身の平面内で、アンカー位置を中心に回転させる角度を度数で指定します。正面から見て時計回りです。回転は pointFacing と rotateWithCamera で決まる向きに対して追加で適用されます。
回転の中心がポイントのどこになるかは center で決まります。
FeatureEvaluator から地物ごとに指定できるため、レイヤー内のポイントごとに異なる向きにできます。
Default: 0.0
Example:
{ point: { rotation: 45 }}Type: boolean | undefined
Description: ポイントを表示するかどうかを指定します。
Default: undefined
Example:
{ point: { show: true }}Type: number
Description: ポイントのサイズを指定します。単位はメートルです。
Default: Required
Example:
{ point: { size: 10 // 10メートル }}transparent
Section titled “transparent”Type: boolean | undefined
Description: ポイントの透過度を考慮するかどうかを指定します。true にするとエフェクトを有効にしたときにポイントがうまく表示されないことがあるので注意してください。
Default: undefined
Example:
{ point: { transparent: false }}