Class: Sketchup::Camera
- Inherits:
-
Object
- Object
- Sketchup::Camera
Overview
The Camera class contains methods for creating and manipulating a camera. The camera in SketchUp is the 鈥減oint of view鈥 from which you look at the model.
Instance Method Summary # collapse
-
#aspect_ratio ⇒ Object
The aspect_ratio method is used to retrieve the aspect ratio of the Camera.
-
#aspect_ratio=(ratio) ⇒ Object
The aspect_ratio= method is used to set the aspect ratio for a Camera.
-
#center_2d ⇒ Object
The center_2d method returns a point with the x and y offset of the camera when it's in 2d mode.
-
#description ⇒ Object
The description method is used to retrieve the description for a Camera object.
-
#description=(description) ⇒ Object
The description= method is used to set the description for the Camera.
-
#direction ⇒ Object
The direction method is used to retrieve a Vector3d object in the direction that the Camera is pointing.
-
#eye ⇒ Object
The eye method is used to retrieve the eye Point3d object for the Camera.
-
#focal_length(length) ⇒ Object
The focal_length method is used to get the focal length in millimeters of perspective Camera.
-
#focal_length=(value) ⇒ Object
The focal_length= method allows you to sent the focal length (in millimeters) of a perspective camera.
-
#fov ⇒ Object
The fov method retrieves the field of view of the camera (in degrees).
-
#fov=(fov) ⇒ Object
The fov= method sets the field of view, in millimeters, for a Camera.
-
#fov_is_height? ⇒ Boolean
The fov_is_height? method indicates whether the field of view is horizontal or vertical.
-
#height ⇒ Object
The height method retrieves the height of a Camera in inches.
-
#height=(value) ⇒ Object
The height= method is used to set the height for the Camera in inches.
-
#image_width ⇒ Object
The image_width method retrieves the size of the image on the image plane of the Camera.
-
#image_width=(value) ⇒ Object
The image_width= method is used to set the size of the image on the 鈥渇ilm鈥 for a perspective camera.
-
#initialize(*args) ⇒ Object
constructor
Returns a new camera with eye (where the camera is) and targets (where the camera is looking).
-
#is_2d? ⇒ Boolean
The is_2d? method indicates if the camera is in 2d mode.
-
#perspective=(perspective) ⇒ Object
The perspective= method is used to set whether or not this is a perspective camera or an orthographic camera.
-
#perspective? ⇒ Boolean
The perspective? method is used to determine whether a camera is a perspective or orthographic camera.
-
#scale_2d ⇒ Object
The scale_2d method returns a float indicating the scaling factor of 2d cameras.
-
#set(eye, target, up) ⇒ Sketchup::Camera
The #set method sets the camera orientation.
-
#target ⇒ Object
The target method retrieves Point3d that the camera is pointing at.
-
#up ⇒ Object
The up method is used to retrieve the up vector for the camera.
-
#xaxis ⇒ Object
The xaxis method is used to retrieve the x axis of the camera coordinate system defined by the camera's direction and up vector.
-
#yaxis ⇒ Object
The yaxis method retrieves the y axis of the camera coordinate system defined by the camera's direction and up vector.
-
#zaxis ⇒ Object
The zaxis method retrieves the z axis of the camera coordinate system defined by the camera's direction and up vector.
Constructor Details
↑ #initialize ⇒ Sketchup::Camera #initialize(eye, target, up, perspective = true, fov = 30.0) ⇒ Sketchup::Camera
Returns a new camera with eye (where the camera is) and targets (where the camera is looking).
Instance Method Details
↑ #aspect_ratio ⇒ Object
The aspect_ratio method is used to retrieve the aspect ratio of the Camera.
↑ #aspect_ratio=(ratio) ⇒ Object
The aspect_ratio= method is used to set the aspect ratio for a Camera. Changing this value will cause SketchUp to show gray bars over the screen to show the resulting view.
If you set the value to 0.0, then the aspect ratio of the Camera will match the aspect ratio of its View.
↑ #center_2d ⇒ Object
The center_2d method returns a point with the x and y offset of the camera when it's in 2d mode. When the camera is in two-point perspective and the user pans around, the x and y values will change. These values are in normalized device coordinates, so for instance, the range [-1.0, 1.0] spans the full width or height of the screen.
The z value is unused and it is always zero.
↑ #description ⇒ Object
The description method is used to retrieve the description for a Camera object.
↑ #description=(description) ⇒ Object
The description= method is used to set the description for the Camera.
↑ #direction ⇒ Object
The direction method is used to retrieve a Vector3d object in the direction that the Camera is pointing.
↑ #eye ⇒ Object
The eye method is used to retrieve the eye Point3d object for the Camera.
↑ #focal_length(length) ⇒ Object
The focal_length method is used to get the focal length in millimeters of perspective Camera.
This value is computed based on the field of view (see the fov method) and the image width (see image_width).
↑ #focal_length=(value) ⇒ Object
The focal_length= method allows you to sent the focal length (in millimeters) of a perspective camera. It must be between 1 and 3000, inclusive. This is an alternate way of setting the field of view.
↑ #fov ⇒ Object
The fov method retrieves the field of view of the camera (in degrees).
This is only applicable to perspective cameras.
↑ #fov=(fov) ⇒ Object
The fov= method sets the field of view, in millimeters, for a Camera. It must be between 1 and 120, inclusive.
This is only valid on a perspective camera.
↑ #fov_is_height? ⇒ Boolean
The fov_is_height? method indicates whether the field of view is horizontal or vertical.
↑ #height ⇒ Object
The height method retrieves the height of a Camera in inches.
This is only valid if it is not a perspective camera.
↑ #height=(value) ⇒ Object
The height= method is used to set the height for the Camera in inches.
This is only valid if it is not a perspective camera.
↑ #image_width ⇒ Object
The image_width method 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, the image_width and focal_length values are specified in millimeters rather than in inches.
↑ #image_width=(value) ⇒ Object
The image_width= method is used to set the size of the image on the 鈥渇ilm鈥 for a perspective camera.
The value is given in millimeters. It is used in the conversions between field of view and focal length.
↑ #is_2d? ⇒ Boolean
The is_2d? method indicates if the camera is in 2d mode. 2 point perspective mode and PhotoMatch mode are 2d cameras.
↑ #perspective=(perspective) ⇒ Object
The perspective= method is used to set whether or not this is a perspective camera or an orthographic camera.
↑ #perspective? ⇒ Boolean
The perspective? method is used to determine whether a camera is a perspective or orthographic camera.
↑ #scale_2d ⇒ Object
The scale_2d method returns a float indicating the scaling factor of 2d cameras.
When the camera is in two-point perspective and the user uses the zoom tools, this value will change. Zooming out will produce a value greater than 1.0.
↑ #set(eye, target, up) ⇒ Sketchup::Camera
The #set method sets the camera orientation. You have to set the camera eye, target and up parameters at the same time to make sure that you have a valid camera definition.
↑ #target ⇒ Object
The target method retrieves Point3d that the camera is pointing at.
↑ #up ⇒ Object
The up method is used to retrieve the up vector for the camera. This is the direction that the top of the camera is facing.
↑ #xaxis ⇒ Object
The xaxis method is used to retrieve the x axis of the camera coordinate system defined by the camera's direction and up vector.
This value is computed from the cross product between the camera direction and the up vector.
↑ #yaxis ⇒ Object
The yaxis method retrieves the y axis of the camera coordinate system defined by the camera's direction and up vector.
This value is computed to be perpendicular the camera x and z axes. It is equivalent to the up direction, but is computed to make sure that it is perpendicular to the direction.
↑ #zaxis ⇒ Object
The zaxis method retrieves the z axis of the camera coordinate system defined by the camera's direction and up vector.
This value is computed. It is the same as Camera.direction