Questions concerning line of sight

  • Follow


Hi, 
I am now doing a project to create a 3d model which is formed of several solids for example cylinders and domes, frustrums and some planes, and I have meshed all the solids into different meshs with a mesh_center and a mesh area, 
I want to find if there is a block of line of sight between each mesh. for instance, if there is a small cylinder between one plane and a frustrums, I want to identify which mesh frustrums could be observed by a mesh in the plane. 

I try searching on the internet and found LOS2() which might be useful. however, I dont know how to convert all the solids and pts in the 3d coordinates into lantitudes and longtitude and the way to define the reference vector as it is a simulation model but not a map. 

Please help by providing ways to concert the coordinates or suggesting any other way to do the task of determine whether a line of sight is obstructed?

(I thought of using mathematical method through a vector between 2 mesh centers and searching all the point in the middle if it is inside anything in between but seems to be too comsy) 
0
Reply augustinetine (6) 6/13/2012 3:25:07 AM

Thanks in advance!!
0
Reply augustinetine (6) 6/13/2012 3:32:07 AM


Hi, 
the problem could not be solved yet. 
I tried to transform all the points into lantitude and longitude by the following code, 
function [lan lon apt] = cart2geo(x,y,z)
if nargin<3
    msgbox('invalid input','invalid','none','modal');

elseif ~isequal(size(x),size(y),size(z))
       msgbox('invalid input','invalid','none','modal');
       return;
end 
for i = 1: size(x,1)
    for j = 1: size(x,2)
    lan(i,j) = atan2(z(i,j),x(i,j))*180/pi;
    lon(i,j) = atan2(y(i,j),x(i,j))*180/pi;
    apt(i,j) = sqrt(x(i,j)^2+y(i,j)^2+z(i,j)^2);    
    end 
end
end

but it doesnt work as the lan and lon are not even, which is the projection on the earth and the point will be shifted. 
so I wonder if there's way to transform the cartesian coordinates to lan and long accurately?
thanks in advance.

augustine 
0
Reply augustinetine (6) 6/18/2012 1:14:07 AM

On Wednesday, June 13, 2012 3:25:07 PM UTC+12, Kin Sum Augustine  wrote:
> Hi,=20
> I am now doing a project to create a 3d model which is formed of several =
solids for example cylinders and domes, frustrums and some planes, and I ha=
ve meshed all the solids into different meshs with a mesh_center and a mesh=
 area,=20
> I want to find if there is a block of line of sight between each mesh. fo=
r instance, if there is a small cylinder between one plane and a frustrums,=
 I want to identify which mesh frustrums could be observed by a mesh in the=
 plane.=20
>=20
> I try searching on the internet and found LOS2() which might be useful. h=
owever, I dont know how to convert all the solids and pts in the 3d coordin=
ates into lantitudes and longtitude and the way to define the reference vec=
tor as it is a simulation model but not a map.=20
>=20
> Please help by providing ways to concert the coordinates or suggesting an=
y other way to do the task of determine whether a line of sight is obstruct=
ed?
>=20
> (I thought of using mathematical method through a vector between 2 mesh c=
enters and searching all the point in the middle if it is inside anything i=
n between but seems to be too comsy)

You need a map projection to do this.
Have a look here:
http://www2.ocgy.ubc.ca/~rich/map.html
It is a (free) mapping toolbox for Matlab.

0
Reply mulgor (2847) 6/18/2012 2:59:18 AM

"Kin Sum Augustine" wrote in message <jrlvcv$90f$1@newscl01ah.mathworks.com>...

>     lan(i,j) = atan2(z(i,j),x(i,j))*180/pi;

Not sure what is "lantitude", but the latitude is atan(z / sqrt(x^2+y^2)) in degree.

Bruno
0
Reply b.luong5955 (6341) 6/18/2012 6:46:07 AM

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jrmirf$oj7$1@newscl01ah.mathworks.com>...
> "Kin Sum Augustine" wrote in message <jrlvcv$90f$1@newscl01ah.mathworks.com>...
> 
> >     lan(i,j) = atan2(z(i,j),x(i,j))*180/pi;
> 
> Not sure what is "lantitude", but the latitude is atan(z / sqrt(x^2+y^2)) in degree.
> 
> Bruno
thanks a lot for the reply. 
and sorry for the late reply since I did not check this post frequently
Right, I just realised i made a mistake for that. 
and I dont really understand how the tool can help me with this problem. 
can you please explain a little bit, TideMan?

and now I am working on a solution with ray tracing to solve this problem. 
but still working on it. seems working though. 

thanks again, and if there is any other way to do the line of sight technique, please share with me! 

Augustine 
0
Reply augustinetine (6) 6/22/2012 5:49:10 AM

5 Replies
78 Views

(page loaded in 0.163 seconds)

Similiar Articles:













7/17/2012 8:47:21 AM


Reply: