SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Related Functions
SUCameraRef Struct Reference

References the camera object of a SketchUp model. More...

#include <SketchUpAPI/model/camera.h>

Related Functions

(Note that these are not member functions.)

enum SUResult SUCameraCreate (SUCameraRef *camera)
 Creates a default camera object. More...
 
enum SUResult SUCameraRelease (SUCameraRef *camera)
 Releases a camera object created by SUCameraCreate. More...
 
enum SUResult SUCameraGetOrientation (SUCameraRef camera, struct SUPoint3D *position, struct SUPoint3D *target, struct SUVector3D *up_vector)
 Retrieves the orientation of a camera object. More...
 
enum SUResult SUCameraSetOrientation (SUCameraRef camera, const struct SUPoint3D *position, const struct SUPoint3D *target, const struct SUVector3D *up_vector)
 Sets the position of a camera object. More...
 
enum SUResult SUCameraGetViewTransformation (SUCameraRef camera, struct SUTransformation *transformation)
 Retrieves the look at matrix of the camera object. More...
 
enum SUResult SUCameraSetPerspectiveFrustumFOV (SUCameraRef camera, double fov)
 Sets the field of view angle of a camera object. If the camera object is an orthographic camera, the camera object subsequently becomes a perspective camera. The field of view is measured along the vertical direction of the camera. More...
 
enum SUResult SUCameraGetPerspectiveFrustumFOV (SUCameraRef camera, double *fov)
 Retrieves the field of view in degrees of a camera object. The field of view is measured along the vertical direction of the camera. More...
 
enum SUResult SUCameraSetAspectRatio (SUCameraRef camera, double aspect_ratio)
 Sets the aspect ratio of a camera object. More...
 
enum SUResult SUCameraGetAspectRatio (SUCameraRef camera, double *aspect_ratio)
 Retrieves the aspect ratio of a camera object. More...
 
enum SUResult SUCameraSetOrthographicFrustumHeight (SUCameraRef camera, double height)
 Sets the height of a camera object which is used to calculate the orthographic projection of a camera object. If the camera object is a perspective camera, the camera subsequently becomes an orthographic camera. More...
 
enum SUResult SUCameraGetOrthographicFrustumHeight (SUCameraRef camera, double *height)
 Retrieves the height of an orthographic camera object. More...
 
enum SUResult SUCameraSetPerspective (SUCameraRef camera, bool perspective)
 Sets a camera object perspective or orthographic. More...
 
enum SUResult SUCameraGetPerspective (SUCameraRef camera, bool *perspective)
 Retrieves whether a camera object is a perspective camera or not (i.e. orthographic). More...
 
enum SUResult SUCameraGetClippingDistances (SUCameraRef camera, double *znear, double *zfar)
 Retrieves the near and far clipping distances of the camera object. More...
 
enum SUResult SUCameraSetFOVIsHeight (SUCameraRef camera, bool is_fov_height)
 Sets whether the field of view value represents the camera view height. More...
 
enum SUResult SUCameraGetFOVIsHeight (SUCameraRef camera, bool *is_fov_height)
 Retrieves whether the field of view value represents the camera view height. More...
 
enum SUResult SUCameraSetImageWidth (SUCameraRef camera, double width)
 Sets the size of the image on the "film" for a perspective camera. The value is given in millimeters. It is used in the conversions between field of view and focal length. More...
 
enum SUResult SUCameraGetImageWidth (SUCameraRef camera, double *width)
 Retrieves the size of the image on the image plane of the Camera. By default, this value is not set. If it is set, it is used in the calculation of the focal length from the field of view. Unlike most length values in SketchUp, this width is specified in millimeters rather than in inches. More...
 
enum SUResult SUCameraSetDescription (SUCameraRef camera, const char *desc)
 Sets the description of a camera object. More...
 
enum SUResult SUCameraGetDescription (SUCameraRef camera, SUStringRef *desc)
 Retrieves the description of a camera object. More...
 
enum SUResult SUCameraGetDirection (SUCameraRef camera, struct SUVector3D *direction)
 Retrieves the camera's direction vector. More...
 
enum SUResult SUCameraSet2D (SUCameraRef camera, bool make_2d)
 Sets whether a camera is two dimensional. 2 point perspective mode and PhotoMatch mode are 2d cameras. More...
 
enum SUResult SUCameraGet2D (SUCameraRef camera, bool *is_2d)
 Retrieves whether a camera object is two dimensional. More...
 
enum SUResult SUCameraSetScale2D (SUCameraRef camera, double scale)
 Sets the camera's 2D scale factor. More...
 
enum SUResult SUCameraGetScale2D (SUCameraRef camera, double *scale)
 Retrieves the camera's 2D scale factor. More...
 
enum SUResult SUCameraSetCenter2D (SUCameraRef camera, const struct SUPoint3D *center)
 Sets the camera's 2D center point. The point coordinates are in screen space. Since this is setting the 2D center point the z component of the provided point is ignored. More...
 
enum SUResult SUCameraGetCenter2D (SUCameraRef camera, struct SUPoint3D *center)
 Retrieves the camera's 2D center point. Since this is accessing a 2D point with a 3D point structure the z coordinate is always set to 0.0. More...
 

Detailed Description

References the camera object of a SketchUp model.

Friends And Related Function Documentation

enum SUResult SUCameraCreate ( SUCameraRef camera)
related

Creates a default camera object.

Since
SketchUp 2015, API 3.0
Parameters
[out]cameraThe camera object created.
Returns
enum SUResult SUCameraGet2D ( SUCameraRef  camera,
bool *  is_2d 
)
related

Retrieves whether a camera object is two dimensional.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]is_2dThe 2D flag retrieved.
Returns
enum SUResult SUCameraGetAspectRatio ( SUCameraRef  camera,
double *  aspect_ratio 
)
related

Retrieves the aspect ratio of a camera object.

Parameters
[in]cameraThe camera object.
[out]aspect_ratioThe aspect ratio retrieved.
Returns
enum SUResult SUCameraGetCenter2D ( SUCameraRef  camera,
struct SUPoint3D center 
)
related

Retrieves the camera's 2D center point. Since this is accessing a 2D point with a 3D point structure the z coordinate is always set to 0.0.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]centerThe center point retrieved.
Returns
enum SUResult SUCameraGetClippingDistances ( SUCameraRef  camera,
double *  znear,
double *  zfar 
)
related

Retrieves the near and far clipping distances of the camera object.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]znearThe near clipping distance.
[out]zfarThe far clipping distance.
Returns
enum SUResult SUCameraGetDescription ( SUCameraRef  camera,
SUStringRef desc 
)
related

Retrieves the description of a camera object.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]descThe description retrieved.
Returns
enum SUResult SUCameraGetDirection ( SUCameraRef  camera,
struct SUVector3D direction 
)
related

Retrieves the camera's direction vector.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]directionThe direction vector retrieved.
Returns
enum SUResult SUCameraGetFOVIsHeight ( SUCameraRef  camera,
bool *  is_fov_height 
)
related

Retrieves whether the field of view value represents the camera view height.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]is_fov_heightThe field of view flag retrieved.
Returns
enum SUResult SUCameraGetImageWidth ( SUCameraRef  camera,
double *  width 
)
related

Retrieves the size of the image on the image plane of the Camera. By default, this value is not set. If it is set, it is used in the calculation of the focal length from the field of view. Unlike most length values in SketchUp, this width is specified in millimeters rather than in inches.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]widthThe image width retrieved.
Returns
enum SUResult SUCameraGetOrientation ( SUCameraRef  camera,
struct SUPoint3D position,
struct SUPoint3D target,
struct SUVector3D up_vector 
)
related

Retrieves the orientation of a camera object.

Parameters
[in]cameraThe camera object.
[out]positionThe position retrieved.
[out]targetThe target retrieved.
[out]up_vectorThe up direction retrieved.
Returns
enum SUResult SUCameraGetOrthographicFrustumHeight ( SUCameraRef  camera,
double *  height 
)
related

Retrieves the height of an orthographic camera object.

Parameters
[in]cameraThe camera object.
[out]heightThe height retrieved.
Returns
enum SUResult SUCameraGetPerspective ( SUCameraRef  camera,
bool *  perspective 
)
related

Retrieves whether a camera object is a perspective camera or not (i.e. orthographic).

Parameters
[in]cameraThe camera object.
[out]perspectiveThe perspective flag retrieved.
Returns
enum SUResult SUCameraGetPerspectiveFrustumFOV ( SUCameraRef  camera,
double *  fov 
)
related

Retrieves the field of view in degrees of a camera object. The field of view is measured along the vertical direction of the camera.

Parameters
[in]cameraThe camera object.
[out]fovThe field of view retrieved.
Returns
enum SUResult SUCameraGetScale2D ( SUCameraRef  camera,
double *  scale 
)
related

Retrieves the camera's 2D scale factor.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]scaleThe scale factor retrieved.
Returns
enum SUResult SUCameraGetViewTransformation ( SUCameraRef  camera,
struct SUTransformation transformation 
)
related

Retrieves the look at matrix of the camera object.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]transformationThe look at matrix retrieved.
Returns
enum SUResult SUCameraRelease ( SUCameraRef camera)
related

Releases a camera object created by SUCameraCreate.

Since
SketchUp 2015, API 3.0
Parameters
[in]cameraThe camera object.
Returns
enum SUResult SUCameraSet2D ( SUCameraRef  camera,
bool  make_2d 
)
related

Sets whether a camera is two dimensional. 2 point perspective mode and PhotoMatch mode are 2d cameras.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[in]make_2dThe flag for specifying if the camera should be 2D.
Returns
enum SUResult SUCameraSetAspectRatio ( SUCameraRef  camera,
double  aspect_ratio 
)
related

Sets the aspect ratio of a camera object.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[out]aspect_ratioThe aspect ratio to be set.
Returns
enum SUResult SUCameraSetCenter2D ( SUCameraRef  camera,
const struct SUPoint3D center 
)
related

Sets the camera's 2D center point. The point coordinates are in screen space. Since this is setting the 2D center point the z component of the provided point is ignored.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[in]centerThe center to be set.
Returns
enum SUResult SUCameraSetDescription ( SUCameraRef  camera,
const char *  desc 
)
related

Sets the description of a camera object.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[in]descThe description to be set. Assumed to be UTF-8 encoded.
Returns
enum SUResult SUCameraSetFOVIsHeight ( SUCameraRef  camera,
bool  is_fov_height 
)
related

Sets whether the field of view value represents the camera view height.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[in]is_fov_heightThe field of view flag set.
Returns
enum SUResult SUCameraSetImageWidth ( SUCameraRef  camera,
double  width 
)
related

Sets the size of the image on the "film" for a perspective camera. The value is given in millimeters. It is used in the conversions between field of view and focal length.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[in]widthThe width set in millimeters.
Returns
enum SUResult SUCameraSetOrientation ( SUCameraRef  camera,
const struct SUPoint3D position,
const struct SUPoint3D target,
const struct SUVector3D up_vector 
)
related

Sets the position of a camera object.

Parameters
[in]cameraThe camera object.
[in]positionThe new eye position.
[in]targetThe new target position.
[in]up_vectorThe new up direction.
Returns
enum SUResult SUCameraSetOrthographicFrustumHeight ( SUCameraRef  camera,
double  height 
)
related

Sets the height of a camera object which is used to calculate the orthographic projection of a camera object. If the camera object is a perspective camera, the camera subsequently becomes an orthographic camera.

Parameters
[in]cameraThe camera object.
[in]heightThe height of the camera view.
Returns
enum SUResult SUCameraSetPerspective ( SUCameraRef  camera,
bool  perspective 
)
related

Sets a camera object perspective or orthographic.

Parameters
[in]cameraThe camera object.
[in]perspectiveThe perspective flag.
Returns
enum SUResult SUCameraSetPerspectiveFrustumFOV ( SUCameraRef  camera,
double  fov 
)
related

Sets the field of view angle of a camera object. If the camera object is an orthographic camera, the camera object subsequently becomes a perspective camera. The field of view is measured along the vertical direction of the camera.

Parameters
[in]cameraThe camera object.
[in]fovThe field of view angle in degrees.
Returns
enum SUResult SUCameraSetScale2D ( SUCameraRef  camera,
double  scale 
)
related

Sets the camera's 2D scale factor.

Since
SketchUp 2017, API 5.0
Parameters
[in]cameraThe camera object.
[in]scaleThe scale to be set.
Returns

The documentation for this struct was generated from the following files: