Std PerspectiveCamera: Difference between revisions

From FreeCAD Documentation
({{Std Base}} {{Userdocnavi}} to categorize the page)
(Mini-cube menu now calls this command.)
 
(22 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:12-->
{{Docnav
|[[Std_OrthographicCamera|OrthographicCamera]]
|[[Std_MainFullscreen|MainFullscreen]]
|[[Std_View_Menu|Std View Menu]]
|IconL=Std_OrthographicCamera.svg
|IconR=Std_MainFullscreen.svg
|IconC=Freecad.svg
}}

<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand|Name=Std PerspectiveCamera|MenuLocation=[[Std View Menu|View]] → Perspective view‏‎||Workbenches=All|Shortcut=P|SeeAlso=[[Std OrthographicCamera|Orthographic view]]}}
|Name=Std PerspectiveCamera
|MenuLocation=View → Perspective view
|Workbenches=All
|Shortcut={{KEY|V}} {{KEY|P}}
|SeeAlso=[[Std_OrthographicCamera|Std OrthographicCamera]]
}}


==Description== <!--T:2-->
==Description== <!--T:2-->
Puts the camera in perspective view mode.


<!--T:8-->
Perspective has depth while Orthographic is a fixed depth . You can zoom in and out. You can judge distances. Cameras can be distanced from the scene.
The '''Std PerspectiveCamera''' command switches the camera in the active [[3D_view|3D view]] to perspective view mode. In this mode, objects that are further from the camera appear smaller than those that are closer.


</translate>
<!--T:6-->
[[Image:Orthographic_Perspective.gif]]
[[Image:Std_PerspectiveCamera_example.svg]]
<translate>
<!--T:13-->
{{Caption|Two cubes with the same dimensions in perspective view}}

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

<!--T:14-->
# 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|[[Image:Std_PerspectiveCamera.svg|16px]] Perspective view}} option from the Mini-cube menu of the [[Navigation_Cube|Navigation Cube]].
#* Use the keyboard shortcut: {{KEY|V}} then {{KEY|P}}.

==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]].

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

<!--T:20-->
{{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.

</translate>
{{Code|code=
import FreeCADGui


FreeCADGui.ActiveDocument.ActiveView.setCameraType('Perspective')
<!--T:7-->
FreeCADGui.ActiveDocument.ActiveView.getCameraType()
Perspective on the left, Orthographic on the right
}}
<translate>


==Use== <!--T:3-->
<!--T:22-->
{{Docnav
Choose {{MenuCommand|View → [[Image:View-perspective.svg|16px]] Perspective view}} from the top menu.
|[[Std_OrthographicCamera|OrthographicCamera]]
|[[Std_MainFullscreen|MainFullscreen]]
|[[Std_View_Menu|Std View Menu]]
|IconL=Std_OrthographicCamera.svg
|IconR=Std_MainFullscreen.svg
|IconC=Freecad.svg
}}


{{Std Base}}
{{Userdocnavi}}
</translate>
</translate>
{{Std Base navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}

Latest revision as of 09:51, 7 June 2023

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.
    • Select the Perspective view option from the Mini-cube menu of the Navigation Cube.
    • Use the keyboard shortcut: V then P.

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()