Perspective Viewport Properties

Post here for help on using FreeCAD's graphical user interface (GUI).
mcolinp
Posts: 1
Joined: Sun Oct 23, 2011 5:08 pm

Perspective Viewport Properties

Postby mcolinp » Sun Oct 23, 2011 5:12 pm

Am I missing something or is there no way to adjust the Perspective Camera Properties. Most CAD programs have a way to adjust the Lens properties which make more or less skew in relation to say a wide angle lens or a normal say 50mm lens. I find the default perspective to be way to wide angle and blown out. Would like to be able to change this.
wmayer
Site Admin
Posts: 11344
Joined: Thu Feb 19, 2009 10:32 am

Re: Perspective Viewport Properties

Postby wmayer » Mon Oct 24, 2011 9:07 am

Check out the documentation for the class SoPerspectiveCamera
With our python interface you're able to change some settings there. As start point you can use this line:

Code: Select all

from pivy import coin
camera=Gui.ActiveDocument.ActiveView.getCameraNode()
camera.heightAngle.setValue(...)

But make sure that you have switch to perspective mode before.
HoWil
Posts: 445
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Perspective Viewport Properties

Postby HoWil » Fri Apr 21, 2017 12:55 pm

Hi,
Looks like the option heightAngle is no more accessible. Is there in the meantime something easier to change the viewangle directly in Freecad?
lg
HoWil
DeepSOIC
Posts: 4679
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Perspective Viewport Properties

Postby DeepSOIC » Fri Apr 21, 2017 1:30 pm

HoWil wrote:Looks like the option heightAngle is no more accessible.
Works here:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10665 (Git)
Build type: Release
Branch: master
Hash: 47847513a85ff6615774ef628230f79e37471daf
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0

Note:
* camera.heightAngle attribute is not listed in autocompleter, you have to type it in manually. This isn't the only place where it happens btw, but attributes of coin nodes are especially well hidden. They don't appear in dir(camera) and camera.__dict__.
* angle is in radians.
HoWil
Posts: 445
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Perspective Viewport Properties

Postby HoWil » Sat Apr 22, 2017 8:00 pm

DeepSOIC wrote:Note:
* camera.heightAngle attribute is not listed in autocompleter, you have to type it in manually. This isn't the only place where it happens btw, but attributes of coin nodes are especially well hidden. They don't appear in dir(camera) and camera.__dict__.
* angle is in radians.

THX. All I needed to know :D !