![]() |
![]() ![]() |
routines to access the Graphics Display Kit camera
void GDcamera_get_type ( camera_id, int *type );
void GDcamera_get_render_mode ( camera_id, int *mode );
void GDcamera_get_from ( camera_id , float * from );
void GDcamera_get_up ( camera_id , float * up );
void GDcamera_get_at ( camera_id , float * at );
void GDcamera_get_scale ( camera_id , float * scale );
void GDcamera_get_perspec ( camera_id , int * perspec );
void GDcamera_get_hither ( camera_id , int * hither );
void GDcamera_get_front ( camera_id , float * front );
void GDcamera_get_back ( camera_id , float * back );
void GDcamera_get_fov ( camera_id , float * fov );
void GDcamera_get_wsize ( camera_id , float * wsize );
void GDcamera_get_depth_cue ( camera_id , int * depth_cue );
void GDcamera_get_depth_front ( camera_id , float * depth_front );
void GDcamera_get_depth_back ( camera_id , float * depth_back );
void GDcamera_get_depth_scale ( camera_id , float * depth_scale );
void GDcamera_get_auto_norm ( camera_id , int * auto_norm );
void GDcamera_get_extents ( camera_id , int * extents );
void GDcamera_get_mapping ( camera_id , int * mapping );
void GDcamera_get_image_pass ( camera_id , int * image_pass );
void GDcamera_get_pickable ( camera_id , int * pickable );
OMobj_id camera_id ;
void GDcamera_set_type ( camera_id, int type );
void GDcamera_set_render_mode ( camera_id, int mode );
void GDcamera_set_from ( camera_id , float * from );
void GDcamera_set_up ( camera_id , float * up );
void GDcamera_set_at ( camera_id , float * at );
void GDcamera_set_scale ( camera_id , float scale );
void GDcamera_set_perspec ( camera_id , int perspec );
void GDcamera_set_hither ( camera_id , int hither );
void GDcamera_set_front ( camera_id , float front );
void GDcamera_set_back ( camera_id , float back );
void GDcamera_set_fov ( camera_id , float fov );
void GDcamera_set_wsize ( camera_id , float wsize );
void GDcamera_set_depth_cue ( camera_id , int depth_cue );
void GDcamera_set_depth_front ( camera_id , float depth_front );
void GDcamera_set_depth_back ( camera_id , float depth_back );
void GDcamera_set_depth_scale ( camera_id , float depth_scale );
void GDcamera_set_auto_norm ( camera_id , int auto_norm );
void GDcamera_set_extents ( camera_id , int extents );
void GDcamera_set_mapping ( camera_id , int mapping );
int GDcamera_set_image_pass ( camera_id , int image_pass );
int GDcamera_set_pickable ( camera_id , int pickable );
OMobj_id camera_id ;
void GDcamera_attach_object ( camera_id , object_id , int flag );
void GDcamera_detach_objects ( camera_id ) ;
void GDcamera_detach_object ( camera_id, object_id ) ;
void GDcamera_attach_xform ( camera_id , xform_id, int flag ) ;
void GDcamera_detach_xform ( camera_id , int flag );
void GDcamera_detach_views ( camera_id ) ;
OMobj_id camera_id , object_id, xform_id ;
void GDcamera_delete ( OMobj_id camera_id );
void GDcamera_reset (OMobj_id camera_id );
These routines are used to access the Graphics Display Kit camera.
The GDcamera_get_xxxx routines get the subobject values of the camera. The GDcamera_set_xxxx routines set the subobject values of a camera. These routines are used by the Graphics Display Kit camera editor (i.e., GDcamera_edit).
GDcamera_attach_object attaches an object to the camera. The camera maintains an array of objects to be rendered. GDcamera_detach_object detaches the specified object from the array of objects in the camera. GDcamera_detach_objects detachs all the objects at once.
GDcamera_attach_xform attaches a transform to the camera. If the camera is already attached to a transform, the routine returns without changing the transform. GDcamera_detach_xform detaches the transform from a camera.
GDcamera_detach_views detaches the camera from any views to which it may be connected. This routine is called by GDcamera_delete.
GDcamera_delete deletes the camera. This method is called directly by the Object Manager when a camera is deleted.
GDcamera_reset resets the camera's subobjects to their default values. The default values are those specified in DefaultCamera3D.
To create an instance of a camera, call the utility routine GDcreate_instance.
The other parameters in the get/set routines correspond to subobjects of the camera object.
For details, see DefaultCamera2D and DefaultCamera3D .
The parameters from , up , and at are three-element arrays.
(GDcamera_attach/detach_object only) The id of an object.
(GDcamera_attach_xform only) The id of a transformation.
(attach/detach routines only).This argument controls whether the routine actually attaches the object or transform to the camera: 0 means no; 1 means yes. In normal usage within the Graphics Display Kit, the flag is set to 0. If you are using the routines programatically, set the flag to 1.
/* Get and set a camera object's scale subobject. */
OMobj_id camera_id; /* Assume this has been set. */
float scale;
...
GDcamera_get_scale(camera_id, &scale);
scale *= 1.1;
GDcamera_set_scale(camera_id, scale);
![]() |
![]() ![]() |