[問題] Snell's Low 的套用

看板Physics作者 (湯姆熊)時間9年前 (2016/03/14 11:15), 編輯推噓0(006)
留言6則, 2人參與, 最新討論串1/1
【出處】https://gist.github.com/tomjpsun/f11cb8d692a9655bd5af 第 174 到 181 行 雖然問題是以程式的方式呈現,但是小弟感覺不懂的是這個定律的套用, 如果板上大大覺得 po 錯地方,還請鞭小力一點... 【題目】這一段是光跡追蹤,遇到透明物體的計算, 節錄如下: 174 if (sphere->transparency) { 175 float ior = 1.1, eta = (inside) ? ior : 1 / ior; // are we inside or outside the surface? 176 float cosi = -nhit.dot(raydir); 177 float k = 1 - eta * eta * (1 - cosi * cosi); 178 Vec3f refrdir = raydir * eta + nhit * (eta * cosi - sqrt(k)); 179 refrdir.normalize(); 180 refraction = trace(phit - nhit * bias, refrdir, spheres, depth + 1); 181 } 【瓶頸】 175 假設光線由球面外進入的情形,此時 inside=true, eta 設定為 ior(即 1.1) 176 nhit:入射點, raydir: 入射光, 皆已經 normalized, 所以 cosi 為入射角 177 1-cosi*cosi 為 入射角 sin 平方, 這裡看來是套用 snell's law, eta 不是 應該乘以 sin(折射角) 嗎?開始看不懂了... 178 為何這樣就得到折射線?也看不懂. 看了一天都不懂, 還請各位板上大大指點一下!謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.231.108.44 ※ 文章網址: https://www.ptt.cc/bbs/Physics/M.1457925341.A.63F.html

03/14 20:00, , 1F
http://goo.gl/67n7sd 從(3.13)開始看,應該蠻好懂
03/14 20:00, 1F

03/14 20:02, , 2F
的,178是直接套用了alpha=eta, beta=eta*cosi-sqrt
03/14 20:02, 2F

03/14 20:03, , 3F
(k)的這組解,然後177對應(3.17)。簡單說我覺得你是
03/14 20:03, 3F

03/14 20:04, , 4F
對的,這邊應該是k=1-(1-cosi*cosi)/eta/eta
03/14 20:04, 4F

03/15 09:51, , 5F
感謝回應!這篇推導得很詳盡,如果依照論文 eq 3.26 回
03/15 09:51, 5F

03/15 09:58, , 6F
來對照, eta 其實可能是 alpha. 這樣一切都合理了.
03/15 09:58, 6F
文章代碼(AID): #1MvYpTO_ (Physics)