PyOpenGL之glVertexAttribPointer
PyOpenGL 开发参考文档:1.LearnOpenGL-cn2.简书-Python之OpenGL笔记,大龙103.PyOpenGL-APIglVertexAttribPointer的APISet an attribute pointer for a given shader (index)index -- the index of the generic vertex to bind, see
·
- PyOpenGL 开发参考文档:
1. LearnOpenGL-cn
2. 简书-Python之OpenGL笔记,大龙10
3. PyOpenGL-API - glVertexAttribPointer的API
Set an attribute pointer for a given shader (index)
index -- the index of the generic vertex to bind, see
glGetAttribLocation for retrieval of the value,
note that index is a global variable, not per-shader
size -- number of basic elements per record, 1,2,3, or 4
type -- enum constant for data-type
normalized -- whether to perform int to float
normalization on integer-type values
stride -- stride in machine units (bytes) between
consecutive records, normally used to create
"interleaved" arrays
pointer -- data-pointer which provides the data-values,
normally a vertex-buffer-object or offset into the
same.
This implementation stores a copy of the data-pointer
in the contextdata structure in order to prevent null-
reference errors in the renderer.
- 最后一个参数Pointer的坑
在python中,不能直接设置为0,必须要转为c_types的的格式,否则是跑不通的!
此处参考了资料中代码的写法。
更多推荐
所有评论(0)