Gambas文档
编译和安装
错误消息
代码片段
待办事项
废弃的组件
教程
开发环境文档
开发者文档
名词解释
如何操作
说明
维基手册
维基搜索
维基许可协议
文档
应用程序仓库
语言概览
语言索引
主题
组件
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.qt
gb.gui.qt.ext
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.io
gb.inotify
gb.logging
gb.map
gb.media
gb.media.form
gb.mime
gb.mongodb
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.opengl
Gl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.sdl
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
最近的修改

Gl.RasterPos3i (gb.opengl)

Static Sub RasterPos3i ( X As Integer, Y As Integer, Z As Integer )

Specify the raster position for pixel operations.

Parameters

x, y, z, w

Specify the x, y, z, and w object coordinates (if present) for the raster position.

Parameters

v

Specifies a pointer to an array of two, three, or four elements, specifying x, y, z, and w coordinates, respectively.

Description

The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to position pixel and bitmap write operations. It is maintained with subpixel accuracy. See Gl.Bitmap, Gl.DrawPixels, and Gl.CopyPixels.

The current raster position consists of three window coordinates (x, y, z), a clip coordinate value (w), an eye coordinate distance, a valid bit, and associated color data and texture coordinates. The w coordinate is a clip coordinate, because w is not projected to window coordinates. Gl.RasterPos4 specifies object coordinates x, y, z, and w explicitly. Gl.RasterPos3 specifies object coordinate x, y, and z explicitly, while w is implicitly set to 1. Gl.RasterPos2 uses the argument values for x and y while implicitly setting z and w to 0 and 1.

The object coordinates presented by Gl.RasterPos are treated just like those of a Gl.Vertex command: They are transformed by the current modelview and projection matrices and passed to the clipping stage. If the vertex is not culled, then it is projected and scaled to window coordinates, which become the new current raster position, and the Gl.CURRENT_RASTER_POSITION_VALID flag is set. If the vertex is culled, then the valid bit is cleared and the current raster position and associated color and texture coordinates are undefined.

The current raster position also includes some associated color data and texture coordinates. If lighting is enabled, then Gl.CURRENT_RASTER_COLOR (in RGBA mode) or Gl.CURRENT_RASTER_INDEX (in color index mode) is set to the color produced by the lighting calculation (see Gl.Light, Gl.LightModel, and Gl.ShadeModel). If lighting is disabled, current color (in RGBA mode, state variable Gl.CURRENT_COLOR) or color index (in color index mode, state variable Gl.CURRENT_INDEX) is used to update the current raster color. Gl.CURRENT_RASTER_SECONDARY_COLOR (in RGBA mode) is likewise updated.

Likewise, Gl.CURRENT_RASTER_TEXTURE_COORDS is updated as a function of Gl.CURRENT_TEXTURE_COORDS, based on the texture matrix and the texture generation functions (see Gl.TexGen). Finally, the distance from the origin of the eye coordinate system to the vertex as transformed by only the modelview matrix replaces Gl.CURRENT_RASTER_DISTANCE.

Initially, the current raster position is (0, 0, 0, 1), the current raster distance is 0, the valid bit is set, the associated RGBA color is (1, 1, 1, 1), the associated color index is 1, and the associated texture coordinates are (0, 0, 0, 1). In RGBA mode, Gl.CURRENT_RASTER_INDEX is always 1; in color index mode, the current raster RGBA color always maintains its initial value.

Notes

The raster position is modified by Gl.RasterPos, Gl.Bitmap, and Gl.WindowPos.

When the raster position coordinates are invalid, drawing commands that are based on the raster position are ignored (that is, they do not result in changes to GL state).

Calling Gl.DrawElements or Gl.DrawRangeElements may leave the current color or index indeterminate. If Gl.RasterPos is executed while the current color or index is indeterminate, the current raster color or current raster index remains indeterminate.

To set a valid raster position outside the viewport, first set a valid raster position, then call Gl.Bitmap with NULL as the bitmap parameter.

When the ARB_imaging extension is supported, there are distinct raster texture coordinates for each texture unit. Each texture unit's current raster texture coordinates are updated by Gl.RasterPos.

Errors

Gl.INVALID_OPERATION is generated if Gl.RasterPos is executed between the execution of Gl.Begin and the corresponding execution of Gl.End.

Associated Gets

Gl.Get with argument Gl.CURRENT_RASTER_POSITION

Gl.Get with argument Gl.CURRENT_RASTER_POSITION_VALID

Gl.Get with argument Gl.CURRENT_RASTER_DISTANCE

Gl.Get with argument Gl.CURRENT_RASTER_COLOR

Gl.Get with argument Gl.CURRENT_RASTER_SECONDARY_COLOR

Gl.Get with argument Gl.CURRENT_RASTER_INDEX

Gl.Get with argument Gl.CURRENT_RASTER_TEXTURE_COORDS

See also

Gl.Bitmap, Gl.DrawArrays, Gl.DrawElements, Gl.DrawRangeElements, Gl.MultiTexCoord, Gl.TexCoord, Gl.TexGen, Gl.Vertex, Gl.WindowPos

See original documentation on OpenGL website