Skip to main content

center

Type"auto" | Array<number | string>
Default"auto"

Specifies the center of the model.
If "auto" is given, it will use the center of the model's bounding box.
Else, you can use any world position.
Or, you can use a string array as a relative position to bounding box min/max. ex) ["0%", "100%", "50%"]
The difference to pivot is model's bounding box and center position will be shown on screen at every rotation angle.

Example

center: "auto" (default)

{
src: "/egjs-view3d/model/draco/alarm.glb",
center: "auto"
}

center: [0.03, 0, 0]

{
src: "/egjs-view3d/model/draco/alarm.glb",
center: [
0.03,
0,
0
]
}

center: ["0%", "50%", "100%"]

{
src: "/egjs-view3d/model/draco/alarm.glb",
center: [
"0%",
"50%",
"100%"
]
}