MoI discussion forum
MoI discussion forum

Full Version: Script 3D view

From: Zooen
17 Dec 2023   [#1]
Hi there,
I have a script to switch to front view while staying in 3D view. I can make a copy of the script and modify it to switch to top view and yet another to switch to right view. But (I may have dreamed it) it seems to me that Michael has created a single script to switch to either front or top or right view, while remaining in the 3D view. My research has turned up nothing...
From: Michael Gibson
17 Dec 2023   [#2] In reply to [#1]
Hi Zooen, does this help? :
http://moi3d.com/forum/index.php?webtag=MOI&msg=7898.2

- Michael
From: Michael Gibson
17 Dec 2023   [#3] In reply to [#1]
That sets the 3D view direction using spherical type coordinates:



So up/down angle is like the θ labeled there and left/right angle is φ.

- Michael

Image Attachments:
3D_Spherical.png 


From: Zooen
18 Dec 2023   [#4] In reply to [#3]
Hi Mikael,
Yes, thank you, that's exactly it.

So I have my three scripts .js:
script:/* Vue de face dans la vue 3D */ moi.ui.mainWindow.viewpanel.getViewport('3D').setAngles( 90, 0, 0 );
script:/* Vue de Dessus dans la vue 3D */ moi.ui.mainWindow.viewpanel.getViewport('3D').setAngles( 0, 90, 90 );
script:/* Vue de Droite dans la vue 3D */ moi.ui.mainWindow.viewpanel.getViewport('3D').setAngles( 90, 90, 0 );

Best regards