如何将字做一个镜面效果?

nuaalfm 2003-07-19 10:14:02
就是将字体反过来。
...全文
281 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
leswang107 2003-07-29
  • 打赏
  • 举报
回复
这种效果在PS里不是很好做吗?为什么要用VB来做,又慢又烦效果又差。
goodname008 2003-07-19
  • 打赏
  • 举报
回复
lfItalic
Specifies an italic font if set to TRUE.
lfUnderline
Specifies an underlined font if set to TRUE.
lfStrikeOut
Specifies a strikeout font if set to TRUE.
lfCharSet
Specifies the character set. The following values are predefined:
ANSI_CHARSET
BALTIC_CHARSET
CHINESEBIG5_CHARSET
DEFAULT_CHARSET
EASTEUROPE_CHARSET
GB2312_CHARSET
GREEK_CHARSET
HANGUL_CHARSET
MAC_CHARSET
OEM_CHARSET
RUSSIAN_CHARSET
SHIFTJIS_CHARSET
SYMBOL_CHARSET
TURKISH_CHARSET

Korean Windows:
JOHAB_CHARSET
Middle-Eastern Windows:
HEBREW_CHARSET
ARABIC_CHARSET
Thai Windows:
THAI_CHARSET
The OEM_CHARSET value specifies a character set that is operating-system dependent.

You can use the DEFAULT_CHARSET value to allow the name and size of a font to fully describe the logical font. If the specified font name does not exist, a font from any character set can be substituted for the specified font, so you should use DEFAULT_CHARSET sparingly to avoid unexpected results.

Fonts with other character sets may exist in the operating system. If an application uses a font with an unknown character set, it should not attempt to translate or interpret strings that are rendered with that font.

This parameter is important in the font mapping process. To ensure consistent results, specify a specific character set. If you specify a typeface name in the lfFaceName member, make sure that the lfCharSet value matches the character set of the typeface specified in lfFaceName.

lfOutPrecision
Specifies the output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, pitch, and font type. It can be one of the following values: Value Meaning
OUT_CHARACTER_PRECIS Not used.
OUT_DEFAULT_PRECIS Specifies the default font mapper behavior.
OUT_DEVICE_PRECIS Instructs the font mapper to choose a Device font when the system contains multiple fonts with the same name.
OUT_OUTLINE_PRECIS Windows NT: This value instructs the font mapper to choose from TrueType and other outline-based fonts.
OUT_RASTER_PRECIS Instructs the font mapper to choose a raster font when the system contains multiple fonts with the same name.
OUT_STRING_PRECIS This value is not used by the font mapper, but it is returned when raster fonts are enumerated.
OUT_STROKE_PRECIS Windows NT: This value is not used by the font mapper, but it is returned when TrueType, other outline-based fonts, and vector fonts are enumerated.
Windows 95: This value is used to map vector fonts, and is returned when TrueType or vector fonts are enumerated.

OUT_TT_ONLY_PRECIS Instructs the font mapper to choose from only TrueType fonts. If there are no TrueType fonts installed in the system, the font mapper returns to default behavior.
OUT_TT_PRECIS Instructs the font mapper to choose a TrueType font when the system contains multiple fonts with the same name.


Applications can use the OUT_DEVICE_PRECIS, OUT_RASTER_PRECIS, and OUT_TT_PRECIS values to control how the font mapper chooses a font when the operating system contains more than one font with a given name. For example, if an operating system contains a font named Symbol in raster and TrueType form, specifying OUT_TT_PRECIS forces the font mapper to choose the TrueType version. Specifying OUT_TT_ONLY_PRECIS forces the font mapper to choose a TrueType font, even if it must substitute a TrueType font of another name.

lfClipPrecision
Specifies the clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. It can be one or more of the following values: Value Meaning
CLIP_DEFAULT_PRECIS Specifies default clipping behavior.
CLIP_CHARACTER_PRECIS Not used.
CLIP_STROKE_PRECIS Not used by the font mapper, but is returned when raster, vector, or TrueType fonts are enumerated.
Windows NT: For compatibility, this value is always returned when enumerating fonts.

CLIP_MASK Not used.
CLIP_EMBEDDED You must specify this flag to use an embedded read-only font.
CLIP_LH_ANGLES When this value is used, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed.
If not used, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system.

For more information about the orientation of coordinate systems, see the description of the nOrientation parameter

CLIP_TT_ALWAYS Not used.


lfQuality
Specifies the output quality. The output quality defines how carefully the graphics device interface (GDI) must attempt to match the logical-font attributes to those of an actual physical font. It can be one of the following values: Value Meaning
DEFAULT_QUALITY Appearance of the font does not matter.
DRAFT_QUALITY Appearance of the font is less important than when PROOF_QUALITY is used. For GDI raster fonts, scaling is enabled, which means that more font sizes are available, but the quality may be lower. Bold, italic, underline, and strikeout fonts are synthesized if necessary.
PROOF_QUALITY Character quality of the font is more important than exact matching of the logical-font attributes. For GDI raster fonts, scaling is disabled and the font closest in size is chosen. Although the chosen font size may not be mapped exactly when PROOF_QUALITY is used, the quality of the font is high and there is no distortion of appearance. Bold, italic, underline, and strikeout fonts are synthesized if necessary.


lfPitchAndFamily
Specifies the pitch and family of the font. The two low-order bits specify the pitch of the font and can be one of the following values:
DEFAULT_PITCH
FIXED_PITCH
VARIABLE_PITCH

Bits 4 through 7 of the member specify the font family and can be one of the following values:

FF_DECORATIVE
FF_DONTCARE
FF_MODERN
FF_ROMAN
FF_SCRIPT
FF_SWISS

The proper value can be obtained by using the Boolean OR operator to join one pitch constant with one family constant.

Font families describe the look of a font in a general way. They are intended for specifying fonts when the exact typeface desired is not available. The values for font families are as follows: Value Meaning
FF_DECORATIVE Novelty fonts. Old English is an example.
FF_DONTCARE Don't care or don't know.
FF_MODERN Fonts with constant stroke width (monospace), with or without serifs. Monospace fonts are usually modern. Pica, Elite, and CourierNew® are examples.
FF_ROMAN Fonts with variable stroke width (proportional) and with serifs. MS® Serif is an example.
FF_SCRIPT Fonts designed to look like handwriting. Script and Cursive are examples.
FF_SWISS Fonts with variable stroke width (proportional) and without serifs. MS® Sans Serif is an example.



lfFaceName
A null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 32 characters, including the null terminator. The EnumFontFamilies function can be used to enumerate the typeface names of all currently available fonts. If lfFaceName is an empty string, GDI uses the first font that matches the other specified attributes
goodname008 2003-07-19
  • 打赏
  • 举报
回复
上面的差不多了,是旋转字体的例子,对你的问题可能有些启发。
下面的是MSDN中关于LOGFONT的解释。

LOGFONT
The LOGFONT structure defines the attributes of a font.

typedef struct tagLOGFONT { // lf
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
TCHAR lfFaceName[LF_FACESIZE];
} LOGFONT;

Members
lfHeight
Specifies the height, in logical units, of the font's character cell or character. The character height value (also known as the em height) is the character cell height value minus the internal-leading value. The font mapper interprets the value specified in lfHeight in the following manner: Value Meaning
> 0 The font mapper transforms this value into device units and matches it against the cell height of the available fonts.
0 The font mapper uses a default height value when it searches for a match.
< 0 The font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts.


For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size.

This mapping occurs when the font is used for the first time.

For the MM_TEXT mapping mode, you can use the following formula to specify a height for a font with a given point size:

lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);

lfWidth
Specifies the average width, in logical units, of characters in the font. If lfWidth is zero, the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference.
lfEscapement
Specifies the angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text.
Windows NT: When the graphics mode is set to GM_ADVANCED, you can specify the escapement angle of the string independently of the orientation angle of the string's characters.

When the graphics mode is set to GM_COMPATIBLE, lfEscapement specifies both the escapement and orientation. You should set lfEscapement and lfOrientation to the same value.

Windows 95: The lfEscapement member specifies both the escapement and orientation. You should set lfEscapement and lfOrientation to the same value.

lfOrientation
Specifies the angle, in tenths of degrees, between each character's base line and the x-axis of the device.
lfWeight
Specifies the weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.
The following values are defined for convenience: Value Weight
FW_DONTCARE 0
FW_THIN 100
FW_EXTRALIGHT 200
FW_ULTRALIGHT 200
FW_LIGHT 300
FW_NORMAL 400
FW_REGULAR 400
FW_MEDIUM 500
FW_SEMIBOLD 600
FW_DEMIBOLD 600
FW_BOLD 700
FW_EXTRABOLD 800
FW_ULTRABOLD 800
FW_HEAVY 900
FW_BLACK 900
since1990 2003-07-19
  • 打赏
  • 举报
回复
如何使自己设计的程序具有漂亮和友好的界面,是程序员间永恒的话题。这里,笔者向您介绍一种非常简单的技巧,使文字旋转起来(图1)。

这里的“旋转字体”指的是让一行字体的水平基线(baseline)转过一定的角度。正如您所看到的,旋转字体会产生轻松、活泼的视觉效果,可以给观者以特殊的联想,是一种行之有效的显示特技。

有一种很容易想到的办法可以实现旋转字体,即首先生成文字的点阵(位图),然后利用坐标旋转变换生成新的位图再输出到屏幕或打印机上。这种办法思路清晰,不但可以用于字体的旋转,也可以用于其他种种字体变形,如同WinWord中的WordArt或中文之星的“艺术汉字”。但这种办法实现起来比较麻烦,需要一些计算机绘图学方面的知识,而且位图变换过程中需要占用较多的内存。而我们所要介绍的方法,可以有效地解决这些问题,而且不需要什么专门的知识,而是充分地利用Windows API已有的功能实现旋转字体的效果。

我们知道,逻辑字体是一类非常重要的Windows GDI对象。我们正是通过选择不同的逻辑字体来输出各种秀美的字体的。而所谓“旋转字体”不过是一类特殊的逻辑字体。如同其他的GDI对象(如画笔、画刷、调色板)一样,字体对象不但具有固有的字体,我们也可以建立自己的逻辑字体。建立字体可以使用Windows API的CreateFontIndirect()函数。在调用该函数之前,我们将字体的特征放入LOGFONT结构变量中。LOGFONT结构是这样定义的:

Type LOGFONT
lfHeight As Integer ' 字体的高度
lfWidth As Integer ' 字体的宽度
lfEscapement As Integer ' 字体旋转的角度
lfOrientation As Integer
lfWeight As Integer ' 字体的轻重
lfItalic As String * 1 ' 是否为斜体
lfUnderline As String * 1 ' 是否有下划线
lfStrikeOut As String * 1 ' 是否有强调线
lfCharSet As String * 1 ' 字符集
lfOutPrecision As String * 1 ' 输出精度
lfClipPrecision As String * 1 ' 剪裁精度
lfQuality As String * 1 ' 输出质量
lfPitchAndFamily As String * 1 ' 间距和字体族
lfFaceName As String * LF_FACESIZE ' 字体名,如“宋体”
End Type

利用这个数据结构,你可以方便地设置各种字体参数,比如高度、宽度等。该结构中同我们所要讨论的问题关系最大的是lfEscapement,它表示字符的基线同坐标的X轴之间的旋转角度,从X轴正方向开始沿逆时针方向旋转,以十分之一度为单位(图2)。蔡明志先生著的《Windows程序设计·绘图篇--使用Borland C++ for Windows》一书(科学出版社1993年9月出版)的482页上指出旋转角度以十度为单位,为此笔者查阅了SDK手册,其英文原文为:“measured in tenths of a degree”,似应为以十分之一度为单位。

lfFaceName指明字体的名称,如“宋体”、“行楷”。需要指出的是,个别字体不支持字体旋转,主要是字体宽度不可变的种类,如FixedSys就不支持字体旋转,好在这样的字体只有一两种。

具体的实现参见文后所附的程序(用Visual Basic 3.0编写),其中RotPrint过程用来输出旋转字体。其步骤如下:首先,利用GetObject()函数获得当前字体的LOGFONT结构,修改lfEscapement,设置旋转角度,然后调用CreateFontIndirect()函数建立逻辑字体并选用之。接下来,调用TextOut()函数输出字符串。使用TextOut()函数可以使那些不支持Print方法的控制(如标签),同样可以输出旋转字体。最后,用DeleteObject()函数删除建立的逻辑字体并恢复原字体。

您可以通过示例程序(图1)的“选择”菜单中的“字体”项来尝试不同的字体效果,从中选出令人满意的组合。

附录:源程序
ROTFONT.BAS文件:
DefInt A-Z

' 逻辑字体
Global Const LF_FACESIZE = 32 ' 最长的字体名称
Global Const SYSTEM_FONT = 13

Type LOGFONT
lfHeight As Integer
lfWidth As Integer
lfEscapement As Integer
lfOrientation As Integer
lfWeight As Integer
lfItalic As String * 1
lfUnderline As String * 1
lfStrikeOut As String * 1
lfCharSet As String * 1
lfOutPrecision As String * 1
lfClipPrecision As String * 1
lfQuality As String * 1
lfPitchAndFamily As String * 1
lfFaceName As String * LF_FACESIZE
End Type


' 字体的族

Global Const FF_DONTCARE = 0 ' 无所谓
Global Const FF_ROMAN = 16 ' 字体宽度可变,Times Roman, Century ' Schoolbook等
Global Const FF_SWISS = 32 ' 宽度可变,带衬线,如Helvetica, Swiss等
Global Const FF_MODERN = 48 ' 具有规定的宽度,衬线可有可无,
' 如Pica, Elite, Courier等等.
Global Const FF_SCRIPT = 64 ' 手写体,如Cursive
Global Const FF_DECORATIVE = 80 ' 特殊字体,如Old English

' GDI字体函数

Declare Function CreateFontIndirect Lib "GDI" (lpLogFont As LOGFONT) As Integer

Declare Function SelectObject Lib "GDI" (ByVal hDC%, ByVal Object%) As Integer

Declare Sub DeleteObject Lib "GDI" (ByVal Object%)

Declare Function GetStockObject Lib "GDI" (ByVal nIndex As Integer) As Integer

Declare Sub GDIGetObject Lib "GDI" Alias "GetObject" (ByVal hObject As Integer, ByVal nCount As Integer, lpObject As Any)

Declare Sub TextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal lpString As String, ByVal nCount As Integer)

ROTFONT.FRM文件:
VERSION 2.00
Begin Form frmRotDemo
Caption = "旋转字体演示"
ClientHeight = 4980
ClientLeft = 1095
ClientTop = 1785
ClientWidth = 4380
FontBold = -1 'True
FontItalic = 0 'False
FontName = "Courier New"
FontSize = 18
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 5670
Left = 1035
LinkTopic = "Form1"
ScaleHeight = 332
ScaleMode = 3 'Pixel
ScaleWidth = 292
Top = 1155
Width = 4500
Begin CommonDialog CMDialog1
Flags = 257
Left = 0
Top = 0
End
Begin Menu mnuOption
Caption = "选择(&O)"
Begin Menu mnuFont
Caption = "字体(&F)..."
Shortcut = ^F
End
Begin Menu mnuS1
Caption = "-"
End
Begin Menu mnuExit
Caption = "退出(&X)"
Shortcut = ^X
End
End
End
Option Explicit

Sub Form_Paint ()
Dim nAngle%

Cls
For nAngle% = 20 To 80 Step 10
ForeColor = QBColor(nAngle% / 10 - 2)
RotPrint hDC, "热情技术技巧 旋转字体", 10, 290, nAngle%
Next
End Sub

Sub mnuExit_Click ()
End
End Sub

Sub mnuFont_Click ()
' 初始化对话框控制
CMDialog1.FontName = FontName
CMDialog1.FontSize = FontSize
CMDialog1.FontItalic = FontItalic
CMDialog1.FontBold = FontBold
CMDialog1.FontUnderLine = FontUnderLine
CMDialog1.FontStrikeThru = FontStrikeThru
On Error GoTo ErrHandle
CMDialog1.Action = 4
' 设置窗体的字体属性
FontName = CMDialog1.FontName
FontSize = CMDialog1.FontSize
FontItalic = CMDialog1.FontItalic
FontBold = CMDialog1.FontBold
FontUnderLine = CMDialog1.FontUnderLine
FontStrikeThru = CMDialog1.FontStrikeThru
Refresh
ErrHandle:
End Sub

Sub RotPrint (ByVal hDestDC As Integer, Text$, x As Integer, y As Integer, LineAngle As Integer)

Dim hFont As Integer, hOldFont As Integer, r%
Dim Font As LOGFONT

hOldFont = SelectObject(hDestDC, GetStockObject(SYSTEM_FONT))

GDIGetObject hOldFont, Len(Font), Font

' 填充LOGFONT结构
Font.lfEscapement = LineAngle * 10 ' 输出字体行与水平页底间的角度(以1/10度为单位)

' 必须是可变点字体
Font.lfPitchAndFamily = Chr$(VARIABLE_PITCH Or FF_DONTCARE)

' 创建字体
hFont = CreateFontIndirect(Font)

' 选择旋转字体
r% = SelectObject(hDestDC, hFont)

' 显示字体
TextOut hDestDC, x, y, Text$, Len(Text$)

' 恢复原字体
hFont = SelectObject(hDestDC, hOldFont)

' 删除创建的字体
DeleteObject hFont

End Sub
xfzzf 2003-07-19
  • 打赏
  • 举报
回复
等待
flyingscv 2003-07-19
  • 打赏
  • 举报
回复
picture
paintpicture
csdngoodnight 2003-07-19
  • 打赏
  • 举报
回复
好么,这么长,为个效果,做这么长。得不偿失。

不如不要吧,做个阴影效果怎么样,很简单:

With Me
'阴影颜色,位置
.ForeColor = &HFFFFFF
.CurrentX = 590 '坐标
.CurrentY = 125
Me.Print .Caption '打印

'(前景字符,与阴影错开15单位就行了,单位:缇)
.ForeColor = &H0&
.CurrentX = 600
.CurrentY = 140
Me.Print .Caption '打印
End With
1.创建一个OpenGL窗口: 在这个教程里,我将教你在Windows环境中创建OpenGL程序.它将显示一个空的OpenGL窗口,可以在窗口和全屏模式下切换,按ESC退出.它是我们以后应用程序的框架. 理解OpenGL如何工作非常重要,你可以在教程的末尾下载源程序,但我强烈建议你至少读一遍教程,然后再开始编程. 2.你的第一个多边形: 在第一个教程的基础上,我们添加了一个三角形和一个四边形。也许你认为这很简单,但你已经迈出了一大步,要知道任何在OpenGL中绘制的模型都会被分解为这两种简单的图形。 读完了这一课,你会学到如何在空间放置模型,并且会知道深度缓存的概念。 3.添加颜色: 作为第二课的扩展,我将叫你如何使用颜色。你将理解两种着色模式,在左图中,三角形用的是光滑着色,四边形用的是平面着色。 注意三角形上的颜色是如何混合的。 颜色为OpenGlL 工程增加很多。通过理解平面着色(flat coloring)和平滑着色(smooth coloring),你能显著的改善你的OpenGL Demo的样子。 4.旋转: 在这一课里,我将教会你如何旋转三角形和四边形。左图中的三角形沿Y轴旋转,四边形沿着X轴旋转。 这一章将引入两个变量, rtri 被用来存储三角形的角度, rquad存储四边形的角度。 和容易创建一个多边形组成的场景。让这些物体动起来是整个场景变得生动起来。在后面的课程钟我将教给你如何绕屏幕上的一个点旋转物体,使得物体绕屏幕而不是它的轴转动。 5.3D形体: 既然我们已经领会到多边形,方形,色彩和旋转。现在该建立3D物体了。我将使用多边形和矩形c创建3D物体。这次我们将扩展上一章的教程,并且将三角形转换成一个彩色的棱锥,把正方形变为一个实心正方体。棱锥使用混合色,正方体每个面使用一种颜色。在3D空间创建物体可能很费时间,但是所获得的结果(收获)值得这样。充分发挥你的想象力吧。 6.纹理映射: 你想要它,它现在就在这里了,那就是 ... 纹理映射!!!在这一章我将教会你如何将一幅位图(bitmap)映射到正方体的六个面上去。我们将使用第一章的OpenGL代码来创建工程。创建一个空的窗口比修改上一课的代码更容易。 你将会发现第一章的代码在对于快速创建工程来说是及其有价值的。第一章的代码为你设置好了一切,你所需要的只是集中精力为效果编程。 7.纹理滤波, 光照和键盘控制: 好的,我希望到现在你已经理解了所有的东西,因为这是一个巨大的教程。我想教给你两个新的方法来过滤(filter)你的纹理,简单的光照,键盘控制并且还可能更多 :) .如果你对到这一课为止你所学的东西并不充满信心,那就回头复习一下。玩一下其它课程的代码,不要操之过急。最好专心把每一课学好,而不是蜻蜓点水,只知道如何把东西出来。 8.混合 有理由等一下,一个来自很酷的Hypercosm的程序员伙伴问(我)他是否可以写一章关于混合的教程。第八课通常正是讲混合的,所以太巧了。这一章教程扩展了第七章。混合是一项很酷的技术 .. 我希望你们能好好享受这一章教程。这一章的作者是Tom Stanis他在这制作一章上花费了很多精力,所以让他知道你觉得怎么样。混合可不是一个好讲的话题。 9.在3D空间中移动位图: 这一章覆盖了一些你们要求的主题,你想知道如何移动你在3D屏幕空间上创造的物体。你想要知道如何在屏幕上绘制一幅位图,并且位图的黑色部分不会覆盖它后面的东西。你想要简单的动画,想要更多的混合的应用,这一章将教会你所有这些。You'll notice there's no spinning boxes(yaker:很惭愧这一句我不是很明白)。前面的课程覆盖了OpenGL的基础,每一章都基于前面的内容。前面的课程涵盖了基础的OpenGL,每一课都是在前一课的基础上创建的。这一课是前面几课知识的综合,当你学习这课时,请确保你已经掌握了前面几课的知识。 10.加载3D世界,并在其中漫游: 你一直期待的教程来了!这一章友一个叫Lionel Brites的伙伴制作。这一课里你讲学到如何导入一个3D世界。代码仍然使用第一章的,但是,课程页面只是解释了新的部分,包括导入3D场景,在3D世界中移动。下载VC++代码并且在你阅读教程的同时阅读代码。按[B]键控制混合,[F]键控制滤波,[L]键控制光照(但光并不随场景移动),还有[Page UP]和[Page Down]键。我希望你能喜欢Lionel对网站的贡献。我有空的时候我会让这个教程更容易学习。 11.旗帜效果 (飘动的纹理): 这一章教程由Bosco带给你。他就是那个创造了很酷的小Demo: worthless的家伙。他喜欢每个人对他的Demo的反映,并且决定更进一步,在他的Demo的最后解释他怎么实现这么酷的效果的。这一章教程构建在第六章的代码之上。阅读完这一章之后,你将能弯曲,折叠以及操纵你自己的纹理。这绝对是个很漂亮的效果,并且比纹理固定的旗帜好得多。如果你喜欢这一章,请发邮件给bosco让他知道。 12.显示列表 想知道如何加速你的OpenGL程序么?每次为放置一个物体在屏幕上而写很多代码让你厌烦了吧?如果是这样,这一章就是为你准备的。学习如何用OpenGL来显示列表。只用一行代码预构建和显示物体。使用预编译物体加速你的程序。不要再一次又一次写重复的代码。让显示列表为你所有的工作吧!这一章里我们将建造Q-bert金塔(Q-bert是一款游戏),感谢显示列表,我们只需要用不多的几行代码。 13.位图体 这一课我们将创建一些基于2D图像的体,它们可以缩放,但不能旋转,并且总是面向前方,但作为基本的显示来说,我想已经够了。 14.图像体 在一课我们将教你绘制3D的图形体,它们可像一般的3D模型一样被变换。 15.图形体的纹理映射: 这一课,我们将在上一课的基础上创建带有纹理的体,它真的很简单。 16.看起来很酷的雾 这一课是基于第7课的代码的,你将学会三种不同的雾的计算方法,以及怎样设置雾的颜色和雾的范围。 17.2D 图像文 在这一课中,你将学会如何使用四边形纹理贴图把文显示在屏幕上。你将学会如何把256个不同的文一个256x256的纹理图像中分别提取出来,并为每一个创建一个显示列表,接着创建一个输出函数来创建任意你希望的文。 18.二次几何体 利用二次几何体,你可以很容易的创建球,圆盘,圆柱和圆锥。 19.粒子系统 你是否希望创建爆炸,喷泉,流星之类的效果。这一课将告诉你如何创建一个简单的例子系统,并用它来创建一种喷射的效果。 20.蒙板 到目前为止你已经学会如何使用alpha混合,把一个透明物体渲染到屏幕上了,但有的使用它看起来并不是那么的复合你的心意。使用蒙板技术,将会按照你蒙板的位置精确的绘制。 21.线,反走样,计时,正投影和简单的声音 这是我第一个大的教程,它将包括线,反走样,计时,正投影和简单的声音。希望这一课中的东西能让每个人感到高兴。 22.凹凸映射,多重纹理扩展 这是一课高级教程,请确信你对基本知识已经非常了解了。这一课是基于第六课的代码的,它将建立一个非常酷的立体纹理效果。 23.球面映射 这一个将教会你如何把环境纹理包裹在你的3D模型上,让它看起来象反射了周围的场景一样。 24.符号,扩展,剪裁和TGA图像文件的加载 在这一课里,你将学会如何读取你显卡支持的OpenGL的扩展,并在你指定的剪裁区域把它显示出来。 25.变形和从文件中加载3D物体 在这一课中,你将学会如何从文件加载3D模型,并且平滑的从一个模型变换为另一个模型。 26.剪裁平面,蒙板缓存和反射 在这一课中你将学会如何创建镜面显示效果,它使用剪裁平面,蒙板缓存等OpenGL中一些高级的技巧。 27.阴影 这是一个高级的主题,请确信你已经熟练的掌握了基本的OpenGL,并熟悉蒙板缓存。当然它会给你留下深刻的印象的。 28.贝塞尔曲面 这是一课关于数学运算的,没有别的内容了。来,有信心就看看它吧。 29.Blitter 函数 类似于DirectDraw的blit函数,过时的技术,我们有实现了它。它非常的简单,就是把一块纹理贴到另一块纹理上。 30.碰撞检测 这是一课激动的教程,你也许等待它多时了。你将学会碰撞剪裁,物理模拟太多的东西,慢慢期待吧。 31.模型加载 你知道大名鼎鼎的Milkshape3D建模软件么,我们将加载它的模型,当然你可以加载任何你认为不错的模型。 32.拾取, Alpha混合, Alpha测试, 排序 这又是一个小游戏,交给的东西会很多,慢慢体会吧 33.加载压缩和未压缩的TGA文件 在这一课里,你将学会如何加载压缩和为压缩的TGA文件,由于它使用RLE压缩,所以非常的简单,你能很快地熟悉它的。 34.从高度图生成的美丽地形 这一课将教会你如何从一个2D的灰度图创建地形 35.在OpenGL中播放AVI视频 在OpenGL中如何播放AVI呢?利用Windows的API把每一帧作为纹理绑定到OpenGL中,虽然很慢,但它的效果不错。你可以试试。 36.放射模糊和渲染到纹理 如何实现放射状的滤镜效果呢,看上去很难,其实很简单。把渲染得图像作为纹理提取出来,在利用OpenGL本身自带的纹理过滤,就能实现这种效果,不信,你试试。 37.卡通映射 什么是卡通了,一个轮廓加上少量的几种颜色。使用一维纹理映射,你也可以实现这种效果。 38.从资源文件中载入图像 如何把图像数据保存到*.exe程序中,使用Windows的资源文件吧,它既简单又实用。 39.物理模拟简介 还记得高中的物理吧,直线运动,自由落体运动,弹簧。在这一课里,我们将创造这一切。 40.绳子的模拟 怎样模拟一根绳子呢,把它想象成一个个紧密排列的点,怎么样有了思路了吧,在这一课你你将学会怎样建模,简单吧,你能模拟更多。 41.体积雾 把雾坐标绑定到顶点,你可以在雾中漫游,体验一下吧。 42.多重视口 画中画效果,很酷吧。使用视口它变得很简单,但渲染四次可会大大降低你的显示速度哦:) 43.在OpenGL中使用FreeType库 使用FreeType库可以创建非常好看的反走样的体,记住暴雪公司就是使用这个库的,就是那个魔兽世界的。尝试一下吧,我只告诉你了基本的使用方式,你可以走的更远。 44.3D 光晕 当镜头对准太阳的时候就会出现这种效果,模拟它非常的简单,一点数学和纹理贴图就够了。好好看看吧。 45.顶点缓存 你想更快地绘制么?直接操作显卡吧,这可是前沿的图形技术,不要犹豫,我带你入门。接下来,你自己向前走吧。 46.全屏反走样 当今显卡的强大功能,你几乎什么都不用,只需要在创建窗口的时候该一个数据。看看吧,驱动程序为你完了一切。 47.CG 顶点脚本 nVidio的面向GPU的C语言,如果你相信它就好好学学吧,同样这里也只是个入门。记住,类似的语言还有微软的HLSL,OpenGL的GLSL,ATI的shaderMonker。不要选错哦:) 48.轨迹球实现的鼠标旋转

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧