Open GL Computer Graphics using Open GL Open
- Slides: 44
������ Open. GL (Computer Graphics using Open. GL) ����������� Open. GL (Computer Graphics 1
����� 3 แนะนำ Open. GL (Introduction to Open. GL) ����������� Open. GL (Computer Graphics 2
ฟงกชน init () สำหรบกำหนดคาเรมตน ตวอยางการกำหนดฟงกชน init () เชน void init (void) { gl. Clear. Color (1. 0, 0. 0); // Set display-window color to white. gl. Point. Size (4. 0); // Set Point size to 4. 0 pixel gl. Line. Width (4. 0); // Set Line width to 4. 0 pixel gl. Matrix. Mode (GL_PROJECTION); // Set projection parameters. glu. Ortho 2 D (0. 0, 200. 0, 150. 0); } ����������� Open. GL (Computer Graphics 30
ฟงกชนสำหรบสรางงานกราฟก ตวอยางการสรางรปสเหลยมและลากเสนตรง เปนดงน void Line. And. Rectangle (void) { gl. Clear (GL_COLOR_BUFFER_BIT); // Clear display-window. gl. Color 3 f (0. 0, 1. 0); // Set object color to blue. gl. Rectf(180. 0, 280. 0); // Draw rectangle gl. Begin (GL_LINES); gl. Color 3 f (1. 0, 0. 0); // Set line segment color to red. gl. Vertex 2 i (20, 20); // Specify first vertex of line. gl. Vertex 2 i (150, 150); // Specify second vertex of line. gl. End ( ); gl. Flush ( ); // Process all Open. GL routines as quickly as possible. } ����������� Open. GL (Computer Graphics 32
ตวอยางการสรางงานกราฟก #include <GL/glut. h> // (or others, depending on the system in use) void init (void) { gl. Clear. Color (1. 0, 0. 0); // Set display-window color to white. gl. Line. Width (4. 0); // Set Line width to 4. 0 pixel gl. Matrix. Mode (GL_PROJECTION); // Set projection parameters. glu. Ortho 2 D (0. 0, 300. 0); } ����������� Open. GL (Computer Graphics 35
ตวอยางการสรางงานกราฟก void Line. And. Rectangle (void) { gl. Clear (GL_COLOR_BUFFER_BIT); // Clear display-window. gl. Color 3 f (0. 0, 1. 0); // Set object color to blue. gl. Rectf(180. 0, 280. 0); // Draw rectangle gl. Begin (GL_LINES); gl. Color 3 f (1. 0, 0. 0); // Set line segment color to red. gl. Vertex 2 i (20, 20); // Specify first vertex of line. ����������� Open. GL (Computer Graphics 36
ตวอยางการสรางงานกราฟก gl. Vertex 2 i (150, 150); // Specify second vertex of line. gl. End ( ); gl. Flush ( ); // Process all Open. GL routines as quickly as possible. } void main (int argc, char** argv) { glut. Init (&argc, argv); // Initialize GLUT. glut. Init. Display. Mode (GLUT_SINGLE | GLUT_RGB); // Set mode. ����������� Open. GL (Computer Graphics 37
ตวอยางการสรางงานกราฟก glut. Init. Window. Position (50, 100); // Set top-left display-window glut. Init. Window. Size (400, 400); // Set display-window width and height. glut. Create. Window ("An Example Open. GL Program"); // Create display window. init ( ); // Execute initialization procedure. glut. Display. Func (Line. And. Rectangle); // Send graphics to display window. ����������� Open. GL (Computer Graphics 38
ตวอยางการสรางงานกราฟก glut. Main. Loop ( ); // Display everything and wait. } ����������� Open. GL (Computer Graphics 39
การเขยนโปรแกรม Open. GL ใน Microsoft VC++ ตดตง Microsoft Visual Studio 6. 0 ในระบบใหเรยบรอย ดาวน โหลดไฟล glut-3. 7. 6 -bin. zip แลวแตก zip นำไฟลไปไวในโฟลเดอร ดงน glut. h ไปไวใน C: Program FilesMicrosoft Visual StudioVC 98IncludeGL glut 32. lib ไปไวใน C: Program FilesMicrosoft Visual StudioVC 98Lib glut 32. dll ไปไวใน C: WINDOWSSYSTEM ����������� Open. GL (Computer Graphics 40
����������� Open. GL (Computer Graphics 44
- Graphics monitor and workstation in computer graphics
- 3d viewing devices in computer graphics ppt
- Angel computer graphics
- Projection in computer graphics
- Plasma panel display in computer graphics
- In two dimensional viewing we have?
- Shear transformation in computer graphics
- Glsl sincos
- Rasterization in computer graphics
- Rigid body transformation in computer graphics
- Region filling in image processing
- Raster scan line in computer graphics
- Polygon fill algorithm
- In random scan display, the frame buffer holds ….
- Computer graphics
- Line draw algorithm in computer graphics
- Cs 418
- Cs 418 interactive computer graphics
- Depth sorting method in computer graphics
- Achromatic light in computer graphics
- Logical classification of input devices
- Uniform scaling in computer graphics
- Uniform scaling in computer graphics
- Orthogonal projection in computer graphics
- Logical input devices in computer graphics
- Fundamentals of computer graphics
- Points and lines in computer graphics ppt
- Dda algorithm in computer graphics ppt
- Dda algorithm in computer graphics
- What is window and viewport in computer graphics
- Keyframe animation in computer graphics
- Solid modeling in computer graphics
- Scan conversion in computer graphics
- 8 connected boundary fill algorithm
- Boundary representation in computer graphics
- Thick primitives in computer graphics
- Interaction in computer graphics
- Hierarchical modeling in computer graphics
- Rendering pipeline in computer graphics
- Scan converting circle in computer graphics
- Srgp in computer graphics
- Geometric transformation in computer graphics
- Midpoint line drawing algorithm in computer graphics
- Uniform scaling in computer graphics
- What are curves in computer graphics