它是TCL中的某种OpenGL,但这是什么语言?
It is some kind of OpenGL in TCL, but what language is this?
这是 TCL
和 OpenGL
,但我不知道它到底是哪种语言,因此找不到它的文档。特别是,我需要了解 OGL 行上的所有属性。
global Qu
gl matrixmode projection
gl pushmatrix
gl loadidentity
gl ortho 0 50. 0 50. -1. 1.
gl matrixmode modelview
gl pushmatrix
gl loadidentity
gl color 1 1 1 1
if {$Qu(Speed) >= 30 } {
OGL drawtex sans-bold "Speed 3" -center -pos 25 47 0 -dir 2 0 0 -up 0 2 0
OGL drawtex sans "[format %#.3g $Qu(Speed)]" -center -pos 25 44 0 -dir 3 0 0 -up 0 3 0
}
这段代码的作用是当speed>=30
.
时,在屏幕上以两行文字的形式显示速度
嗯,从 gl matrixmode projection
到 gl color 1 1 1 1
的第一行是非常简单的 OpenGL 函数(实际上已弃用 OpenGL )。另一行似乎不言自明,但是您可以尝试稍微更改它们以查看每个参数有什么影响。
我认为如下(只是猜测):
- OGL drawtext: 绘制文本的命令
- sans-bold: 字体系列或文件名。
- "Speed 3": 简单文本
- "[format %#.3g $Qu(Speed)]": 将速度插入字符串的格式化文本。
- -center: 文本以其位置为中心。
- -pos, -dir and -up: 位置、方向和向上向量
这是 TCL
和 OpenGL
,但我不知道它到底是哪种语言,因此找不到它的文档。特别是,我需要了解 OGL 行上的所有属性。
global Qu
gl matrixmode projection
gl pushmatrix
gl loadidentity
gl ortho 0 50. 0 50. -1. 1.
gl matrixmode modelview
gl pushmatrix
gl loadidentity
gl color 1 1 1 1
if {$Qu(Speed) >= 30 } {
OGL drawtex sans-bold "Speed 3" -center -pos 25 47 0 -dir 2 0 0 -up 0 2 0
OGL drawtex sans "[format %#.3g $Qu(Speed)]" -center -pos 25 44 0 -dir 3 0 0 -up 0 3 0
}
这段代码的作用是当speed>=30
.
嗯,从 gl matrixmode projection
到 gl color 1 1 1 1
的第一行是非常简单的 OpenGL 函数(实际上已弃用 OpenGL )。另一行似乎不言自明,但是您可以尝试稍微更改它们以查看每个参数有什么影响。
我认为如下(只是猜测):
- OGL drawtext: 绘制文本的命令
- sans-bold: 字体系列或文件名。
- "Speed 3": 简单文本
- "[format %#.3g $Qu(Speed)]": 将速度插入字符串的格式化文本。
- -center: 文本以其位置为中心。
- -pos, -dir and -up: 位置、方向和向上向量