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

19 次查看(过去 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