From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3d view transformation

I am using a 3D scatter graph to show my data. Having got it into the projection I want, I wold like to transform the data to give the same view in a 2D graph. I thought I had worked this out from the latitude and longitude, but apparently not. The rotation part is straightforward, but it appears to be rotating about some point (not the centre of the axes). I am not certain how the distance comes into it either. Can anyone out there give me the mathamatics or a reference to the math as to how the user defined view works?

0 Kudos
Message 1 of 3
(2,230 Views)

Hi rossu,

 

It's a bit difficult to tell exactly what you are trying to do from just a text description- I'd recommend posting the code you're attempting to modify as well as screen captures of the images/plots you have and a mockup of what you're trying to generate.  More specific information on the algorithm you're using to obtain the projection from your data set (where are this latitude/longitude coming from?) as well as the behavior you're observing when attempting to pull position/view information from the existing 3D graph would also allow forum users to better assist.

 

If I had to *guess* what point besides the origin a 3D graph would rotate around, I would suppose it rotated around the center of the plot itself.  You may just need to replace the origin in your algorithm with (<axismax>+<axismin>)/2 for each axis. 

 

Regards,

Tom L.
0 Kudos
Message 2 of 3
(2,221 Views)

Your "guess" is a good one and I have, in fact, determined that it does rotate about the centre of the axes. (more on that later). So the viewing direction is pretty straightforward. Given lattitude and longitude, we have

 

x = cos(longitude) sin (latitude)

y = sin(longitude) sin (latitude)

z = cos(latitude)

 

where x,y, and z are measured from the chart centre. I generate two orthogonal vectors to the view direction (you can get the second with a cross product). Unfortunately, when I transform the data, I don't get what is in the 3D graph to within a rotation about the viewing axis (perspective? - I don't think so)

 

Also, there is a bug in the 3D graph software that means you can't recover the axis range if you are autoscaling, so i can't programmaticly find the centre of my graph (LV2011). There was some talk (discussion forum) about this possibly being fixed in LV2012. Does anyone know if that happened?

 

I'll try and put up some pictures of the situation

0 Kudos
Message 3 of 3
(2,216 Views)