Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fogOptions |
object |
다음과 같은 속성을 가진 객체.Object with the following properties:
|
Example:
// 샌드캐슬 예제 'DiTAP - Ditap Fog' 참조
const viewer = new Ditap.DitapViewer("ditapContainer", {
fullscreenButton: true,
});
// 안개 효과 색상
const fogColor = new Ditap.Color(0.9, 0.9, 0.9, 0.8);
// 안개 효과 인스턴스 생성
const fog = new Ditap.DitapFog({
viewer: viewer,
longitude: 126.978275264,
latitude: 37.566642192,
radius: 100000,
range: 1000,
color: fogColor,
isTimeBasedBrightness: false
});
// 카메라 이동
viewer.camera.setView({
destination: Ditap.Cartesian3.fromDegrees(126.978275264, 37.566642192, 200),
orientation: {
heading: Ditap.Math.toRadians(0),
pitch: Ditap.Math.toRadians(-10),
roll: 0,
},
});
// 안개 효과 시작
fog.start();
Members
안개의 색상.(기본값: new Color(0.9, 0.9, 0.9, 0.8))
Color of the fog.(default: new Color(0.9, 0.9, 0.9, 0.8))
시간에 따라 안개의 밝기 변화 여부.(기본값: false)
Determines whether the brightness of fog changes over time. (Default: false)
안개의 중심 위도.
Latitude of the fog center.
안개의 중심 경도.
Longitude of the fog center.
안개가 영향을 미치는 범위의 반지름(m).(기본값:100000)
Radius of the area affected by fog (in meters).(default: 100000)
안개의 가시거리(m).(기본값:500)
visibility of the fog (in meters).(default: 500)
viewer : DitapViewer
사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
Methods
사용자가 설정한 안개 옵션을 유효성 검사 및 기본값 설정.
Validates user-defined fog options and sets default values.
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fogOptions |
object |
다음과 같은 속성을 가진 객체.Object with the following properties:
|
Returns:
fogOptions 유효성 검사가 완료된 안개 옵션. fog options after validation.
카메라 이벤트 생성.
Creates a camera event to apply fog effect.
createPostProcessStage() → PostProcessStage
안개 포스트 프로세스 스테이지 생성.
Creates a post-process stage for fog effect.
Returns:
생성된 포스트 프로세스 스테이지.Created post-process stage.
객체를 파괴하고 관련 리소스를 해제합니다.
Destroys the object and releases associated resources.
getColorByTime() → Color
시간과 따른 안개의 색상을 조회.
Retrieves the color of the fog.
Returns:
fogColor 안개 색상 Color of the fog.
getFogColor() → Color
시간과 안개 영역에 따른 안개의 색상을 조회.
Retrieves the color of the fog.
Returns:
fogColor 안개 색상 Color of the fog.
카메라 이벤트 제거.
Removes the camera event.
안개 효과 시작.
Starts the fog effect.
안개 효과를 중지.
Stops the fog effect.