Introduction to 3D Graphics Programming: Understanding DirectX and OpenGL
130 likes | 256 Vues
This course provides a comprehensive introduction to 3D graphics programming, focused on the mathematical foundations, algorithms, and data structures essential for creating 3D graphics. Emphasizing practical work, students will engage in assignments that explore both theoretical concepts and hands-on projects using DirectX and OpenGL. The curriculum covers 3D space, visualization techniques, animation, ray tracing, and more, allowing students to develop skills in various environments like Windows XP and Linux. Students will have the flexibility to choose their preferred graphics API and complete homework assignments to reinforce learning.
Introduction to 3D Graphics Programming: Understanding DirectX and OpenGL
E N D
Presentation Transcript
Honours Graphics 2008 Session 1
Purpose • Introduction to • 3D graphics programming • 3D mathematics • Algorithms and data structures of 3D graphics
Method & expectations • Emphasis on practical work • Evolutionary assignments • Independent studies
Working environment • Free choice: • DirectX –vs– OpenGL • Windows –vs– Lynux
Assignments & projects • Must work on departmental demo machine • Windows XP/ Lynux environments • DirectX 9.0c and OpenGL 1.2
Course outline • 3D space and maths • Colors, shading, rasterization • Visibility determination (fine and coarse) • Terrain and indoor algorithms • Animation and physics • Ray tracing • 3D graphics: gaming/non-gaming contexts
DirectX & OpenGL • For the most part functionally identical • Semantic differences: object-orientation –vs– function-orientation • DirectX has stronger developmentOpenGL has larger compatability
Sound, network, etc More initialization Hardware-orientated Unified codepath Regular updates Windows, XBox(360), Dreamcast Graphics only Faster for beginners API-orientated Extensions ARB review board Everything except XBox (mostly true) DirectX –vs– OpenGL
DirectX, code example • DX9 := Direct3DCreate9(..); • DX9.CreateDevice(..DX9Device..); • DX9Device.CreateVertexBuffer(..VB..); • D3DXMatrixLookAtLH(..); • D3DXMatrixPerspectiveFovLH(..); • DX9Device.SetTransform(..D3DTS_VIEW..); • DX9Device.SetTransform(..D3DTS_PROJECTION..); • VB.Lock(..); • .. • VB.Unlock(); • DX9Device.DrawPrimitive(..);
OpenGL, code example • glClear( GL_COLOR_BUFFER_BIT ); • glMatrixMode( GL_PROJECTION ); • glLoadIdentity(); • glFrustum(..); • glMatrixMode( GL_MODELVIEW ); • glLoadIdentity(); • glTranslatef( 0, 0, -3 ); • glBegin( GL_POLYGON ); • glColor3f( 0, 1, 0 ); • glVertex3f( -1, -1, 0 ); • .. • glEnd();
DirectX links • http://msdn.microsoft.com/en-us/directx/default.aspx • http://www.riemers.net/ • http://www.directxtutorial.com/ • http://www.pluralsight.com/wiki/default.aspx/Craig.DirectX.Direct3DTutorialIndex
OpenGL links • http://www.opengl.org/documentation/ • http://nehe.gamedev.net/ • http://www.sulaco.co.za/ • http://cs.uccs.edu/~semwal/indexGLTutorial.html
Homework • Chose, install and prepare your graphics API of choice for tomorrow