Example:
const viewer = new Ditap.DitapViewer("ditapContainer");
const destination = Ditap.Cartesian3.fromDegrees(
126.978275264,
37.566642192,
400
);
// 카메라 이동
viewer.scene.camera.flyTo({
destination: destination,
});
const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(
Ditap.Cartesian3.fromDegrees(126.9782349646649, 37.56671536989183, 100)
);
const model = await Ditap.Model.fromGltfAsync{
id: "model_01",
url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
modelMatrix: modelMatrix,
scale: 3,
});
viewer.scene.primitives.add(model);
// 1-1. 입력된 좌표 값으로 모델 이동(위경도 좌표)
EditMove.setPositionFromDegrees(model, 126.9782349646649, 37.56671536989183, 150);
// 1-2. 입력된 좌표 값으로 모델 이동(데카르트 좌표)
EditMove.setPosition(model, new Ditap.Cartesian3(-3044811.6264139246, 4043796.6433953536, 3867466.40813661));
// 1-3. 입력된 좌표 값 만큼 모델 이동(데카르트 좌표)
EditMove.addPosition(model, new Ditap.Cartesian3(30, 10, 10));
// 3. 마우스로 객체 이동
const interactionMove = new Ditap.InteractionMove(viewer);
interactionMove.on();
Methods
static Ditap.EditMove.addPosition(object, position) → Cartesian3
입력된 좌표 값만큼 객체 이동.
Move the object as much as the input coordinate value.
Move the object as much as the input coordinate value.
Name | Type | Description |
---|---|---|
object |
Model | Cesium3DTileset | Entity |
이동할 객체. The object to be moved. |
position |
Cartesian3 |
이동량. Amount of movement |
Returns:
적용된 좌표.
Applied coordinates.
Applied coordinates.
Example:
const viewer = new Ditap.DitapViewer("ditapContainer");
const destination = Ditap.Cartesian3.fromDegrees(
126.978275264,
37.566642192,
400
);
// 카메라 이동
viewer.scene.camera.flyTo({
destination: destination,
});
const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(
Ditap.Cartesian3.fromDegrees(126.9782349646649, 37.56671536989183, 100)
);
const model = await Ditap.Model.fromGltfAsync{
id: "model_01",
url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
modelMatrix: modelMatrix,
scale: 3,
});
viewer.scene.primitives.add(model);
EditMove.addPosition(model, new Ditap.Cartesian3(10, 20, 30));
객체의 트랜스폼 추출.
Extracting object's transform
Extracting object's transform
Name | Type | Default | Description |
---|---|---|---|
object |
Model | Cesium3DTileset | Entity |
트랜스폼을 구할 객체. Object to obtain transform. |
|
enu |
boolean |
true
|
optional
East-North-Up 기준 추출. East-North-Up criteria extraction. |
Returns:
트랜스폼 정보.
Transform info.
Transform info.
static Ditap.EditMove.getPosition(object) → Cartesian3
객체의 중심 좌표값.
Center coordinate of the object
Center coordinate of the object
Name | Type | Description |
---|---|---|
object |
Model | Cesium3DTileset | Entity |
좌표값을 구할 객체. Object to obtain coordinates. |
Returns:
좌표값.
coordinates.
coordinates.
static Ditap.EditMove.setPosition(object, position) → Cartesian3|Property
객체 위치 변경.
Change the model's position using Cartesian values.
Change the model's position using Cartesian values.
Name | Type | Description |
---|---|---|
object |
Model | Cesium3DTileset | Entity |
위치 변경할 객체. The object to be repositioned. |
position |
Cartesian3 | Property |
좌표값. Coordinate value. |
Returns:
적용된 좌표.
Applied coordinates.
Applied coordinates.
Example:
const viewer = new Ditap.DitapViewer("ditapContainer");
const destination = Ditap.Cartesian3.fromDegrees(
126.978275264,
37.566642192,
400
);
// 카메라 이동
viewer.scene.camera.flyTo({
destination: destination,
});
const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(
Ditap.Cartesian3.fromDegrees(126.9782349646649, 37.56671536989183, 100)
);
const model = await Ditap.Model.fromGltfAsync{
id: "model_01",
url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
modelMatrix: modelMatrix,
scale: 3,
});
viewer.scene.primitives.add(model);
EditMove.setPosition(model, new Ditap.Cartesian3(-3044811.6264139246, 4043796.6433953536, 3867466.40813661));
static Ditap.EditMove.setPositionFromDegrees(object, longitude, latitude, height) → Cartesian3
경도, 위도, 높이 값을 통해 객체 이동.
Move an object through longitude, latitude, and height values.
Move an object through longitude, latitude, and height values.
Name | Type | Default | Description |
---|---|---|---|
object |
Model | Cesium3DTileset | Entity |
이동할 객체. The object to be moved. |
|
longitude |
number |
경도. Longitude. |
|
latitude |
number |
위도. Latitude. |
|
height |
number |
0
|
optional
높이. Height. |
Returns:
적용된 좌표.
Applied coordinates.
Applied coordinates.
Example:
const viewer = new Ditap.DitapViewer("ditapContainer");
const destination = Ditap.Cartesian3.fromDegrees(
126.978275264,
37.566642192,
400
);
// 카메라 이동
viewer.scene.camera.flyTo({
destination: destination,
});
const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(
Ditap.Cartesian3.fromDegrees(126.9782349646649, 37.56671536989183, 100)
);
const model = await Ditap.Model.fromGltfAsync{
id: "model_01",
url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
modelMatrix: modelMatrix,
scale: 3,
});
viewer.scene.primitives.add(model);
EditMove.setPositionFromDegrees(model, 126.9782349646649, 37.56671536989183, 150);