SURFL "elevation" and "azimuth" definition

2 ビュー (過去 30 日間)
Fadhli Atarita
Fadhli Atarita 2021 年 3 月 26 日
コメント済み: Fadhli Atarita 2021 年 4 月 9 日
Hello,
I need to extract the reflectance data from the "surfl" function but I am having trouble in understanding the "azimuth" and "elevation" parameters of this function. The function uses a default value which is defined as "The default s is 45° counterclockwise from the current view direction". What is this "current view direction" because I don't set any "view" fuction for the plot?
However, after playing around with multiple figures and AZ and EL parameters, I think that the AZ=0 deg means in the south direction of the data and EL=0 is the horizon. What is the unit of the EL parameter? Is it in degrees? I've tried using EL=90 and it seemed like it was from nadir but I'm still not sure.
Please let me know if I got this right.
Thank you.

採用された回答

Chidvi Modala
Chidvi Modala 2021 年 3 月 30 日
You may refer to the below link for a clear understanding on viewpoints
  1 件のコメント
Fadhli Atarita
Fadhli Atarita 2021 年 3 月 30 日
編集済み: Fadhli Atarita 2021 年 3 月 30 日
Hi,
Thank you for your reply. That is a very useful documentation.
What I'm still confused of is that a 3D plot has a default viewpoint of azimuth = -37.5° and elevation = 30°. and in the documentation of surfl, it is stated that s= "Direction from the surface to the light source, specified as a two- or three-element vector. The vector has the form [sx sy sz] or [azimuth elevation]. The default direction is 45° counterclockwise from the current view direction."
Does that mean 45° from the -37.5° viewpoint (which is basically 7.5°) or literally 45° regardless of the default 3D viewpoint ? and there is no stated default elevation, can i assume that it is 0°?
Fadhli

サインインしてコメントする。

その他の回答 (1 件)

Chidvi Modala
Chidvi Modala 2021 年 4 月 5 日
surfl doesn't have a default viewpoint, the view belongs to the axes. Consider:
view(3)
[az,el] = view
az =
-37.5000
el =
30
view([10,20])
[az,el] = view
az =
10
el =
20
If the s parameter is not specified it is calculated as 45 degrees counterclockwise from the current view direction.
The light is placed at the coordinate [Sx,Sy,Sz] where:
Sx = cos(az)*sin(45)+sin(az)*cos(el)*cos(45)
Sy = sin(45)*sin(az)-cos(az)*cos(el)*cos(45);
Sz = sin(45)*sin(el);
If the s parameter is specified as a two element vector: Saz, Sel, the light is placed at:
Sx = sin(Saz)*cos(Sel)
Sy = -cos(Saz)*cos(Sel)
Sz = sin(Sel)
If the s parameter is specified as a three element vector, we use those elements to define Sx, Sy, Sz.
If you'd like to learn more about where the light is placed, feel free to experiment with:
h=surfl(rand(5),rand(5),rand(5), [0 0], 'light');
h(2).Position
You can also experiment with:
edit surfl.m
  1 件のコメント
Fadhli Atarita
Fadhli Atarita 2021 年 4 月 9 日
Thank you!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by