呼吁专家,专家和其他人来帮助阅读和解析python文件。
在第六版的第751页。或第7版第800页。Superbible OpenGL的附录B。SBM文件格式似乎在某种程度上很好地解释了该格式。
我试图在python中实现此文件格式的阅读器。
好的,已经取得了进展。我已经将Rabbid76惊人的代码合并到提供的源代码中。尽管我正在尝试取得更多进展。
更新Jun 23,2019-主要进展,修复了关于glVertexAttribPointer(i,...的错误。
当天,修复了Python无法找到变量第一个错误。
当天,成功!!!我们有渲染的东西!这是最终的程序sbmloader.py,它读取,解析由此问题创建的SBM文件格式。
虽然下一个问题。在第2部分中已经回答了,创建ktxloader
更新:2019年6月24日Rabbid76已使用完美代码修复了渲染问题。我震惊,非常感谢!
要读取,解析的数据在这里torus_nrms_tc.sbm
任何帮助,评论或见解将不胜感激。这是我到目前为止所拥有的。
import sys
import time
import os
import time
import math
import ctypes
currentWDir = os.getcwd()
print( 'current working directory: {}'.format( str(currentWDir) ) )
fileDir = os.path.dirname(os.path.abspath(__file__)) # det the directory of this file
print( 'current location of self: {}'.format( str(fileDir) ) )
parentDir = os.path.abspath(os.path.join(fileDir, os.pardir)) # get the parent directory of this file …Run Code Online (Sandbox Code Playgroud)