osg学习(五十八)cow.osg解析过程
Posted hankern
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了osg学习(五十八)cow.osg解析过程相关的知识,希望对你有一定的参考价值。
1、文件结构
Group
UniqueID Group_0
DataVariance STATIC
cullingActive TRUE
num_children 1
Geode
DataVariance DYNAMIC
name "cow.osg"
cullingActive TRUE
num_drawables 1
Geometry
DataVariance DYNAMIC
StateSet
DataVariance STATIC
rendering_hint OPAQUE_BIN
renderBinMode INHERIT
GL_CULL_FACE OFF
GL_LIGHTING ON
Material
DataVariance STATIC
ColorMode OFF
ambientColor 0.5 0.5 0.5 1
diffuseColor 1 1 1 1
specularColor 1 1 1 1
emissionColor 0 0 0 1
shininess 1
textureUnit 0
GL_TEXTURE_GEN_S ON
GL_TEXTURE_GEN_T ON
GL_TEXTURE_2D ON
Texture2D
DataVariance STATIC
file "Images/reflect.rgb"
wrap_s REPEAT
wrap_t REPEAT
wrap_r REPEAT
min_filter NEAREST_MIPMAP_LINEAR
mag_filter LINEAR
internalFormatMode USE_IMAGE_DATA_FORMAT
subloadMode OFF
TexGen
DataVariance STATIC
mode SPHERE_MAP
useDisplayList TRUE
Primitives 1
DrawArrayLengths TRIANGLE_STRIP 0 984
3
3
...
14
5
5
VertexArray 7772
4.76334 -1.36791 3.02949
4.85496 -1.36297 3.09889
...
4.28129 -1.22566 2.49441
-3.35701 -0.367444 2.22033
-3.38084 -0.315387 2.25835
-3.34827 -0.438575 2.2064
-3.39281 -0.43866 2.20802
-3.41337 -0.580969 2.31026
NormalBinding PER_VERTEX
NormalArray 7772
0.254622 -0.918791 -0.301648
0.440603 -0.85537 -0.272417
0.244499 -0.920072 -0.306084
...
0.701499 2.00244e-05 0.71267
0.501693 4.00296e-05 0.865046
0.465203 0.372921 0.802818
ColorBinding OVERALL
ColorArray Vec4Array 1
0.8 0.8 0.8 1
TexCoordArray 0 Vec2Array 7772
0 0
...
0 0
0 0
2、读取文件
2.1读取纹理
2.2读取图元
2.3读取顶点
2.3读取法线
2.4 读取颜色
2.5读取纹理坐标
以上是关于osg学习(五十八)cow.osg解析过程的主要内容,如果未能解决你的问题,请参考以下文章