transforming objects
play

Transforming Objects Ray : R(t) = s + c t Objects : Sphere, box, - PowerPoint PPT Presentation

Transforming Objects Ray : R(t) = s + c t Objects : Sphere, box, cone etc. We assume the objects to be normalized so that the ray-object intersection test is easier. e.g. Sphere is x 2 + y 2 + z 2 = 1 Now while instantiating the objects in our


  1. Transforming Objects Ray : R(t) = s + c t Objects : Sphere, box, cone etc. We assume the objects to be normalized so that the ray-object intersection test is easier. e.g. Sphere is x 2 + y 2 + z 2 = 1 Now while instantiating the objects in our hierarchical scene we can apply various transformations to this normalized primitives to get variety in our scene.

  2. Transforming Objects T : M , d q q ’ T -1 : M -1 , -d Let us say that the sphere is transformed under an Affine transformation T : M ,d i.e. q = q ’ M + d

  3. Transforming Objects p s + c t p ’ s ’ + c ’ t Thus ,s ’ + c ’ t = ( s + ct ) M -1 Solving we get s ’ = ( s - d ) M -1 c ’ = c M -1

  4. Transforming Objects For rendering we also require the normal at the point of intersection of the transformed primitive. Suppose the normalized primitive had the normal n at its point of intersection with the ray. And pa and pb be two points arbitrarily close on the normalized object. Then ( p a – p b ) . n = 0 ( p a – p b ) n T = 0 After applying the transformation T: M ,d to p a and p b ( p a – p b ) M ( n ’ ) T = 0 Where n ’ is the normal of the transformed object

  5. Transforming Objects Now ( p a – p b ) M ( n ’ ) T = 0 Let N be the transformation which gets applied to the normal of the normalized primitive. Then ( p a – p b ) M ( n N) T = 0 ( p a – p b ) MN T n T = 0 This holds true when N T = M -1 i.e. N = (M -1 ) T Transformed objects lets us add flexibility to the basic primitives.

  6. Constructive Solid Geometry (CSG) Compound objects using Boolean Operations ∩ S ∩ S S 2 S 1 S 1 S 2 1 2

  7. Constructive Solid Geometry (CSG) Ray inside test S 1 t 4 t 2 t 3 t 1 S 2 S ∩ S 1 2

  8. Texture Mapping

  9. Texture Mapping How do we model the surface details? Explicit detailed geometry modeling Expensive and may be unnecessary Geometry and texture mapping Shape Details

  10. Texture Mapping Mapping Function Object : (x(u,v), y(u,v), z(u,v)) Texture : (s, t) v t u s

  11. Texture Mapping Mapping Function Object : (x(u,v), y(u,v), z(u,v)) Texture : (s, t) u f(s, t) s h(u, v) = = ⇔ v g(s, t) t i(u, v) = = linear mapping u As B = + v Ct D = +

  12. Texture Mapping Mapping Function Forward Mapping

  13. Texture Mapping Another approach Screen Texture Pixel Inverse Mapping

  14. Texture Mapping Examples Simple patterns for skin, bricks, etc. May need to repeat texture (tiling)

  15. Texture Mapping Examples Requires establishing correspondence between texture and surface points.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend