Placing a camera into a model.
A camera is attached to a viewpoint. The camera can be used as an image capture device as well as a color sensor device.
Capturing an image from video memory is a slow operation. If you plan to use the device as a color sensor, consider using the following parameters:
By using these parameters, the captured image is very small. Use GetNextImage to get the camera image and GetColor in order to get the average color of this image.
Step |
Description |
|
|
Viewpoint properties: Near plane: distance under which 3-D objects are invisible. Far plane: distance beyond which objects are invisible. Aperture: opening (in degrees) for capturing images. Panoramic: check this option to indicate if the camera is panoramic (360 °). Panoramic images are generated by projecting environment map (cube map) on a 3D sphere. This camera type consumes a lot of CPU time because the 7 3D renders (cube + projection). The video card must support RenderToTexture and CubeMapping functions. Sphere mirror ray : ray of the sphere used as mirror (in front of the viewpoint). Distance/camera: distance from the viewpoint to the sphere. Sphere segments: Triangles count used for final sphere rendering. Cube map resolution: Cube maps size for generate the 6 3D renders. Prefer using the default size (Camera with div 2, closest 2 pow <=) |
|
|
|
In MODA programming, camera devices are accessed via the DeviceCamera class. The camera's full path, starting at PHX "/" is viewpoint0/cam0. |
|
Since the Viewpoint is considered as a rendered entity, you may attach it to a physical entity so that it can follow the movement of that entity (see Attaching to a physical entity).
See also the Samples/Devices/Camera/Camera: it shows how to use cameras and color sensor.
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
|
What do you think about this topic? Send feedback!
|