# [General] Determine Viewing Angle from a specific View Direction

 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 21, 2017, 10:13 Determine Viewing Angle from a specific View Direction #1 New Member   Anonymous Join Date: Jun 2017 Posts: 1 Rep Power: 0 Hello ladies and gentlemen, I am using Paraview to determine some preset viewing angles that I will use in a personal simulation code to rotate my geometry and to create 3D projection of this geometry (outputting 2D image). So, from the view direction -Z, I can use the camera control to rotate the object and have my viewing angles. Problem are that these actions are cumulative and so not user friendly. What I want is to be able do display or calculate these angles as I rotate manually the object with the mouse. A little bit like you can do on Matlab with scatter3 but with one more angle (the roll). I think it's also necessary to say that the angles I have with matlab are not really what I want but it is just plus or minus pi/2 so not a big deal... but there is still an angle missing and I don't have all the features that ParaView has. Moreover, I have started to write a Python Script to calculate the angles but it is a nightmare as it doesn't work for all angles and for all situations (camera in a plan). To summarize my question, can we display the viewing angle or calculate them while we are rotating the geometry with the mouse ? Thank you in advance. Artikodin - Yes, I am a Pokemon. PS : I am not a native english speaker... :P

June 27, 2017, 05:05
#2
Member

Join Date: Apr 2015
Posts: 37
Rep Power: 11
Quote:
 Originally Posted by Artikodin Hello ladies and gentlemen, I am using Paraview to determine some preset viewing angles that I will use in a personal simulation code to rotate my geometry and to create 3D projection of this geometry (outputting 2D image). So, from the view direction -Z, I can use the camera control to rotate the object and have my viewing angles. Problem are that these actions are cumulative and so not user friendly. What I want is to be able do display or calculate these angles as I rotate manually the object with the mouse. A little bit like you can do on Matlab with scatter3 but with one more angle (the roll). I think it's also necessary to say that the angles I have with matlab are not really what I want but it is just plus or minus pi/2 so not a big deal... but there is still an angle missing and I don't have all the features that ParaView has. Moreover, I have started to write a Python Script to calculate the angles but it is a nightmare as it doesn't work for all angles and for all situations (camera in a plan). To summarize my question, can we display the viewing angle or calculate them while we are rotating the geometry with the mouse ? Thank you in advance. Artikodin - Yes, I am a Pokemon. PS : I am not a native english speaker... :P

Hi Artikodin,

Maybe i understood you question wrong, but i think you want to compute the incremental/delta of the viewing angle. There is probably several ways to do this, but to get the current viewing angle or camera movement i would simply compute it with the knowledge of the focal point and the camera position.

Either you can use the camera control which show the active camera position, but i think it would be more convenient to just trace the movement (Tools -> Start Trace). Good to know is that you need to hide the object of interest before tracing, and unhide it after you started the trace.

When you stop tracing you will get information about "current camera placement" for the active render view. This includes all the necessary info with the CameraPosition, CameraFocalPoint and CameraViewUp, which you can use to compute the movement with the delta angle between two positions.

If you are using a python script to make the postpro you can simply just copy these lines into the script to replicate the views.

Cheers

 Tags angle, camera, display, paraview, viewing