Capítulo 655 de 859

Chapter 655: FogExp2

Core Idea

This class can be used to define an exponential squared fog, which gives a clear view near the camera and a faster than exponentially densening fog farther from the camera.

Key Concepts

  • color : Color: The fog's color.
  • density : number: Defines how fast the fog will grow dense.
  • isFogExp2 : boolean (readonly): This flag can be used for type testing.
  • name : string: The name of the fog.

Code Examples

const scene = new THREE.Scene();
scene.fog = new THREE.FogExp2( 0xcccccc, 0.002 );
  • What it demonstrates: Typical usage of FogExp2.

Reference Tables

Constructor

Signature
`new FogExp2( color : number

Properties

PropertyDescription
.color : ColorThe fog's color.
.density : numberDefines how fast the fog will grow dense.
.isFogExp2 : boolean (readonly)This flag can be used for type testing.
.name : stringThe name of the fog.

Methods

MethodDescription
.clone() : FogExp2Returns a new fog with copied values from this instance.
`.toJSON( meta : Objectstring ) : Object`

Key Takeaways

  1. Most relevant properties: color, density, isFogExp2, name.
  2. Key methods: clone, toJSON.

Connects To