def build_mesh(self, mesh): for matNum, numFaces, idxBuff in mesh.faceGroups: rapi.immBegin(noesis.RPGEO_TRIANGLE) #rapi.immBegin(noesis.RPGEO_POINTS) for i in range(numFaces): numIdx = idxBuff[i * 13] for j in range(numIdx): idx = (13 * i) + (j * 4) normIdx = idxBuff[idx + 3] vertIdx = idxBuff[idx + 1] rapi.immNormal3f(mesh.normBuff, normIdx * 12) rapi.immVertex3f(mesh.vertBuff, vertIdx * 12) rapi.immEnd()
def build_mesh(self, mesh): for matNum, numFaces, idxBuff in mesh.faceGroups: rapi.immBegin(noesis.RPGEO_TRIANGLE) #rapi.immBegin(noesis.RPGEO_POINTS) for i in range(numFaces): numIdx = idxBuff[i*13] for j in range(numIdx): idx = (13 * i) + (j * 4) normIdx = idxBuff[idx + 3] vertIdx = idxBuff[idx + 1] rapi.immNormal3f(mesh.normBuff, normIdx*12) rapi.immVertex3f(mesh.vertBuff, vertIdx*12) rapi.immEnd()
def build_mesh_imm(self): for i in range(len(self.meshList)): mesh = self.meshList[i] matName = self.matList[mesh.matNum].name rapi.rpgSetMaterial(matName) rapi.immBegin(noesis.RPGEO_TRIANGLE) for j in range(mesh.numFaces * 3): #idx = noeUnpackFrom("i", mesh.idxBuff, j*4)[0] #uvIdx = noeUnpackFrom("i", mesh.uvIdxBuff, j*4)[0] idx = mesh.idxList[j] uvIdx = mesh.uvIdxList[j] rapi.immNormal3f(mesh.normBuff, idx*12) rapi.immUV2f(mesh.uvBuff, uvIdx*8) rapi.immVertex3f(mesh.vertBuff, idx*12) rapi.immEnd()
def build_mesh_imm(self): for i in range(len(self.meshList)): mesh = self.meshList[i] matName = self.matList[mesh.matNum].name rapi.rpgSetMaterial(matName) rapi.immBegin(noesis.RPGEO_TRIANGLE) for j in range(mesh.numFaces * 3): #idx = noeUnpackFrom("i", mesh.idxBuff, j*4)[0] #uvIdx = noeUnpackFrom("i", mesh.uvIdxBuff, j*4)[0] idx = mesh.idxList[j] uvIdx = mesh.uvIdxList[j] rapi.immNormal3f(mesh.normBuff, idx * 12) rapi.immUV2f(mesh.uvBuff, uvIdx * 8) rapi.immVertex3f(mesh.vertBuff, idx * 12) rapi.immEnd()