130 likes | 247 Views
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:
E N D
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