A camera control is a transparent rectangle that uses touch and drag
gestures to rotate the position of the camera in a 3D scene around a vertical
axis.
The vertical axis will always remain vertical. Left/right movements will
rotate the scene around the vertical axis (in the azimuth of the vertical
axis), while up/down movements will change the elevation relative to the
vertical axis.
The transparent rectangle will be positioned relative to the 2D HTML canvas
the figure is drawn in on the screen. The left, bottom, width and
height properties are numbers from 0 to 1 which represent percentage of
the screen width and height.
Thus for the rectangle to cover the entire screen, values of left: 0,
bottom: 0, width: 1 and height: 1 would be used (these are the default
values as well).
By default, the figure's Scene camera position is modified. If an
element's custom scene is to be controlled, use the scene property to link
to it.
How fast the camera is rotated in the aziumuth and elevation is controlled by
the sensitivity, xSensitivity and ySensitivity properties.
A higher sensitivity value will result in more rotation for the same user
movement. If only azimuthal or elevation rotation is desired set
ySensitivity or xSensitivity to 0 respectively.
Example
// Add a camera control that will cover the whole screen
// Add camera control bar at the bottom of the screen that only allows // rotation in the azimuth. As the camera control bar does not overlap the // cube, then both the cube can moved, and the scene rotated with the bar. figure.add({ make:'cameraControl', color: [0, 0, 0, 0.2], ySensitivity:0, height:0.1, });
Camera control definition object that extends and OBJ_FigurePrimitive
A camera control is a transparent rectangle that uses touch and drag gestures to rotate the position of the camera in a 3D scene around a vertical axis.
The vertical axis will always remain vertical. Left/right movements will rotate the scene around the vertical axis (in the azimuth of the vertical axis), while up/down movements will change the elevation relative to the vertical axis.
The transparent rectangle will be positioned relative to the 2D HTML canvas the figure is drawn in on the screen. The
left,bottom,widthandheightproperties are numbers from 0 to 1 which represent percentage of the screen width and height.Thus for the rectangle to cover the entire screen, values of
left: 0,bottom: 0,width: 1andheight: 1would be used (these are the default values as well).By default, the figure's Scene camera position is modified. If an element's custom scene is to be controlled, use the
sceneproperty to link to it.How fast the camera is rotated in the aziumuth and elevation is controlled by the
sensitivity,xSensitivityandySensitivityproperties. A higher sensitivity value will result in more rotation for the same user movement. If only azimuthal or elevation rotation is desired setySensitivityorxSensitivityto 0 respectively.Example
Example