필터 지우기
필터 지우기

How I can define/ calculate reflection of the ray correctly? As my reflection makes mistake in direction

조회 수: 9 (최근 30일)
Hello, everyone. Kinsly ask about advice or suggestion about how to find reflection of incidence ray and plot it
How I can make reflected ray in 3d indoor. I wrote function step by step but when it reflects it does not work properly. Maybe you can advice me function or documentation/source. I did everything with geometry. And tried then to solve using Rr = Ri - 2 N (Ri . N)
and my R become like 0.7 1.5 -157 which is not coreect.
The main problem that my ray does not reflect from the surface. I found intersection. Maybe something wrong with my directional vector and angles theta
Thank you in advance
  댓글 수: 19
William Rose
William Rose 2023년 4월 11일
I do not understand why phi becomes important if the box is rotating. If I were simulating reflections inside a rotating box, I would not use phi to compute reflections. I would continue to compute reflections with code similar to the code I provided. The difference would be that the reflection computation would be inside a loop that corresponds to time steps, and the orientation vectors of the reflecting planes would be functions of time.
Aknur
Aknur 2023년 4월 11일
Dear @William Rose thank you so much for your question
Because I set the direction vector using two angles theta and phi and reflected angles of theta and phi will set a new direction vector for the next ray. I hope I was able to explain. However, there is also an option to do without any changes in angle phi, but I have to see how it will go with changing angle phi. Because when the plane changes then the angle phi also has to be changed as the plane is different from the incident plane.

댓글을 달려면 로그인하십시오.

채택된 답변

William Rose
William Rose 2023년 3월 9일
I meant the comment above to be an answer; please consider it to be one. t is a scalar, t>=0 so that the reflected ray is only on one side of the plane.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Propagation and Channel Models에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by