From: mattj (MATTJENN)
I would like to set my 3D viewport to a particular angle. What is the script to do this - I have looked at the isometric settings but there seems to be some serious maths going on there and also how do i set the perspective amount.
I have attached of my settings as an example
As a future development it would a bonus to be able to save a series of views that could be easily used.
I do a lot of tech illustrations and its always better to keep the viewpoint standard for understandability
Thanks for any help
Matt
Image Attachments:
Screenshot 2020-01-13 at 11.04.21.png
From: Michael Gibson
Hi Matt, so do you mean you want a script that will do the same as setting the angles in the View angles dialog that you show there?
In script form that should go like this:
script: var vp = moi.ui.mainWindow.ViewPanel.getViewport('3D'); vp.setAngles( 59.79, 46.15, 0.16); vp.fieldOfViewAngle = 30.0;
The setAngles() method on a viewport takes the up/down, left/right, and tilt angles and field of view is set by the .fieldOfViewAngle property.
re: saved views, some ideas have been percolating for a while on that. I'm kind of thinking that stuff that involves saved named lists could go in the scene browser under a "Views" section. Then maybe background bitmaps, named construction planes and named views could go under that.
- Michael
From: mattj (MATTJENN)
Hi Micheal
Thats exactly what i was looking for. :-)
I was thinking it would be more complicated as the iso version looks like "script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 135 );"
Yes a list of saved views would work well. And then if there was an add button which would take the current settings form the view to easily add more.
Many thanks as always
Matt
From: Michael Gibson
Hi Matt,
> Yes a list of saved views would work well. And then if there was an add button
> which would take the current settings form the view to easily add more.
Yes there are a couple different controls that would be needed like add and remove. One thing that I haven't determined yet is how to best arrange these additional controls inside the browser pane.
- Michael