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

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

View Full Document Right Arrow Icon
David Luebke 1 CS 551/651: Advanced Computer Graphics Accelerating Ray Tracing
Background image of page 1

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

View Full DocumentRight Arrow Icon
David Luebke 2 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
Background image of page 2
David Luebke 3 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 )
Background image of page 3

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

View Full DocumentRight Arrow Icon
David Luebke 4 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
Background image of page 4
David Luebke 5 Ray-Sphere Intersection Find intersection point P i = ( x
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/09/2011 for the course CS 561/661 taught by Professor Lubke during the Summer '11 term at Montgomery College.

Page1 / 15

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

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online