'YDir' property affects rendering of 3D surfaces?

1 回表示 (過去 30 日間)
Justin Solomon
Justin Solomon 2015 年 6 月 4 日
コメント済み: Justin Solomon 2015 年 6 月 4 日
I am making a somewhat complicated GUI where I have a rendering of a 3D shape (an isosurface through a 3D image volume to be exact). Anyways, Since I'm showing image slices of the object, along with a 3D surface rendering, I want the surface rendering to use a left-handed coordinate system similar to the images. Thus I thought I'd just reverse the y-axis direction of that axes. However, when I do this, for some reason, the rendering of the object seems to completely change for the worse. The lighting on the object looks really "flat" and not as nice compared to when I have 'YDir' as normal. Any ideas why this might be?
I've attached a few screenshots for comparison. FYI, I'm using MATLAB R2014b on a Mac.
'YDir' = 'normal'
'YDir' = 'reverse'
  4 件のコメント
Jan
Jan 2015 年 6 月 4 日
Please post the pictures with meaningful names or comments. I do not know, which are the "wrong" pictures now and which settings are used. Concentrate on the actual object you are talking of. If you include the table and a lot of black space, the interesting detail might be invisible in the forum.
Justin Solomon
Justin Solomon 2015 年 6 月 4 日
Just updated to comment. The top image is with Ydir set to normal, the bottom is with Ydir set to reverse.

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

回答 (1 件)

Jan
Jan 2015 年 6 月 4 日
What exactly is the problem? If you change YDir, you look on the object from the opposite direction. Depending on where the source of light is the surface is in the shadow then.
Either create an addition light source (using the command light) or move the existing one. See also: http://www.mathworks.com/help/matlab/visualize/reflectance-characteristics-of-graphics-objects.html for the BackFaceLighting property of the surface.
  1 件のコメント
Justin Solomon
Justin Solomon 2015 年 6 月 4 日
Thanks for your answer. Even after changing the light position the object still looks quite different (see the images I posted above to Walter Roberson's answer). Also, changing the BackFaceLighting property of the surface didn't help. There's just no specular reflection for some reason after I flip the y-axis. I've played around with different reflectance properties of the surface but I can't seem to make my object look the same as it does before I flip the axes.

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

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by