我有一个3D模型。它包括一些街道。行动是直行,后退,左转,右转。
我将.cs文件附加到相机。我用它回去并在代码下面转发:
attributeB
它对我有用。我将一个不同的.cs文件附加到3d模型的游戏对象。文件内容为:
import numpy as np
m = np.random.randint(0,2,(5,5)).astype('bool')
print(m) # game matrix
# Running all cels in matrix
for i in range(m.shape[0]):
for j in range(m.shape[1]):
# clip will ensure you'll never have a value below 0 for indexes which
# is important at the borders of the game.
c = np.count_nonzero(m[np.clip(i-1,0,m.shape[0]):i+2,np.clip(j-1,0,m.shape[1]):j+2])
if m[i,j]:
c = c - 1 # ensure you are not couting the cell where you are in.
print('FOR POSITION ',i,j,' FOUND ',c,' MINES.')
但是当我试图左右转弯时,我会留在建筑物后面。
如何使用模型在3d模型中定期向右或向左转?
编辑
我的坐标系和场景视图是: