Class: Sketchup::Camera
- Inherits:
-
Object
- Object
- Sketchup::Camera
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb
Overview
The Camera class contains methods for creating and manipulating a camera. The camera in SketchUp is the “point of view” from which you look at the model.
Instance Method Summary collapse
-
#aspect_ratio ⇒ Float
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 ⇒ Geom::Point3d
The #center_2d method returns a point with the x and y offset of the camera when it’s in two-point perspective or math photo mode.
-
#description ⇒ String
The #description method is used to retrieve the description for a Camera.
-
#description=(description) ⇒ Object
The #description= method is used to set the description for the Camera.
-
#direction ⇒ Geom::Vector3d
The #direction method is used to retrieve a Vector3d object in the direction that the Camera is pointing.
-
#eye ⇒ Geom::Point3d
The #eye method is used to retrieve the eye Point3d object for the Camera.
-
#focal_length(length) ⇒ Float
The focal_length method is used to get the focal length in millimeters of perspective Camera.
-
#focal_length=(focal_length) ⇒ Object
The #focal_length= method allows you to set the field of view by specifying a focal length in millimeters.
-
#fov ⇒ Float
The #fov method retrieves the field of view of the Camera.
-
#fov=(fov) ⇒ Object
The #fov= method sets the field of view for a Camera.
-
#fov_is_height? ⇒ Boolean
The #fov_is_height? method indicates whether the field of view is measured vertically, as opposed horizontally.
-
#height ⇒ Float
The #height method retrieves the height of a Camera.
-
#height=(value) ⇒ Object
The #height= method is used to set the height for the Camera in inches.
-
#image_width ⇒ Float
The #image_width method returns the width of the image, as used to calculate the #focal_length.
-
#image_width=(image_width) ⇒ Object
The #image_width= method is used to set the width of the image, as used to calculate the #focal_length.
-
#initialize(*args) ⇒ Camera
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 two-point perspective or match photo 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 2 point perspective cameras.
-
#set(eye, target, up) ⇒ Sketchup::Camera
The #set method sets the camera orientation.
-
#target ⇒ Geom::Point3d
The #target method retrieves Point3d that the camera is pointing at.
-
#up ⇒ Geom::Vector3d
The #up method is used to retrieve the up vector for the camera.
-
#xaxis ⇒ Geom::Vector3d
The #xaxis method is used to retrieve the x axis of the camera coordinate system.
-
#yaxis ⇒ Geom::Vector3d
The #yaxis method retrieves the y axis of the camera coordinate system.
-
#zaxis ⇒ Object
The #zaxis method retrieves the z axis of the camera coordinate system.
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).
312 313 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 312 def initialize(*args) end |
Instance Method Details
#aspect_ratio ⇒ Float
The #aspect_ratio method is used to retrieve the aspect ratio of the Camera.
‘0.0` is the default value and denotes an aspect ratio matching that of the View.
38 39 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 38 def aspect_ratio end |
#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.
55 56 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 55 def aspect_ratio=(ratio) end |
#center_2d ⇒ Geom::Point3d
The #center_2d method returns a point with the x and y offset of the camera when it’s in two-point perspective or math photo 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.
72 73 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 72 def center_2d end |
#description ⇒ String
The #description method is used to retrieve the description for a Camera.
84 85 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 84 def description end |
#description=(description) ⇒ Object
The #description= method is used to set the description for the Camera.
96 97 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 96 def description=(description) end |
#direction ⇒ Geom::Vector3d
The #direction method is used to retrieve a Vector3d object in the direction that the Camera is pointing.
109 110 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 109 def direction end |
#eye ⇒ Geom::Point3d
The #eye method is used to retrieve the eye Point3d object for the Camera.
121 122 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 121 def eye end |
#focal_length(length) ⇒ Float
The focal_length method is used to get the focal length in millimeters of perspective Camera.
This value is computed on the fly based on the camera #fov value and the camera #image_width value.
143 144 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 143 def focal_length(length) end |
#focal_length=(focal_length) ⇒ Object
The #focal_length= method allows you to set the field of view by specifying a focal length in millimeters. Focal length must be between 1 and 3000, inclusive.
The camera #fov value is set based on the provided focal_length
and the current #image_width for the camera.
168 169 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 168 def focal_length=(focal_length) end |
#fov ⇒ Float
The #fov method retrieves the field of view of the Camera.
This is only applicable to perspective cameras.
182 183 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 182 def fov end |
#fov=(fov) ⇒ Object
The #fov= method sets the field of view for a Camera. Field of view must be between 1 and 120 degrees, inclusive.
This is only valid on a perspective camera.
198 199 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 198 def fov=(fov) end |
#fov_is_height? ⇒ Boolean
The #fov_is_height? method indicates whether the field of view is measured vertically, as opposed horizontally.
217 218 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 217 def fov_is_height? end |
#height ⇒ Float
The #height method retrieves the height of a Camera.
This is only valid if it is not a perspective camera.
232 233 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 232 def height end |
#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.
247 248 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 247 def height=(value) end |
#image_width ⇒ Float
The #image_width method returns the width of the image, as used to calculate the #focal_length. This value has no effect on how the view is displayed in SketchUp.
The default value, 0, is interpreted by SketchUp as 36 mm (the width of traditional 35 mm film).
264 265 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 264 def image_width end |
#image_width=(image_width) ⇒ Object
The #image_width= method is used to set the width of the image, as used to calculate the #focal_length. This value has no effect on how the view is displayed in SketchUp.
The default value, 0, is interpreted by SketchUp as 36 mm (the width of traditional 35 mm film).
283 284 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 283 def image_width=(image_width) end |
#is_2d? ⇒ Boolean
The #is_2d? method indicates if the camera two-point perspective or match photo mode.
324 325 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 324 def is_2d? end |
#perspective=(perspective) ⇒ Object
The #perspective= method is used to set whether or not this is a perspective camera or an orthographic camera.
338 339 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 338 def perspective=(perspective) end |
#perspective? ⇒ Boolean
The #perspective? method is used to determine whether a camera is a perspective or orthographic camera.
356 357 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 356 def perspective? end |
#scale_2d ⇒ Object
The #scale_2d method returns a float indicating the scaling factor of 2 point perspective 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.
371 372 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 371 def scale_2d end |
#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.
397 398 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 397 def set(eye, target, up) end |
#target ⇒ Geom::Point3d
The #target method retrieves Point3d that the camera is pointing at.
409 410 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 409 def target end |
#up ⇒ Geom::Vector3d
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.
422 423 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 422 def up end |
#xaxis ⇒ Geom::Vector3d
The #xaxis method is used to retrieve the x axis of the camera coordinate system.
This value is computed from the cross product between the camera direction and the up vector.
438 439 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 438 def xaxis end |
#yaxis ⇒ Geom::Vector3d
The #yaxis method retrieves the y axis of the camera coordinate system.
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.
455 456 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 455 def yaxis end |
#zaxis ⇒ Object
The #zaxis method retrieves the z axis of the camera coordinate system.
This value is computed. It is the same as Camera.direction
475 476 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb', line 475 def zaxis end |