EditScale

객체 크기조절을 위한 기능 클래스.
A functionality class for object scale.
※ 주의사항(Note).
일반 Entity 객체에서는 기능이 제한됩니다.
Functionality is limited on regular Entity objects..

new Ditap.EditScale()

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. 입력된 좌표 값으로 모델 이동(위경도 좌표)
const setScale = new Ditap.Cartesian3(5, 5, 5);
EditScale.setScale(model, setScale);
// 1-2. 입력된 좌표 값으로 모델 이동(데카르트 좌표)
const addScale = new Ditap.Cartesian3(5, 5, 5);
EditScale.addScale(model, addScale);

// 3. 마우스로 객체 크기 조절
const interactionScale = new Ditap.InteractionScale(viewer);
interactionScale.on();

Methods

static Ditap.EditScale.addScale(object, scale)Cartesian3

모델의 scale 추가.
Add scale.
Name Type Description
object Model | Cesium3DTileset scale 추가할 모델.
The model to which to add the scale
scale Cartesian3 scale값.
Scale value
Returns:
적용된 스케일.
Applied scale.
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);

EditScale.addScale(model, new Ditap.Cartesian3(5, 5, 5));

static Ditap.EditScale.decomposite(object, enu)Object

객체의 트랜스폼.
Transform of the object.
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.

static Ditap.EditScale.getScale(object)Cartesian3

객체의 스케일.
Scale of the object.
Name Type Description
object Model | Cesium3DTileset | Entity 스케일을 구할 객체.
Object to determine scale.
Returns:
스케일.
Scale.

static Ditap.EditScale.setScale(object, scale)Cartesian3|Property

모델의 scale 적용.
Set scale
Name Type Description
object Model | Cesium3DTileset scale 적용할 모델.
The model to which to apply the scale
scale Cartesian3 | Property scale값.
Scale value
Returns:
적용된 스케일.
Applied scale.
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);

EditScale.setScale(model, new Ditap.Cartesian3(5, 5, 5));