如何在webgl中检查纹理是2d纹理还是立方体纹理?我想检查纹理类型来做不同的事情。 webgl只有一个纹理In [1]: import pandas as pd; import numpy as np
In [2]: df = pd.DataFrame(np.random.randn(4,2),columns=['A','B'],index=['p','q','r','s'])
In [3]: print(df)
A B
p -1.284468 -0.264533
q -0.347832 0.026523
r -0.349578 0.681883
s 0.004477 -0.738606
In [4]: df.as_matrix()
Out[4]:
array([[-1.28446781, -0.26453299],
[-0.34783207, 0.02652279],
[-0.34957842, 0.68188282],
[ 0.00447653, -0.73860575]])
In [5]: print(type(df.as_matrix()))
<class 'numpy.ndarray'>
接口。
答案 0 :(得分:0)
你不能。
您是创建纹理的人,因此您可以自己跟踪它们。
你可以
为每种纹理创建自己的类
创建一个函数createTexture
,用于检查目标并将每个纹理放入该类型的数组中。然后检查纹理是否在数组中以找出类型。或者,使用类型
包裹WebGLRenderingContext.prototype.createTexture
以执行上述操作。
天空的极限。