{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture03

# lecture03 - CS 551/651 Advanced Computer Graphics...

This preview shows pages 1–6. Sign up to view the full content.

David Luebke 1 12/09/11 CS 551/651: Advanced Computer Graphics Accelerating Ray Tracing

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
David Luebke 2 12/09/11 Ray-Sphere Intersection Ray R = O + tD x = O x + t * D x y = O y + t * D y z = O z + t * D z Sphere at ( l, m, n ) of radius r is: ( x - l ) 2 + ( y - m ) 2 + ( z - n ) 2 = r 2 Substitute for x,y,z and solve for t
David Luebke 3 12/09/11 Ray-Sphere Intersection Works out as a quadratic equation: at 2 + bt + c = 0 where a = D x 2 + D y 2 + D z 2 b = 2 D x ( O x - l ) + 2 D y ( O y - m ) + 2 D z ( O z - n ) c = l 2 + m 2 + n 2 + O x 2 + O y 2 + O z 2 - 2( l O x + m O y + n O z + r 2 )

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
David Luebke 4 12/09/11 Ray-Sphere Intersection If solving for t gives no real roots: ray does not intersect sphere If solving gives 1 real root r , ray grazes sphere where t = r If solving gives 2 real roots ( r 1 , r 2 ), ray intersects sphere at t = r 1 & t = r 2 Ignore negative values Smallest value is first intersection
David Luebke 5 12/09/11 Ray-Sphere Intersection Find intersection point P i = ( x i , y i , z i ) by plugging t back into ray equation Find normal at intersection point by

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}