- 帖子
- 3151
- 积分
- 6455
- 技术
- 317
- 捐助
- 70
- 注册时间
- 2008-8-3
|
[转载教程] Manning - Graphics Programming With Perl - 2002.pdf
本帖最后由 523066680 于 2012-2-13 15:46 编辑
Graphics
Programming
with Perl
部分目录
Part 1 Foundations 1
1 Overview of graphics 3
1.1 Perl and graphics 4
1.2 The bits and pieces in graphics programming 5
1.3 Color spaces and palettes 7
RGB 7 ✦ CMY and CMYK 8 ✦ HSV and HLS 9
YUV, YIQ and YCbCr 12 ✦ Grayscale 12
Color distance 13 ✦ Reducing the number of
colors in an image 13
1.4 Summary 14
部分章节提到了OpenGL 绘图并写入png图片
引用一下
#!/usr/local/bin/perl -w
use strict;
use OpenGL qw(:all :old);
require "OpenGLTools.pl";
sub triangle
{
glBegin (GL_TRIANGLES);
glColor3f (0.0, 0.0, 0.0);
glVertex2f(0.0, 0.0);
glColor3f (0.5, 0.5, 0.5);
glVertex2f(30.0, 0.0);
glColor3f (1.0, 1.0, 1.0);
glVertex2f(0.0, 30.0);
glEnd ();
}
glpOpenWindow (width => 250, height => 250);
glLoadIdentity();
gluOrtho2D (0.0, 30.0, 0.0, 30.0);
glClearColor (1.0, 1.0, 1.0, 0.0);
glClear (GL_COLOR_BUFFER_BIT);
triangle();
gltIMCapture("OpenGLcap1.png", 50, 50, 100, 100);
gltIMCapture("OpenGLcap2.png");
This is a basic OpenGL application that draws a triangle, filled with a smooth grayscale
gradient. Once the drawing is finished, it captures part of the window, and the
whole window with the previously discussed gltIMCapture() function, and saves
these captures to files which can be seen in figure 9.1.
电驴下载地址:
ed2k://|file|Manning%20-%20Graphics%20Programming%20With%20Perl%20-%202002.pdf|2708706|867727814729C482CA516B76D7B52174|h=QUGTPZUJEXAPKPYO2G5L3ROPCFCX5FVY|/
另外我也传到了ys168网盘 目录 : 教程\Perl\
http://523066680.ys168.com |
|