Bài giảng môn Đồ họa và hiện thực ảo - Bài 2: Các giải thuật sinh các thực thể cơ sở
Số trang: 9
Loại file: pdf
Dung lượng: 489.28 KB
Lượt xem: 15
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Bài giảng trình bày những nội dung sau: The Rendering Pipeline - 3D, phép biến đổi Transformation, Rendering - Transformations, rời rạc hóa điểm ảnh, thuật toán DDA, giải thuật Bresenham, giải thuật trung điểm-Midpoint,... Mời các bạn cùng tham khảo.
Nội dung trích xuất từ tài liệu:
Bài giảng môn Đồ họa và hiện thực ảo - Bài 2: Các giải thuật sinh các thực thể cơ sởCác giải thuật sinh các thực thểcơ sởRendering Pipeline: 3-DTransformIlluminateTransformClipProjectLe Tan Hunghunglt@it-hut.edu.vn0913030731RasterizeModel & CameraParametersThe Rendering Pipeline: 3-DzzModelingTransforms• Các điểm của hệ thống tọa độ 3D thế giới thựcLightingCalculations• Các điểm bóng theo mô hình chiếu sángViewingTransform• Các điểm trong mô hình hệ tọa độ Camera hay tọa độ điểm nhìnClipping• Các tọa độ điểm của vùng hình chóp cụt với điểm nhìn xác địnhz––Rendering: TransformationsModeling transforms–Modeling transformsViewing transformsProjection transforms• Điểm 22-D theo tọa độ màn hình sau phép chiếu được xén tỉaRendering: Transformations–Displayscreen space- không gian màn hìnhmodel space Không gian mô hình(a.k.a. object space or world space)3 loại phép biến đổi:–zFramebufferPhép biến đổi TransformationsScene graphObject geometryProjectionTransformRendering PipelinezSize, place, scale, and rotate objects parts of themodel w.r.t. each otherObject coordinates Æ world coordinatesViewing transform–Rotate & translate the world to lie directly in front ofthe camerazz–Typically place camera at originTypically looking down -Z axisWorld coordinates Æ view coordinatesYYXZXZ1Rendering: TransformationszProjection transform–Apply perspective foreshortening–View coordinates Æ screen coordinateszRendering: TransformationszDistant = small: the pinhole camera modelzzAll these transformations involve shiftingcoordinate systems (i.e., basis sets)Oh yeah, that’s what matrices do…Represent coordinates as vectors, transformsas matrices⎡X ′⎤ ⎡cos θ⎢ ′⎥ = ⎢ θ⎣Y ⎦ ⎣sinzRendering: TransformationszHomogeneous coordinates: representcoordinates in 3 dimensions with a 4-vector–Denoted [x, y, z, w]T–To get 3-D coordinates, divide by w:[x’, y’, z’]T = [x/w, y/w, z/w]TzzzNote that w = 1 in model coordinatesTransformations are 4x4 matricesWhy? To handle translation and projectionMultiply matrices = concatenate transforms!The Rendering Pipeline: 3-DScene graphObject geometryzIlluminating a scene: coloring pixels according tosome approximation of lighting––zGlobal illumination: solves for lighting of the wholescene at onceLocal illumination: local approximation, typicallylighting each polygon separatelyInteractive graphics (e.g., hardware) does onlylocal illumination at run timeResult:ModelingTransforms• All vertices of scene in shared 33-D “world” coordinate systemLightingCalculations• Vertices shaded according to lighting modelViewingTransform• Scene vertices in 33-D “view” or “camera” coordinate systemClippingProjectionTransformRendering: Ánh sáng - Lighting−sin θ ⎤ ⎡X ⎤⎥⎢ ⎥cos θ ⎦ ⎣Y ⎦• Exactly those vertices & portions of polygons in view frustum• 2-D screen coordinates of clipped verticesThe Rendering Pipeline: 3-DScene graphObject geometryResult:ModelingTransforms• All vertices of scene in shared 33-D “world” coordinateLightingCalculations• Vertices shaded according to lighting modelsystemViewingTransform• Scene vertices in 33-D “view” or “camera” coordinatesystemClipping• Exactly those vertices & portions of polygons in viewfrustumProjectionTransform• 2-D screen coordinates of clipped vertices2Rendering: ClippingzRendering: Xén tỉa - ClippingClipping a 3-D primitive returns its intersectionwith the view frustum:zClipping is tricky!The Rendering Pipeline: 3-DTransformzTransformz–Project–RasterizezFramebufferzzTương ứng là các ma trậnIn: 1 polygonOut: 2 polygonsCollection of primitives, other objectsAssociated matrix for transformations–4 wheels on a car, 2 arms on a robotModeling: The Scene GraphĐồ thị cảnh scene graph : cây đồ thị lưu trữ đốitượng, quan hệ giũa các đối tượng và các phépbiến đổi trên đối tượng đóNút là đối tượng;Cành là các thực thể biến đổi–ClipInstancing: using same geometry for multipleobjectsDisplayModeling: The Scene GraphzIn: 3 verticesOut: 6 verticesCommon interactive 3-D primitives: points,lines, polygons (i.e., triangles)Organized into objectsClipRendering PipelineClipModeling: The BasicsIlluminateModel & CameraParametersWe will have a whole assignment on clipping–zzTraverse the scene graph in depth-first order,concatenating transformationsMaintain a matrix stack of transformationsRobotVisitedHeadRobotBodyUnvisitedHeadBodyActiveMatrixStackMouthEyeLegTrunkArmFootMouthEyeLegTrunkArm3Modeling: The CamerazFinally: need a model of the virtual camera–Can be very sophisticated–Interactive graphics (OpenGL):zzCamera pose: position & orientationCaptured in vie ...
Nội dung trích xuất từ tài liệu:
Bài giảng môn Đồ họa và hiện thực ảo - Bài 2: Các giải thuật sinh các thực thể cơ sởCác giải thuật sinh các thực thểcơ sởRendering Pipeline: 3-DTransformIlluminateTransformClipProjectLe Tan Hunghunglt@it-hut.edu.vn0913030731RasterizeModel & CameraParametersThe Rendering Pipeline: 3-DzzModelingTransforms• Các điểm của hệ thống tọa độ 3D thế giới thựcLightingCalculations• Các điểm bóng theo mô hình chiếu sángViewingTransform• Các điểm trong mô hình hệ tọa độ Camera hay tọa độ điểm nhìnClipping• Các tọa độ điểm của vùng hình chóp cụt với điểm nhìn xác địnhz––Rendering: TransformationsModeling transforms–Modeling transformsViewing transformsProjection transforms• Điểm 22-D theo tọa độ màn hình sau phép chiếu được xén tỉaRendering: Transformations–Displayscreen space- không gian màn hìnhmodel space Không gian mô hình(a.k.a. object space or world space)3 loại phép biến đổi:–zFramebufferPhép biến đổi TransformationsScene graphObject geometryProjectionTransformRendering PipelinezSize, place, scale, and rotate objects parts of themodel w.r.t. each otherObject coordinates Æ world coordinatesViewing transform–Rotate & translate the world to lie directly in front ofthe camerazz–Typically place camera at originTypically looking down -Z axisWorld coordinates Æ view coordinatesYYXZXZ1Rendering: TransformationszProjection transform–Apply perspective foreshortening–View coordinates Æ screen coordinateszRendering: TransformationszDistant = small: the pinhole camera modelzzAll these transformations involve shiftingcoordinate systems (i.e., basis sets)Oh yeah, that’s what matrices do…Represent coordinates as vectors, transformsas matrices⎡X ′⎤ ⎡cos θ⎢ ′⎥ = ⎢ θ⎣Y ⎦ ⎣sinzRendering: TransformationszHomogeneous coordinates: representcoordinates in 3 dimensions with a 4-vector–Denoted [x, y, z, w]T–To get 3-D coordinates, divide by w:[x’, y’, z’]T = [x/w, y/w, z/w]TzzzNote that w = 1 in model coordinatesTransformations are 4x4 matricesWhy? To handle translation and projectionMultiply matrices = concatenate transforms!The Rendering Pipeline: 3-DScene graphObject geometryzIlluminating a scene: coloring pixels according tosome approximation of lighting––zGlobal illumination: solves for lighting of the wholescene at onceLocal illumination: local approximation, typicallylighting each polygon separatelyInteractive graphics (e.g., hardware) does onlylocal illumination at run timeResult:ModelingTransforms• All vertices of scene in shared 33-D “world” coordinate systemLightingCalculations• Vertices shaded according to lighting modelViewingTransform• Scene vertices in 33-D “view” or “camera” coordinate systemClippingProjectionTransformRendering: Ánh sáng - Lighting−sin θ ⎤ ⎡X ⎤⎥⎢ ⎥cos θ ⎦ ⎣Y ⎦• Exactly those vertices & portions of polygons in view frustum• 2-D screen coordinates of clipped verticesThe Rendering Pipeline: 3-DScene graphObject geometryResult:ModelingTransforms• All vertices of scene in shared 33-D “world” coordinateLightingCalculations• Vertices shaded according to lighting modelsystemViewingTransform• Scene vertices in 33-D “view” or “camera” coordinatesystemClipping• Exactly those vertices & portions of polygons in viewfrustumProjectionTransform• 2-D screen coordinates of clipped vertices2Rendering: ClippingzRendering: Xén tỉa - ClippingClipping a 3-D primitive returns its intersectionwith the view frustum:zClipping is tricky!The Rendering Pipeline: 3-DTransformzTransformz–Project–RasterizezFramebufferzzTương ứng là các ma trậnIn: 1 polygonOut: 2 polygonsCollection of primitives, other objectsAssociated matrix for transformations–4 wheels on a car, 2 arms on a robotModeling: The Scene GraphĐồ thị cảnh scene graph : cây đồ thị lưu trữ đốitượng, quan hệ giũa các đối tượng và các phépbiến đổi trên đối tượng đóNút là đối tượng;Cành là các thực thể biến đổi–ClipInstancing: using same geometry for multipleobjectsDisplayModeling: The Scene GraphzIn: 3 verticesOut: 6 verticesCommon interactive 3-D primitives: points,lines, polygons (i.e., triangles)Organized into objectsClipRendering PipelineClipModeling: The BasicsIlluminateModel & CameraParametersWe will have a whole assignment on clipping–zzTraverse the scene graph in depth-first order,concatenating transformationsMaintain a matrix stack of transformationsRobotVisitedHeadRobotBodyUnvisitedHeadBodyActiveMatrixStackMouthEyeLegTrunkArmFootMouthEyeLegTrunkArm3Modeling: The CamerazFinally: need a model of the virtual camera–Can be very sophisticated–Interactive graphics (OpenGL):zzCamera pose: position & orientationCaptured in vie ...
Tìm kiếm theo từ khóa liên quan:
Đồ họa máy tính Hiện thực ảo Kỹ thuật đồ họa Computer Graphics Virtual Reality Phép biến đổi Transformations The rendering pipelineGợi ý tài liệu liên quan:
-
66 trang 423 3 0
-
77 trang 306 3 0
-
vray for sketchup vietnamese PHẦN 3
10 trang 212 0 0 -
Giáo trình Autocad - Nghề: Quản trị mạng máy tính - Trình độ: Cao đẳng nghề (Phần 2)
52 trang 209 0 0 -
Đề cương chi tiết môn học Kỹ thuật đồ họa và xử lý ảnh
5 trang 175 1 0 -
Luận văn tốt nghiệp: Tìm hiểu về SIMULINK trong MATLAB
50 trang 155 0 0 -
Giáo trình CorelDRAW dành cho người mới học
48 trang 141 0 0 -
Giáo trình CorelDraw 10 - Tham khảo toàn diện: Phần 2
528 trang 133 0 0 -
Bài giảng Đồ họa máy tính: Khử mặt khuất - Ngô Quốc Việt
28 trang 127 0 0 -
Giáo trình Kỹ thuật đồ họa cho ngành Đa phương tiện: Phần 1
106 trang 87 1 0