Controls & Scroll
You can modify camera controls with the following options.
Disabling Controls
Each controls can be disabled easily by setting it to false
.
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm_default.png",
translate: false
}
The right click(Translation) is disabled
Disabling rotation axis
It is possible to deactivate only one axis of the rotation with disablePitch
(X-axis) and disableYaw
(Y-axis).
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm_default.png",
rotate: {
disablePitch: true
}
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm_default.png",
rotate: {
disableYaw: true
}
}
Disabling double-tap to zoom behavior
Setting doubleTap=false
on zoom
option will do the job.
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm_default.png",
zoom: {
doubleTap: false
}
}
Scrolling
Mobile
By default, scrollable is enabled to enable scrolling on the canvas area for mobile(touch) devices.
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm_default.png",
scrollable: true
}
Check the page in mobile
Set it to false
if the canvas area is small, so there's enough space to scroll.
Desktop
In desktop browsers, wheelScrollable is disabled by default.
You can scroll on the canvas if you enable it, but you can't adjust zoom in this case.
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/draco/alarm.glb",
poster: "/egjs-view3d/poster/alarm_default.png",
wheelScrollable: true
}