Std PerspectiveCamera: Difference between revisions

From FreeCAD Documentation
(Added Nav Cube info.)
(Marked this version for translation)
Line 2: Line 2:
<translate>
<translate>


<!--T:12-->
{{Docnav
{{Docnav
|[[Std_OrthographicCamera|Std OrthographicCamera]]
|[[Std_OrthographicCamera|Std OrthographicCamera]]
Line 28: Line 29:
[[Image:Std_PerspectiveCamera_example.svg]]
[[Image:Std_PerspectiveCamera_example.svg]]
<translate>
<translate>
<!--T:13-->
{{Caption|Two cubes with the same dimensions in perspective view}}
{{Caption|Two cubes with the same dimensions in perspective view}}


==Usage== <!--T:3-->
==Usage== <!--T:3-->


<!--T:14-->
# There are several ways to invoke the command:
# There are several ways to invoke the command:
#* Select the {{MenuCommand|View → [[Image:Std_PerspectiveCamera.svg|16px]] Perspective view}} option from the menu.
#* Select the {{MenuCommand|View → [[Image:Std_PerspectiveCamera.svg|16px]] Perspective view}} option from the menu.
#* Use the keyboard shortcut: {{KEY|V}} then {{KEY|P}}.
#* Use the keyboard shortcut: {{KEY|V}} then {{KEY|P}}.


==Notes==
==Notes== <!--T:15-->


<!--T:16-->
* It is also possible to switch to perspective view mode via the Mini-cube menu of the [[Navigation_Cube|Navigation Cube]].
* It is also possible to switch to perspective view mode via the Mini-cube menu of the [[Navigation_Cube|Navigation Cube]].


==Preferences==
==Preferences== <!--T:17-->


<!--T:18-->
* The camera type can be changed in the preferences: {{MenuCommand|Edit → Preferences... → Display → 3D View → Camera type}}. The selected type will be used for all 3D views of all opened documents and also for new documents. See [[Preferences_Editor#3D_View|Preferences Editor]].
* The camera type can be changed in the preferences: {{MenuCommand|Edit → Preferences... → Display → 3D View → Camera type}}. The selected type will be used for all 3D views of all opened documents and also for new documents. See [[Preferences_Editor#3D_View|Preferences Editor]].


==Scripting==
==Scripting== <!--T:19-->


<!--T:20-->
{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:21-->
To change the view to perspective use the {{incode|setCameraType}} method of the ActiveView object. This method is not available if FreeCAD is in console mode.
To change the view to perspective use the {{incode|setCameraType}} method of the ActiveView object. This method is not available if FreeCAD is in console mode.


Line 59: Line 66:
<translate>
<translate>


<!--T:22-->
{{Docnav
{{Docnav
|[[Std_OrthographicCamera|Std OrthographicCamera]]
|[[Std_OrthographicCamera|Std OrthographicCamera]]

Revision as of 20:03, 9 April 2020

Std PerspectiveCamera

Menu location
View → Perspective view
Workbenches
All
Default shortcut
V P
Introduced in version
-
See also
Std OrthographicCamera

Description

The Std PerspectiveCamera command switches the camera in the active 3D view to perspective view mode. In this mode, objects that are further from the camera appear smaller than those that are closer.

Two cubes with the same dimensions in perspective view

Usage

  1. There are several ways to invoke the command:
    • Select the View → Perspective view option from the menu.
    • Use the keyboard shortcut: V then P.

Notes

  • It is also possible to switch to perspective view mode via the Mini-cube menu of the Navigation Cube.

Preferences

  • The camera type can be changed in the preferences: Edit → Preferences... → Display → 3D View → Camera type. The selected type will be used for all 3D views of all opened documents and also for new documents. See Preferences Editor.

Scripting

See also: FreeCAD Scripting Basics.

To change the view to perspective use the setCameraType method of the ActiveView object. This method is not available if FreeCAD is in console mode.

import FreeCADGui

FreeCADGui.ActiveDocument.ActiveView.setCameraType('Perspective')
FreeCADGui.ActiveDocument.ActiveView.getCameraType()