Surface Rendering With OpenGL - PowerPoint PPT Presentation

About This Presentation
Title:

Surface Rendering With OpenGL

Description:

specular color of material (0.0, 0.0, 0.0, 1.0) GL_SPECULAR. diffuse color of material ... specular RGBA intensity of light (1.0, 1.0, 1.0, 1.0) GL_SPECULAR ... – PowerPoint PPT presentation

Number of Views:143
Avg rating:3.0/5.0
Slides: 14
Provided by: Rui76
Learn more at: https://www.cs.umb.edu
Category:

less

Transcript and Presenter's Notes

Title: Surface Rendering With OpenGL


1
Surface Rendering With OpenGL
  • CS460 Project
  • by Rui Yu
  • 11/30/03

2
Two aspects
  • Windowing system or user interface
  • Use MFC
  • Create a window
  • Viewport is the client area of the window
  • Capture mouse move events in the client area
  • Add buttons on a tools bar
  • OpenGL commands
  • Use gl,glu fuctions
  • Viewing pipeline
  • Surface rendering

3
Viewing pipeline
  • ChoosePixelFormat // Define pixel format
  • wglCreateContext //Create rendering
    context.
  • glMatrixMode(GL_MODELVIEW)
  • glRotatef //rotate
  • glScalef //scale
  • glMatrixMode(GL_PROJECTION)
  • glOrtho(-1,1,-1,1,-1,1) //Parellel
    projection
  • glViewport(0, 0, cx, cy)
  • glBegin(GL_LINES) //or GL_POLYGON and etc.
  • glVertex3d
  • glVertex3d
  • glEnd
  • SwapBuffers

3D modeling coordinates
Modeling transformation
3D world coordinates
Clipping projection
Transform into viewport
2D device coordinates
4
Example
  • Pixel Format DOUBLE BUFFER, RGBA, DRAW_TO_WINDOW
  • View volume

5
Screen Shots (1)-draw 3D points interactively
6
Screen Shots (2)-draw 3D bezier surface with
zoom and rotation
7
Shading
  • The Mathematics of Lighting
  • vertex color
  • global ambient light ambient material
  • ?i attenuation factor Ii
  • ambient light ambient material
  • (max 1 x n , 0 ) diffuse light diffuse
    material
  • (max s x n ,0 )shininess specular light
    specular material
  • l the unit vector that points from the vertex
    to the light position
  • n the unit normal vector at the vertex.
  • Default Lighting Value
  • Global Ambient Light 0.2, 0.2, 0.2, 1.0

8
Table1 Default Values for glLight0()
Table2 Default Values for glMaterial()
9
Screen Shots (3)-Change light intensity and
material property (1)
10
Screen Shots (4)-Change light intensity and
material property (2)
11
Screen Shots (5)-Drag control points of bezier
surface and texture mapping (1)
12
Screen Shots (6)-Drag control points of bezier
surface and texture mapping (2)
13
bibliography
  • Msdn
  • http//www.msdn.com
  • OpenGL Programming Guide or 'The Red Book from
    Silicon Graphics, Inc
  • Guide to OpenGL on Windows from Silicon Graphics
  • http//www.opengl.org/developers/documentation/ove
    rviews.html
  • OpenGL Win32 Tutorial
  • http//www.nullterminator.net/opengl32.html
  • http//www.opengl.org/developers/code/tutorials.ht
    ml
  • Basic Curves And Surfaces Modeler by Sharjith
  • http//www.codeproject.com/useritems/cadsurf.asp
Write a Comment
User Comments (0)
About PowerShow.com